Skip to content

Commit

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

if (is_string($extenders)) {
$extenders = $container->call($extenders);
if (is_string($extenders) && class_exists($extenders) && method_exists($extenders, '__invoke')) {

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 7.3

Result of && is always false.

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

Result of && is always false.

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

View workflow job for this annotation

GitHub Actions / run / PHPStan PHP 7.4

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 7.4

Result of && is always false.

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

View workflow job for this annotation

GitHub Actions / run / PHPStan PHP 7.4

Result of && is always 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.1

Result of && is always 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

Result of && is always 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.

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

Result of && is always 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

Result of && is always false.
$result = $container->call($extenders);
$extenders = is_array($result) ? $result : [$result];
} elseif (is_callable($extenders)) {

Check failure on line 88 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 88 in framework/core/src/Extend/Conditional.php

View workflow job for this annotation

GitHub Actions / run / PHPStan PHP 7.4

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

Check failure on line 88 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 88 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 1fc2c88

Please sign in to comment.