REDROOM
PHP 8.3.31
Path:
Logout
Edit File
Size: 2.20 KB
Close
/home/getspomw/royalsquad.us/vendor/laravel/framework/src/Illuminate/Conditionable/Traits/Conditionable.php
Text
Base64
<?php namespace Illuminate\Support\Traits; use Closure; use Illuminate\Support\HigherOrderWhenProxy; trait Conditionable { /** * Apply the callback if the given "value" is (or resolves to) truthy. * * @template TWhenParameter * @template TWhenReturnType * * @param (\Closure($this): TWhenParameter)|TWhenParameter|null $value * @param (callable($this, TWhenParameter): TWhenReturnType)|null $callback * @param (callable($this, TWhenParameter): TWhenReturnType)|null $default * @return $this|TWhenReturnType */ public function when($value = null, ?callable $callback = null, ?callable $default = null) { $value = $value instanceof Closure ? $value($this) : $value; if (func_num_args() === 0) { return new HigherOrderWhenProxy($this); } if (func_num_args() === 1) { return (new HigherOrderWhenProxy($this))->condition($value); } if ($value) { return $callback($this, $value) ?? $this; } elseif ($default) { return $default($this, $value) ?? $this; } return $this; } /** * Apply the callback if the given "value" is (or resolves to) falsy. * * @template TUnlessParameter * @template TUnlessReturnType * * @param (\Closure($this): TUnlessParameter)|TUnlessParameter|null $value * @param (callable($this, TUnlessParameter): TUnlessReturnType)|null $callback * @param (callable($this, TUnlessParameter): TUnlessReturnType)|null $default * @return $this|TUnlessReturnType */ public function unless($value = null, ?callable $callback = null, ?callable $default = null) { $value = $value instanceof Closure ? $value($this) : $value; if (func_num_args() === 0) { return (new HigherOrderWhenProxy($this))->negateConditionOnCapture(); } if (func_num_args() === 1) { return (new HigherOrderWhenProxy($this))->condition(! $value); } if (! $value) { return $callback($this, $value) ?? $this; } elseif ($default) { return $default($this, $value) ?? $this; } return $this; } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 1
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
Conditionable.php
2.20 KB
lrw-rw-rw-
2025-09-17 06:52:58
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).