You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* chore: create tests to highlight the conditional instantiation problem
* Apply fixes from StyleCI
* add callback and invokable class + tests
* Apply fixes from StyleCI
* address stan issue on php 8.2
* Revert "address stan issue on php 8.2"
This reverts commit 1fc2c88.
* attempt to make stan happy
* Revert "attempt to make stan happy"
This reverts commit 1cc327b.
* is it really that simple?
* Revert "is it really that simple?"
This reverts commit 2006755.
* let's try this
* Update framework/core/src/Extend/Conditional.php
Co-authored-by: Sami Mazouz <[email protected]>
---------
Co-authored-by: StyleCI Bot <[email protected]>
Co-authored-by: Sami Mazouz <[email protected]>
* Apply extenders only if a specific extension is enabled.
38
+
*
39
+
* @param string $extensionId The ID of the extension.
40
+
* @param ExtenderInterface[]|callable|string $extenders An array of extenders, a callable returning an array of extenders, or an invokable class string.
return$this->when(function (ExtensionManager$extensions) use ($extensionId) {
29
46
return$extensions->isEnabled($extensionId);
30
47
}, $extenders);
31
48
}
32
49
33
50
/**
34
-
* @param bool|callable $condition
35
-
* @param ExtenderInterface[] $extenders
51
+
* Apply extenders based on a condition.
52
+
*
53
+
* @param bool|callable $condition A boolean or callable that should return a boolean.
54
+
* If this evaluates to true, the extenders will be applied.
55
+
* @param ExtenderInterface[]|callable|string $extenders An array of extenders, a callable returning an array of extenders, or an invokable class string.
0 commit comments