diff options
author | Mario <mario@mariovavti.com> | 2021-06-05 08:47:24 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2021-06-05 08:47:24 +0000 |
commit | fd8a5ff4c49fc1361f9928ea4d33e6d24d43a3a5 (patch) | |
tree | 7560147f31a273fb8f0e05476f99f1deea0e12de /vendor/league/html-to-markdown/src/Configuration.php | |
parent | 4db384da34595adef68be6226e8b331b4d7b7f31 (diff) | |
download | volse-hubzilla-fd8a5ff4c49fc1361f9928ea4d33e6d24d43a3a5.tar.gz volse-hubzilla-fd8a5ff4c49fc1361f9928ea4d33e6d24d43a3a5.tar.bz2 volse-hubzilla-fd8a5ff4c49fc1361f9928ea4d33e6d24d43a3a5.zip |
composer update league/html-to-markdown
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); } } } |