uawdijnntqw1x1x1
IP : 216.73.216.107
Hostname : toronto-dev2
Kernel : Linux toronto-dev2 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
Disable Function : None :)
OS : Linux
PATH:
/
srv
/
users
/
craft4
/
apps
/
craft4-newsite-space
/
vendor
/
voku
/
arrayy
/
src
/
TypeCheck
/
TypeCheckCallback.php
/
/
<?php declare(strict_types=1); namespace Arrayy\TypeCheck; class TypeCheckCallback implements TypeCheckInterface { /** * @var callable * * @phpstan-var callable(mixed): bool */ protected $callable; /** * @var bool */ protected $isNullable = false; /** * @param callable $callable * @param bool $isNullable * * @phpstan-param callable(mixed): bool $callable */ public function __construct(callable $callable, bool $isNullable = false) { $this->callable = $callable; $this->isNullable = $isNullable; } /** * @param mixed $value * * @return bool */ public function checkType(&$value): bool { if ($this->isNullable && $value === null) { return true; } if (\call_user_func($this->callable, $value)) { return true; } $this->throwException('', $value, \gettype($value)); return false; } /** * @return array */ public function getTypes(): array { return []; } /** * @param string $expectedTypes * @param mixed $value * @param string $type * * @return \TypeError */ public function throwException($expectedTypes, $value, $type): \Throwable { throw new \TypeError('Invalid type: callable failed, got value `' . \print_r($value, true) . "` with type {{$type}}."); } }
/srv/users/craft4/apps/craft4-newsite-space/vendor/voku/arrayy/src/TypeCheck/TypeCheckCallback.php