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);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function count()
|
||||
public function count(): int
|
||||
{
|
||||
return \count($this->decisionQueue);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function rewind()
|
||||
public function rewind(): void
|
||||
{
|
||||
end($this->decisionQueue);
|
||||
}
|
||||
|
@ -232,29 +224,17 @@ class Decisions implements \Iterator, \Countable
|
|||
return current($this->decisionQueue);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ?int
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function key()
|
||||
public function key(): ?int
|
||||
{
|
||||
return key($this->decisionQueue);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function next()
|
||||
public function next(): void
|
||||
{
|
||||
prev($this->decisionQueue);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function valid()
|
||||
public function valid(): bool
|
||||
{
|
||||
return false !== current($this->decisionQueue);
|
||||
}
|
||||
|
|
|
@ -129,10 +129,8 @@ class Pool implements \Countable
|
|||
|
||||
/**
|
||||
* Returns how many packages have been loaded into the pool
|
||||
* @return int
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function count()
|
||||
public function count(): int
|
||||
{
|
||||
return \count($this->packages);
|
||||
}
|
||||
|
|
|
@ -103,11 +103,7 @@ class RuleSet implements \IteratorAggregate, \Countable
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function count()
|
||||
public function count(): int
|
||||
{
|
||||
return $this->nextRuleId;
|
||||
}
|
||||
|
@ -127,11 +123,7 @@ class RuleSet implements \IteratorAggregate, \Countable
|
|||
return $this->rules;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return RuleSetIterator
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function getIterator()
|
||||
public function getIterator(): RuleSetIterator
|
||||
{
|
||||
return new RuleSetIterator($this->getRules());
|
||||
}
|
||||
|
|
|
@ -42,11 +42,7 @@ class RuleSetIterator implements \Iterator
|
|||
$this->rewind();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Rule
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function current()
|
||||
public function current(): Rule
|
||||
{
|
||||
return $this->rules[$this->currentType][$this->currentOffset];
|
||||
}
|
||||
|
@ -54,17 +50,12 @@ class RuleSetIterator implements \Iterator
|
|||
/**
|
||||
* @return RuleSet::TYPE_*|-1
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function key()
|
||||
public function key(): int
|
||||
{
|
||||
return $this->currentType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function next()
|
||||
public function next(): void
|
||||
{
|
||||
$this->currentOffset++;
|
||||
|
||||
|
@ -88,11 +79,7 @@ class RuleSetIterator implements \Iterator
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function rewind()
|
||||
public function rewind(): void
|
||||
{
|
||||
$this->currentOffset = 0;
|
||||
|
||||
|
@ -111,11 +98,7 @@ class RuleSetIterator implements \Iterator
|
|||
} while (isset($this->types[$this->currentTypeOffset]) && !\count($this->rules[$this->currentType]));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function valid()
|
||||
public function valid(): bool
|
||||
{
|
||||
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.
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function accept()
|
||||
public function accept(): bool
|
||||
{
|
||||
$file = $this->getInnerIterator()->current();
|
||||
if ($file->isDir()) {
|
||||
|
|
|
@ -90,8 +90,7 @@ class ArchivableFilesFinder extends \FilterIterator
|
|||
parent::__construct($this->finder->getIterator());
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function accept()
|
||||
public function accept(): bool
|
||||
{
|
||||
/** @var SplFileInfo $current */
|
||||
$current = $this->getInnerIterator()->current();
|
||||
|
|
|
@ -322,8 +322,7 @@ class ArrayRepository implements RepositoryInterface
|
|||
*
|
||||
* @return int Number of packages
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function count()
|
||||
public function count(): int
|
||||
{
|
||||
if (null === $this->packages) {
|
||||
$this->initialize();
|
||||
|
|
|
@ -178,8 +178,7 @@ class CompositeRepository implements RepositoryInterface
|
|||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function count()
|
||||
public function count(): int
|
||||
{
|
||||
$total = 0;
|
||||
foreach ($this->repositories as $repository) {
|
||||
|
|
|
@ -181,8 +181,7 @@ class FilterRepository implements RepositoryInterface
|
|||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function count()
|
||||
public function count(): int
|
||||
{
|
||||
if ($this->repo->count() > 0) {
|
||||
return count($this->getPackages());
|
||||
|
|
|
@ -54,15 +54,6 @@ class ErrorHandler
|
|||
}
|
||||
|
||||
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>');
|
||||
if (self::$io->isVerbose()) {
|
||||
self::$io->writeError('<warning>Stack trace:</warning>');
|
||||
|
|
Loading…
Reference in New Issue