composer update
This commit is contained in:
parent
f6abc3dce2
commit
71dfaca858
1753 changed files with 45274 additions and 14619 deletions
39
vendor/symfony/var-dumper/Caster/ClassStub.php
vendored
39
vendor/symfony/var-dumper/Caster/ClassStub.php
vendored
|
|
@ -11,6 +11,8 @@
|
|||
|
||||
namespace Symfony\Component\VarDumper\Caster;
|
||||
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
|
||||
/**
|
||||
* Represents a PHP class identifier.
|
||||
*
|
||||
|
|
@ -19,19 +21,13 @@ namespace Symfony\Component\VarDumper\Caster;
|
|||
class ClassStub extends ConstStub
|
||||
{
|
||||
/**
|
||||
* @param string A PHP identifier, e.g. a class, method, interface, etc. name
|
||||
* @param callable The callable targeted by the identifier when it is ambiguous or not a real PHP identifier
|
||||
* @param string $identifier A PHP identifier, e.g. a class, method, interface, etc. name
|
||||
* @param callable $callable The callable targeted by the identifier when it is ambiguous or not a real PHP identifier
|
||||
*/
|
||||
public function __construct(string $identifier, $callable = null)
|
||||
{
|
||||
$this->value = $identifier;
|
||||
|
||||
if (0 < $i = strrpos($identifier, '\\')) {
|
||||
$this->attr['ellipsis'] = \strlen($identifier) - $i;
|
||||
$this->attr['ellipsis-type'] = 'class';
|
||||
$this->attr['ellipsis-tail'] = 1;
|
||||
}
|
||||
|
||||
try {
|
||||
if (null !== $callable) {
|
||||
if ($callable instanceof \Closure) {
|
||||
|
|
@ -58,8 +54,31 @@ class ClassStub extends ConstStub
|
|||
$r = new \ReflectionClass($r[0]);
|
||||
}
|
||||
}
|
||||
|
||||
if (false !== strpos($identifier, "class@anonymous\0")) {
|
||||
$this->value = $identifier = preg_replace_callback('/class@anonymous\x00.*?\.php0x?[0-9a-fA-F]++/', function ($m) {
|
||||
return \class_exists($m[0], false) ? get_parent_class($m[0]).'@anonymous' : $m[0];
|
||||
}, $identifier);
|
||||
}
|
||||
|
||||
if (null !== $callable && $r instanceof \ReflectionFunctionAbstract) {
|
||||
$s = ReflectionCaster::castFunctionAbstract($r, array(), new Stub(), true);
|
||||
$s = ReflectionCaster::getSignature($s);
|
||||
|
||||
if ('()' === substr($identifier, -2)) {
|
||||
$this->value = substr_replace($identifier, $s, -2);
|
||||
} else {
|
||||
$this->value .= $s;
|
||||
}
|
||||
}
|
||||
} catch (\ReflectionException $e) {
|
||||
return;
|
||||
} finally {
|
||||
if (0 < $i = strrpos($this->value, '\\')) {
|
||||
$this->attr['ellipsis'] = \strlen($this->value) - $i;
|
||||
$this->attr['ellipsis-type'] = 'class';
|
||||
$this->attr['ellipsis-tail'] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ($f = $r->getFileName()) {
|
||||
|
|
@ -75,9 +94,9 @@ class ClassStub extends ConstStub
|
|||
}
|
||||
|
||||
if (!\is_array($callable)) {
|
||||
$callable = new static($callable);
|
||||
$callable = new static($callable, $callable);
|
||||
} elseif (\is_string($callable[0])) {
|
||||
$callable[0] = new static($callable[0]);
|
||||
$callable[0] = new static($callable[0], $callable);
|
||||
} else {
|
||||
$callable[1] = new static($callable[1], $callable);
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue