Skip to content

Commit

Permalink
fix(code): try to be PHP8 compliant
Browse files Browse the repository at this point in the history
  • Loading branch information
e-picas committed Jan 28, 2024
1 parent a52bc4f commit b487130
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"require": { "php": ">=5.3.3" },
"require-dev": {
"phpunit/phpunit": "@stable",
"phpunit/phpunit": "9.*",
"phpmd/phpmd": "@stable",
"friendsofphp/php-cs-fixer": "@stable",
"phpmetrics/phpmetrics": "@stable",
Expand Down
2 changes: 1 addition & 1 deletion src/MarkdownExtended/API/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ public static function applyConfig($name, array $params, $default = null)
*/
protected static function _configRecursiveIterator(
$type = 'get',
$index,
$index = 0,
$value = null,
$default = null
) {
Expand Down
5 changes: 4 additions & 1 deletion src/MarkdownExtended/Console/Stream.php
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,10 @@ public function getPipedInput()
$data .= fgets($this->stdin);
}
}
@file_put_contents($this->stdin, '');
/* if (is_file($this->stdin)) {
file_put_contents($this->stdin, '');
}
*/
} catch (\Exception $e) {
$data = null;
}
Expand Down
4 changes: 2 additions & 2 deletions src/MarkdownExtended/Util/ContentCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __construct(array $data = [])
*
* @throws \MarkdownExtended\Exception\UnexpectedValueException it the argument does not implement `\MarkdownExtended\API\ContentInterface`
*/
public function append($content)
public function append(mixed $content): void
{
if (!is_object($content) || !Kernel::valid($content, Kernel::TYPE_CONTENT)) {
throw new UnexpectedValueException(
Expand All @@ -61,7 +61,7 @@ public function append($content)
*
* @throws \MarkdownExtended\Exception\UnexpectedValueException it the argument does not implement `\MarkdownExtended\API\ContentInterface`
*/
public function offsetSet($index, $content)
public function offsetSet(mixed $index, mixed $content): void
{
if (!is_object($content) || !Kernel::valid($content, Kernel::TYPE_CONTENT)) {
throw new UnexpectedValueException(
Expand Down

0 comments on commit b487130

Please sign in to comment.