updated-packages
This commit is contained in:
16
vendor/symfony/var-dumper/Caster/LinkStub.php
vendored
16
vendor/symfony/var-dumper/Caster/LinkStub.php
vendored
@@ -23,7 +23,7 @@ class LinkStub extends ConstStub
|
||||
private static $vendorRoots;
|
||||
private static $composerRoots;
|
||||
|
||||
public function __construct($label, int $line = 0, $href = null)
|
||||
public function __construct(string $label, int $line = 0, string $href = null)
|
||||
{
|
||||
$this->value = $label;
|
||||
|
||||
@@ -33,12 +33,12 @@ class LinkStub extends ConstStub
|
||||
if (!\is_string($href)) {
|
||||
return;
|
||||
}
|
||||
if (0 === strpos($href, 'file://')) {
|
||||
if (str_starts_with($href, 'file://')) {
|
||||
if ($href === $label) {
|
||||
$label = substr($label, 7);
|
||||
}
|
||||
$href = substr($href, 7);
|
||||
} elseif (false !== strpos($href, '://')) {
|
||||
} elseif (str_contains($href, '://')) {
|
||||
$this->attr['href'] = $href;
|
||||
|
||||
return;
|
||||
@@ -63,15 +63,15 @@ class LinkStub extends ConstStub
|
||||
}
|
||||
}
|
||||
|
||||
private function getComposerRoot($file, &$inVendor)
|
||||
private function getComposerRoot(string $file, bool &$inVendor)
|
||||
{
|
||||
if (null === self::$vendorRoots) {
|
||||
self::$vendorRoots = array();
|
||||
self::$vendorRoots = [];
|
||||
|
||||
foreach (get_declared_classes() as $class) {
|
||||
if ('C' === $class[0] && 0 === strpos($class, 'ComposerAutoloaderInit')) {
|
||||
if ('C' === $class[0] && str_starts_with($class, 'ComposerAutoloaderInit')) {
|
||||
$r = new \ReflectionClass($class);
|
||||
$v = \dirname(\dirname($r->getFileName()));
|
||||
$v = \dirname($r->getFileName(), 2);
|
||||
if (file_exists($v.'/composer/installed.json')) {
|
||||
self::$vendorRoots[] = $v.\DIRECTORY_SEPARATOR;
|
||||
}
|
||||
@@ -85,7 +85,7 @@ class LinkStub extends ConstStub
|
||||
}
|
||||
|
||||
foreach (self::$vendorRoots as $root) {
|
||||
if ($inVendor = 0 === strpos($file, $root)) {
|
||||
if ($inVendor = str_starts_with($file, $root)) {
|
||||
return $root;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user