HigherOrderWhenProxy.php000064400000002211147536115510011347 0ustar00target = $target; $this->condition = $condition; } /** * Proxy accessing an attribute onto the target. * * @param string $key * @return mixed */ public function __get($key) { return $this->condition ? $this->target->{$key} : $this->target; } /** * Proxy a method call on the target. * * @param string $method * @param array $parameters * @return mixed */ public function __call($method, $parameters) { return $this->condition ? $this->target->{$method}(...$parameters) : $this->target; } } LICENSE.md000064400000002063147536115510006161 0ustar00The MIT License (MIT) Copyright (c) Taylor Otwell Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Traits/Conditionable.php000064400000003664147536115510011316 0ustar00