We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
apply
1 parent 136afa8 commit 5f9f3d0Copy full SHA for 5f9f3d0
src/Cookie/CookieBuilder.php
@@ -54,10 +54,17 @@ public function __construct(
54
}
55
56
/**
57
- * Apply the Cookie to a callable matching the signature of PHP 7.4+
+ * Apply the Cookie to `setcookie` a callable matching the signature of PHP 7.4+
58
* `setcookie(string $name, string $value = "", array $options = []) : bool`
59
+ *
60
+ * @param callable|null $callee The `setcookie` compatible callback to be used.
61
+ * If set to null, the default setcookie()
62
*/
- public function apply( callable $callee = "\\setcookie" ) : bool {
63
+ public function apply( ?callable $callee = null ) : bool {
64
+ if( $callee === null ) {
65
+ $callee = '\\setcookie';
66
+ }
67
+
68
return $callee(
69
$this->name,
70
$this->value,
0 commit comments