* * 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:----aZ8dKMLAyyxJHiSdVetjzJ6Vc7c0SfmsWc50eo+vpySSYMw7Nj1F1+6mIXwgEP32BjzM3lEIbTVoJ1LMr9wE/pMdZnHE1Q4i37o4EQJRkiMHs8U6pvE0vxPQZuPhxsgkakzb8NUh+lLqYCVbEvH1+qEQXq3xMrXORywIRdB5sxn5E4tpSpySaBVi7GQ9o6KWjrRx5w0DAyQ9BQegKw8pRw7wUwlpfiEKTSSROMyvcaNYpG0cr5QXfTiHbFtvuxaqE3REBgtK6mxAIpmQgE/plnpl7Qj+TWd1q/RUCdqT09DTv+D19YIVmPSzSeljKiTB3H4YyI1wGSfTRoG1eJcoJuoAE32KVQ1U/0sbv4jxeCGmUQuX7f9SF6WcaFQz4SwDXrl9Wm4fngNkaWPDSKYT/gyXU1ZD6jYuyb+k7jcwDieFT0SLfniLet3ppDrW/cq5UM8okeGy07Qv8SwEkiIw8dwUnyzPJgF562/+58kSg9NXsHwYJrx7zxJAwzWSmpQzZEsybZbCYBsUzOfFOhqKGaCItsxykHKSu7I/DXJFBEhfialdslL/9Nd8ONJT60iyx/f2sHoRcR5TdKIQ2v04T/W5K2dnOgN32o0nYfziQBjy4yfJ64AfIc+GaXHtgXbnf2WBrXuwq0TVUT5erqk54Gt4moO6kGj45jk6JZtHtn8=----ATTACHMENT:----NTMxMTQ3MjU4NDE2NDUzMSA4NjIxNTU3NDExOTM0Mzk2IDM1NzA4NDgyODY1OTUxMDc=