Skip to content

Commit 03f14e1

Browse files
authored
Merge pull request #3 from bwaidelich/bugfix/2-fix-callable-schema-check-for-php8
BUGFIX: Fix OptionsSchema check for "callable" options for PHP 8+
2 parents a0c0007 + 3f738db commit 03f14e1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Classes/OptionsSchema.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function validate(array $options): void
101101
$expectedType = $optionSchema['type'] ?? 'string';
102102
$actualType = TypeHandling::getTypeForValue($options[$optionName]);
103103
if ($expectedType === 'callable') {
104-
if (!\is_callable($options[$optionName])) {
104+
if (!\is_callable($options[$optionName], true)) {
105105
throw new \InvalidArgumentException(sprintf('Option "%s" must be a callable in the format: "Some\ClassName::someMethodName" but it is: "%s" and that is not callable', $optionName, \is_string($options[$optionName]) ? $options[$optionName] : $actualType), 1563962182);
106106
}
107107
} elseif ($actualType !== $expectedType) {

0 commit comments

Comments
 (0)