/** * @param mixed $value */ public function __construct($value) { if (is_string($value) && is_file($value) && is_readable($value)) { $value = file_get_contents($value); } if (!is_resource($value)) { $value = openssl_pkey_get_public($value); } parent::__construct($value); }
/** * @param mixed $value * @param string|null $passphrase */ public function __construct($value, $passphrase = null) { if (is_string($value) && is_file($value) && is_readable($value)) { $value = file_get_contents($value); } if (!is_resource($value)) { $value = openssl_pkey_get_private($value, $passphrase); } parent::__construct($value); }
/** * KeyOtherValue constructor. * * @param callable $callback * @param string $key * @param string $otherKey */ public function __construct(callable $callback, $key, $otherKey) { parent::__construct($callback, $key); $this->otherKey = $otherKey; }