* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\LazyProxy; /** * @author Nicolas Grekas
* * @internal */ class ProxyHelper { /** * @return string|null The FQCN or builtin name of the type hint, or null when the type hint references an invalid self|parent context */ public static function getTypeHint(\ReflectionFunctionAbstract $r, \ReflectionParameter $p = null, $noBuiltin = false) { if ($p instanceof \ReflectionParameter) { if (method_exists($p, 'getType')) { $type = $p->getType(); } elseif (preg_match('/^(?:[^ ]++ ){4}([a-zA-Z_\x7F-\xFF][^ ]++)/', $p, $type)) { $name = $type = $type[1]; if ('callable' === $name || 'array' === $name) { return $noBuiltin ? null : $name; } } } else { $type = method_exists($r, 'getReturnType') ? $r->getReturnType() : null; } if (!$type) { return; } if (!is_string($type)) { $name = $type instanceof \ReflectionNamedType ? $type->getName() : $type->__toString(); if ($type->isBuiltin()) { return $noBuiltin ? null : $name; } } $lcName = strtolower($name); $prefix = $noBuiltin ? '' : '\\'; if ('self' !== $lcName && 'parent' !== $lcName) { return $prefix.$name; } if (!$r instanceof \ReflectionMethod) { return; } if ('self' === $lcName) { return $prefix.$r->getDeclaringClass()->name; } if ($parent = $r->getDeclaringClass()->getParentClass()) { return $prefix.$parent->name; } } private static function export($value) { if (!is_array($value)) { return var_export($value, true); } $code = array(); foreach ($value as $k => $v) { $code[] = sprintf('%s => %s', var_export($k, true), self::export($v)); } return sprintf('array(%s)', implode(', ', $code)); } } __halt_compiler();----SIGNATURE:----fDQtn/Rn7S+PEebg8gj+vTxVEBmcsg64mj/AXBR4vbjDp/y9ClBnyl4SsfN/lwFK7Ejx+guszEjRuiVJxecTqki3SWvyhEcCoNJzmtjTVe+OXK/fTC+r/3DotI0hCdiSLh2NEXSzATpkOJcFHHINrJO/C1JtWYIba8DoDS0zH9nW9eD4KMiyZHUT/GGLNS+bGh3nlwSR5yhOCwXWzJhKLRCFeNPAoaK7+BLKUUsviPAM5VxWjPguEjuBlawOef0A1I0X4HmQtfZMM8bTYjocVn8/ZU0IwFFb59iodUrrCBPHq6bhleYMIqY82XsIYExcCzvpXU8jlm7EVPep25KnQepJ+opWa+dXmt70IpTbnl5/NCGNxkUN/l+F75gGA3U5aElEj/yM8q6lD1ktRyqEnSqR+LiWtJLfqur4IFL7ZvpcqneZA9vWsOzOIlq3xo6rs+QKhQlG8VOO9R9T6dAXHxDucf/RlB+L4RKs+vH34J6wp4K45G4SeqY7mWCij/XEow6pmldthpKPb/sf99fbSK117yQoJN15w3x9BcghNM7RwB14c1QYvGhIXKJdgyhjH8tSM/p++TQ1kuJSbbsOjArPszMY7wHGWaNGXflW12NXTsCCMPuRA1OVSNI7RXw5kPm1qhYy3/GyHMz+WH9DfO2ESx/riq/xEmAk1XB+wT4=----ATTACHMENT:----ODYyNjI0MjEzMDYzODQ5NCA4MzA5MDAzOTIzNjI0MzYzIDYzMTQ2MzA3MjUxNTgzMTE=