diff options
Diffstat (limited to 'vendor/league/html-to-markdown/src/Configuration.php')
-rw-r--r-- | vendor/league/html-to-markdown/src/Configuration.php | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/vendor/league/html-to-markdown/src/Configuration.php b/vendor/league/html-to-markdown/src/Configuration.php index 5bc8d5503..7e1d71e68 100644 --- a/vendor/league/html-to-markdown/src/Configuration.php +++ b/vendor/league/html-to-markdown/src/Configuration.php @@ -1,15 +1,18 @@ <?php +declare(strict_types=1); + namespace League\HTMLToMarkdown; class Configuration { + /** @var array<string, mixed> */ protected $config; /** - * @param array $config + * @param array<string, mixed> $config */ - public function __construct(array $config = array()) + public function __construct(array $config = []) { $this->config = $config; @@ -17,59 +20,60 @@ class Configuration } /** - * @param array $config + * @param array<string, mixed> $config */ - public function merge(array $config = array()) + public function merge(array $config = []): void { $this->checkForDeprecatedOptions($config); - $this->config = array_replace_recursive($this->config, $config); + $this->config = \array_replace_recursive($this->config, $config); } /** - * @param array $config + * @param array<string, mixed> $config */ - public function replace(array $config = array()) + public function replace(array $config = []): void { $this->checkForDeprecatedOptions($config); $this->config = $config; } /** - * @param string $key - * @param mixed $value + * @param mixed $value */ - public function setOption($key, $value) + public function setOption(string $key, $value): void { - $this->checkForDeprecatedOptions(array($key => $value)); + $this->checkForDeprecatedOptions([$key => $value]); $this->config[$key] = $value; } /** - * @param string|null $key - * @param mixed|null $default + * @param mixed|null $default * * @return mixed|null */ - public function getOption($key = null, $default = null) + public function getOption(?string $key = null, $default = null) { if ($key === null) { return $this->config; } - if (!isset($this->config[$key])) { + if (! isset($this->config[$key])) { return $default; } return $this->config[$key]; } - private function checkForDeprecatedOptions(array $config) + /** + * @param array<string, mixed> $config + */ + private function checkForDeprecatedOptions(array $config): void { foreach ($config as $key => $value) { if ($key === 'bold_style' && $value !== '**') { - @trigger_error('Customizing the bold_style option is deprecated and may be removed in the next major version', E_USER_DEPRECATED); + @\trigger_error('Customizing the bold_style option is deprecated and may be removed in the next major version', E_USER_DEPRECATED); } elseif ($key === 'italic_style' && $value !== '*') { - @trigger_error('Customizing the italic_style option is deprecated and may be removed in the next major version', E_USER_DEPRECATED); + @\trigger_error('Customizing the italic_style option is deprecated and may be removed in the next major version', E_USER_DEPRECATED); } } } |