Get rid of RetutnTypeWillChange where possible, fixes #10014
parent
0b3adc84da
commit
7e27a25070
|
@ -205,20 +205,12 @@ class Decisions implements \Iterator, \Countable
|
||||||
array_pop($this->decisionQueue);
|
array_pop($this->decisionQueue);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function count(): int
|
||||||
* @return int
|
|
||||||
*/
|
|
||||||
#[\ReturnTypeWillChange]
|
|
||||||
public function count()
|
|
||||||
{
|
{
|
||||||
return \count($this->decisionQueue);
|
return \count($this->decisionQueue);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function rewind(): void
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
#[\ReturnTypeWillChange]
|
|
||||||
public function rewind()
|
|
||||||
{
|
{
|
||||||
end($this->decisionQueue);
|
end($this->decisionQueue);
|
||||||
}
|
}
|
||||||
|
@ -232,29 +224,17 @@ class Decisions implements \Iterator, \Countable
|
||||||
return current($this->decisionQueue);
|
return current($this->decisionQueue);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function key(): ?int
|
||||||
* @return ?int
|
|
||||||
*/
|
|
||||||
#[\ReturnTypeWillChange]
|
|
||||||
public function key()
|
|
||||||
{
|
{
|
||||||
return key($this->decisionQueue);
|
return key($this->decisionQueue);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function next(): void
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
#[\ReturnTypeWillChange]
|
|
||||||
public function next()
|
|
||||||
{
|
{
|
||||||
prev($this->decisionQueue);
|
prev($this->decisionQueue);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function valid(): bool
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
#[\ReturnTypeWillChange]
|
|
||||||
public function valid()
|
|
||||||
{
|
{
|
||||||
return false !== current($this->decisionQueue);
|
return false !== current($this->decisionQueue);
|
||||||
}
|
}
|
||||||
|
|
|
@ -129,10 +129,8 @@ class Pool implements \Countable
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns how many packages have been loaded into the pool
|
* Returns how many packages have been loaded into the pool
|
||||||
* @return int
|
|
||||||
*/
|
*/
|
||||||
#[\ReturnTypeWillChange]
|
public function count(): int
|
||||||
public function count()
|
|
||||||
{
|
{
|
||||||
return \count($this->packages);
|
return \count($this->packages);
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,11 +103,7 @@ class RuleSet implements \IteratorAggregate, \Countable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function count(): int
|
||||||
* @return int
|
|
||||||
*/
|
|
||||||
#[\ReturnTypeWillChange]
|
|
||||||
public function count()
|
|
||||||
{
|
{
|
||||||
return $this->nextRuleId;
|
return $this->nextRuleId;
|
||||||
}
|
}
|
||||||
|
@ -127,11 +123,7 @@ class RuleSet implements \IteratorAggregate, \Countable
|
||||||
return $this->rules;
|
return $this->rules;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function getIterator(): RuleSetIterator
|
||||||
* @return RuleSetIterator
|
|
||||||
*/
|
|
||||||
#[\ReturnTypeWillChange]
|
|
||||||
public function getIterator()
|
|
||||||
{
|
{
|
||||||
return new RuleSetIterator($this->getRules());
|
return new RuleSetIterator($this->getRules());
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,11 +42,7 @@ class RuleSetIterator implements \Iterator
|
||||||
$this->rewind();
|
$this->rewind();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function current(): Rule
|
||||||
* @return Rule
|
|
||||||
*/
|
|
||||||
#[\ReturnTypeWillChange]
|
|
||||||
public function current()
|
|
||||||
{
|
{
|
||||||
return $this->rules[$this->currentType][$this->currentOffset];
|
return $this->rules[$this->currentType][$this->currentOffset];
|
||||||
}
|
}
|
||||||
|
@ -54,17 +50,12 @@ class RuleSetIterator implements \Iterator
|
||||||
/**
|
/**
|
||||||
* @return RuleSet::TYPE_*|-1
|
* @return RuleSet::TYPE_*|-1
|
||||||
*/
|
*/
|
||||||
#[\ReturnTypeWillChange]
|
public function key(): int
|
||||||
public function key()
|
|
||||||
{
|
{
|
||||||
return $this->currentType;
|
return $this->currentType;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function next(): void
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
#[\ReturnTypeWillChange]
|
|
||||||
public function next()
|
|
||||||
{
|
{
|
||||||
$this->currentOffset++;
|
$this->currentOffset++;
|
||||||
|
|
||||||
|
@ -88,11 +79,7 @@ class RuleSetIterator implements \Iterator
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function rewind(): void
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
#[\ReturnTypeWillChange]
|
|
||||||
public function rewind()
|
|
||||||
{
|
{
|
||||||
$this->currentOffset = 0;
|
$this->currentOffset = 0;
|
||||||
|
|
||||||
|
@ -111,11 +98,7 @@ class RuleSetIterator implements \Iterator
|
||||||
} while (isset($this->types[$this->currentTypeOffset]) && !\count($this->rules[$this->currentType]));
|
} while (isset($this->types[$this->currentTypeOffset]) && !\count($this->rules[$this->currentType]));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function valid(): bool
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
#[\ReturnTypeWillChange]
|
|
||||||
public function valid()
|
|
||||||
{
|
{
|
||||||
return isset($this->rules[$this->currentType], $this->rules[$this->currentType][$this->currentOffset]);
|
return isset($this->rules[$this->currentType], $this->rules[$this->currentType][$this->currentOffset]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,8 +23,7 @@ class ArchivableFilesFilter extends FilterIterator
|
||||||
/**
|
/**
|
||||||
* @return bool true if the current element is acceptable, otherwise false.
|
* @return bool true if the current element is acceptable, otherwise false.
|
||||||
*/
|
*/
|
||||||
#[\ReturnTypeWillChange]
|
public function accept(): bool
|
||||||
public function accept()
|
|
||||||
{
|
{
|
||||||
$file = $this->getInnerIterator()->current();
|
$file = $this->getInnerIterator()->current();
|
||||||
if ($file->isDir()) {
|
if ($file->isDir()) {
|
||||||
|
|
|
@ -90,8 +90,7 @@ class ArchivableFilesFinder extends \FilterIterator
|
||||||
parent::__construct($this->finder->getIterator());
|
parent::__construct($this->finder->getIterator());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\ReturnTypeWillChange]
|
public function accept(): bool
|
||||||
public function accept()
|
|
||||||
{
|
{
|
||||||
/** @var SplFileInfo $current */
|
/** @var SplFileInfo $current */
|
||||||
$current = $this->getInnerIterator()->current();
|
$current = $this->getInnerIterator()->current();
|
||||||
|
|
|
@ -322,8 +322,7 @@ class ArrayRepository implements RepositoryInterface
|
||||||
*
|
*
|
||||||
* @return int Number of packages
|
* @return int Number of packages
|
||||||
*/
|
*/
|
||||||
#[\ReturnTypeWillChange]
|
public function count(): int
|
||||||
public function count()
|
|
||||||
{
|
{
|
||||||
if (null === $this->packages) {
|
if (null === $this->packages) {
|
||||||
$this->initialize();
|
$this->initialize();
|
||||||
|
|
|
@ -178,8 +178,7 @@ class CompositeRepository implements RepositoryInterface
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
#[\ReturnTypeWillChange]
|
public function count(): int
|
||||||
public function count()
|
|
||||||
{
|
{
|
||||||
$total = 0;
|
$total = 0;
|
||||||
foreach ($this->repositories as $repository) {
|
foreach ($this->repositories as $repository) {
|
||||||
|
|
|
@ -181,8 +181,7 @@ class FilterRepository implements RepositoryInterface
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
#[\ReturnTypeWillChange]
|
public function count(): int
|
||||||
public function count()
|
|
||||||
{
|
{
|
||||||
if ($this->repo->count() > 0) {
|
if ($this->repo->count() > 0) {
|
||||||
return count($this->getPackages());
|
return count($this->getPackages());
|
||||||
|
|
|
@ -54,15 +54,6 @@ class ErrorHandler
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self::$io) {
|
if (self::$io) {
|
||||||
// ignore symfony/* deprecation warnings
|
|
||||||
// TODO remove in 2.3
|
|
||||||
if (Preg::isMatch('{^Return type of Symfony\\\\.*ReturnTypeWillChange}is', $message)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (strpos(strtr($file, '\\', '/'), 'vendor/symfony/') !== false) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
self::$io->writeError('<warning>Deprecation Notice: '.$message.' in '.$file.':'.$line.'</warning>');
|
self::$io->writeError('<warning>Deprecation Notice: '.$message.' in '.$file.':'.$line.'</warning>');
|
||||||
if (self::$io->isVerbose()) {
|
if (self::$io->isVerbose()) {
|
||||||
self::$io->writeError('<warning>Stack trace:</warning>');
|
self::$io->writeError('<warning>Stack trace:</warning>');
|
||||||
|
|
Loading…
Reference in New Issue