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
/
TypeCheckSimple.php
/
/
<?php /** @noinspection ClassReImplementsParentInterfaceInspection */ declare(strict_types=1); namespace Arrayy\TypeCheck; class TypeCheckSimple extends AbstractTypeCheck implements TypeCheckInterface { /** * @param string|string[] $type * @param bool $isNullable */ public function __construct($type, bool $isNullable = false) { $this->getTypesHelper($type); $this->isNullable = $isNullable; } /** * @param string $expectedTypes * @param mixed $value * @param string $type * * @return \TypeError */ public function throwException($expectedTypes, $value, $type): \Throwable { throw new \TypeError("Invalid type: expected to be of type {{$expectedTypes}}, instead got value `" . \print_r($value, true) . "` with type {{$type}}."); } /** * @param string|string[] $type * * @return void */ protected function getTypesHelper($type) { if (\is_array($type)) { foreach ($type as $typeTmp) { $this->getTypesHelper($typeTmp); } return; } if (\strpos($type, '|') !== false) { $typesTmp = \explode('|', $type); foreach ($typesTmp as $typeTmp) { $this->types[] = $typeTmp; } } else { $this->types[] = $type; } } }
/srv/users/craft4/apps/craft4-newsite-space/vendor/voku/arrayy/src/TypeCheck/TypeCheckSimple.php