diff --git a/src/Composer/DependencyResolver/Decisions.php b/src/Composer/DependencyResolver/Decisions.php
index 8dfd8d86d..6a4809d5d 100644
--- a/src/Composer/DependencyResolver/Decisions.php
+++ b/src/Composer/DependencyResolver/Decisions.php
@@ -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);
}
diff --git a/src/Composer/DependencyResolver/Pool.php b/src/Composer/DependencyResolver/Pool.php
index 857f62df8..0fa5783e4 100644
--- a/src/Composer/DependencyResolver/Pool.php
+++ b/src/Composer/DependencyResolver/Pool.php
@@ -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);
}
diff --git a/src/Composer/DependencyResolver/RuleSet.php b/src/Composer/DependencyResolver/RuleSet.php
index b754046a6..47868178f 100644
--- a/src/Composer/DependencyResolver/RuleSet.php
+++ b/src/Composer/DependencyResolver/RuleSet.php
@@ -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());
}
diff --git a/src/Composer/DependencyResolver/RuleSetIterator.php b/src/Composer/DependencyResolver/RuleSetIterator.php
index 1450c1cba..e7afb55d3 100644
--- a/src/Composer/DependencyResolver/RuleSetIterator.php
+++ b/src/Composer/DependencyResolver/RuleSetIterator.php
@@ -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]);
}
diff --git a/src/Composer/Package/Archiver/ArchivableFilesFilter.php b/src/Composer/Package/Archiver/ArchivableFilesFilter.php
index 6f25923d7..3242df7e8 100644
--- a/src/Composer/Package/Archiver/ArchivableFilesFilter.php
+++ b/src/Composer/Package/Archiver/ArchivableFilesFilter.php
@@ -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()) {
diff --git a/src/Composer/Package/Archiver/ArchivableFilesFinder.php b/src/Composer/Package/Archiver/ArchivableFilesFinder.php
index 4dcb718ba..b1d5650ed 100644
--- a/src/Composer/Package/Archiver/ArchivableFilesFinder.php
+++ b/src/Composer/Package/Archiver/ArchivableFilesFinder.php
@@ -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();
diff --git a/src/Composer/Repository/ArrayRepository.php b/src/Composer/Repository/ArrayRepository.php
index 3d4e15abd..03e5fd819 100644
--- a/src/Composer/Repository/ArrayRepository.php
+++ b/src/Composer/Repository/ArrayRepository.php
@@ -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();
diff --git a/src/Composer/Repository/CompositeRepository.php b/src/Composer/Repository/CompositeRepository.php
index d6cfc46e7..83603081c 100644
--- a/src/Composer/Repository/CompositeRepository.php
+++ b/src/Composer/Repository/CompositeRepository.php
@@ -178,8 +178,7 @@ class CompositeRepository implements RepositoryInterface
/**
* @inheritDoc
*/
- #[\ReturnTypeWillChange]
- public function count()
+ public function count(): int
{
$total = 0;
foreach ($this->repositories as $repository) {
diff --git a/src/Composer/Repository/FilterRepository.php b/src/Composer/Repository/FilterRepository.php
index 0ee1ae53d..6e27cf837 100644
--- a/src/Composer/Repository/FilterRepository.php
+++ b/src/Composer/Repository/FilterRepository.php
@@ -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());
diff --git a/src/Composer/Util/ErrorHandler.php b/src/Composer/Util/ErrorHandler.php
index 1bb7d4301..4a7901b41 100644
--- a/src/Composer/Util/ErrorHandler.php
+++ b/src/Composer/Util/ErrorHandler.php
@@ -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('Deprecation Notice: '.$message.' in '.$file.':'.$line.'');
if (self::$io->isVerbose()) {
self::$io->writeError('Stack trace:');