Aggiornato Composer
This commit is contained in:
@@ -19,7 +19,7 @@ class Comparator
|
||||
private $target;
|
||||
private $operator = '==';
|
||||
|
||||
public function __construct(string $target = null, string $operator = '==')
|
||||
public function __construct(?string $target = null, string $operator = '==')
|
||||
{
|
||||
if (null === $target) {
|
||||
trigger_deprecation('symfony/finder', '5.4', 'Constructing a "%s" without setting "$target" is deprecated.', __CLASS__);
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace Symfony\Component\Finder\Comparator;
|
||||
class NumberComparator extends Comparator
|
||||
{
|
||||
/**
|
||||
* @param string|int $test A comparison string or an integer
|
||||
* @param string|null $test A comparison string or null
|
||||
*
|
||||
* @throws \InvalidArgumentException If the test is not understood
|
||||
*/
|
||||
|
||||
4
vendor/symfony/finder/Finder.php
vendored
4
vendor/symfony/finder/Finder.php
vendored
@@ -164,8 +164,8 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* You can use patterns (delimited with / sign), globs or simple strings.
|
||||
*
|
||||
* $finder->name('*.php')
|
||||
* $finder->name('/\.php$/') // same as above
|
||||
* $finder->name('/\.php$/')
|
||||
* $finder->name('*.php') // same as above, without dot files
|
||||
* $finder->name('test.php')
|
||||
* $finder->name(['test.py', 'test.php'])
|
||||
*
|
||||
|
||||
@@ -17,6 +17,7 @@ namespace Symfony\Component\Finder\Iterator;
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @extends \FilterIterator<string, \SplFileInfo>
|
||||
*
|
||||
* @implements \RecursiveIterator<string, \SplFileInfo>
|
||||
*/
|
||||
class ExcludeDirectoryFilterIterator extends \FilterIterator implements \RecursiveIterator
|
||||
|
||||
@@ -29,7 +29,7 @@ class RecursiveDirectoryIterator extends \RecursiveDirectoryIterator
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private $rewindable;
|
||||
private $ignoreFirstRewind = true;
|
||||
|
||||
// these 3 properties take part of the performance optimization to avoid redoing the same work in all iterations
|
||||
private $rootPath;
|
||||
@@ -118,7 +118,6 @@ class RecursiveDirectoryIterator extends \RecursiveDirectoryIterator
|
||||
$children->ignoreUnreadableDirs = $this->ignoreUnreadableDirs;
|
||||
|
||||
// performance optimization to avoid redoing the same work in all children
|
||||
$children->rewindable = &$this->rewindable;
|
||||
$children->rootPath = $this->rootPath;
|
||||
}
|
||||
|
||||
@@ -129,40 +128,30 @@ class RecursiveDirectoryIterator extends \RecursiveDirectoryIterator
|
||||
}
|
||||
|
||||
/**
|
||||
* Do nothing for non rewindable stream.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function next()
|
||||
{
|
||||
$this->ignoreFirstRewind = false;
|
||||
|
||||
parent::next();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function rewind()
|
||||
{
|
||||
if (false === $this->isRewindable()) {
|
||||
// some streams like FTP are not rewindable, ignore the first rewind after creation,
|
||||
// as newly created DirectoryIterator does not need to be rewound
|
||||
if ($this->ignoreFirstRewind) {
|
||||
$this->ignoreFirstRewind = false;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
parent::rewind();
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the stream is rewindable.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isRewindable()
|
||||
{
|
||||
if (null !== $this->rewindable) {
|
||||
return $this->rewindable;
|
||||
}
|
||||
|
||||
if (false !== $stream = @opendir($this->getPath())) {
|
||||
$infos = stream_get_meta_data($stream);
|
||||
closedir($stream);
|
||||
|
||||
if ($infos['seekable']) {
|
||||
return $this->rewindable = true;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->rewindable = false;
|
||||
}
|
||||
}
|
||||
|
||||
2
vendor/symfony/finder/LICENSE
vendored
2
vendor/symfony/finder/LICENSE
vendored
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2004-2022 Fabien Potencier
|
||||
Copyright (c) 2004-present Fabien Potencier
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
Reference in New Issue
Block a user