Skip to content

Commit

Permalink
Revert "address stan issue on php 8.2"
Browse files Browse the repository at this point in the history
This reverts commit 1fc2c88.
  • Loading branch information
imorland committed Oct 11, 2023
1 parent 1fc2c88 commit 7935073
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions framework/core/src/Extend/Conditional.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,12 @@ public function extend(Container $container, Extension $extension = null)
if ($condition['condition']) {
$extenders = $condition['extenders'];

if (is_string($extenders) && class_exists($extenders) && method_exists($extenders, '__invoke')) {
$result = $container->call($extenders);
$extenders = is_array($result) ? $result : [$result];
if (is_string($extenders)) {

Check failure on line 85 in framework/core/src/Extend/Conditional.php

View workflow job for this annotation

GitHub Actions / run / PHPStan PHP 7.3

Call to function is_string() with array<Flarum\Extend\ExtenderInterface> will always evaluate to false.

Check failure on line 85 in framework/core/src/Extend/Conditional.php

View workflow job for this annotation

GitHub Actions / run / PHPStan PHP 8.0

Call to function is_string() with array<Flarum\Extend\ExtenderInterface> will always evaluate to false.

Check failure on line 85 in framework/core/src/Extend/Conditional.php

View workflow job for this annotation

GitHub Actions / run / PHPStan PHP 8.1

Call to function is_string() with array<Flarum\Extend\ExtenderInterface> will always evaluate to false.

Check failure on line 85 in framework/core/src/Extend/Conditional.php

View workflow job for this annotation

GitHub Actions / run / PHPStan PHP 8.2

Call to function is_string() with array<Flarum\Extend\ExtenderInterface> will always evaluate to false.
$extenders = $container->call($extenders);
} elseif (is_callable($extenders)) {

Check failure on line 87 in framework/core/src/Extend/Conditional.php

View workflow job for this annotation

GitHub Actions / run / PHPStan PHP 7.3

Call to function is_callable() with array<Flarum\Extend\ExtenderInterface> will always evaluate to false.

Check failure on line 87 in framework/core/src/Extend/Conditional.php

View workflow job for this annotation

GitHub Actions / run / PHPStan PHP 8.0

Call to function is_callable() with array<Flarum\Extend\ExtenderInterface> will always evaluate to false.

Check failure on line 87 in framework/core/src/Extend/Conditional.php

View workflow job for this annotation

GitHub Actions / run / PHPStan PHP 8.1

Call to function is_callable() with array<Flarum\Extend\ExtenderInterface> will always evaluate to false.

Check failure on line 87 in framework/core/src/Extend/Conditional.php

View workflow job for this annotation

GitHub Actions / run / PHPStan PHP 8.2

Call to function is_callable() with array<Flarum\Extend\ExtenderInterface> will always evaluate to false.
$extenders = $container->call($extenders);
}

assert(is_array($extenders), 'Extenders should be an array after resolution.');

foreach ($extenders as $extender) {
$extender->extend($container, $extension);
}
Expand Down

0 comments on commit 7935073

Please sign in to comment.