mirror of
https://github.com/crypto-pro-web/crypto-pro-php.git
synced 2025-04-18 19:33:06 +03:00
34 lines
598 B
PHP
Executable File
34 lines
598 B
PHP
Executable File
<?php
|
|
|
|
namespace Webmasterskaya\CryptoPro\Dictionary;
|
|
|
|
abstract class DictionaryItem
|
|
{
|
|
protected $options;
|
|
|
|
protected function __construct(array $options)
|
|
{
|
|
$this->options = $options;
|
|
}
|
|
|
|
public function __get($name)
|
|
{
|
|
if (!isset($this->options[$name]))
|
|
{
|
|
user_error("Can't set property: " . __CLASS__ . "->" . $name);
|
|
}
|
|
|
|
return $this->options[$name];
|
|
}
|
|
|
|
public function __set($name, $value)
|
|
{
|
|
user_error("Can't set property: " . __CLASS__ . "->" . $name);
|
|
}
|
|
|
|
public static function getItem(array $options)
|
|
{
|
|
return new class($options) extends DictionaryItem {
|
|
};
|
|
}
|
|
} |