diff --git a/src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php b/src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php index 6a33f0680a7a3..b9c9d51b713bc 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php @@ -205,7 +205,7 @@ private function createCollector($queries) class StringRepresentableClass { - public function __toString() + public function __toString(): string { return 'string representation'; } diff --git a/src/Symfony/Bridge/Doctrine/Tests/Fixtures/CompositeIntIdEntity.php b/src/Symfony/Bridge/Doctrine/Tests/Fixtures/CompositeIntIdEntity.php index 8a9b00ddc73e7..7c64cc20ad7e1 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Fixtures/CompositeIntIdEntity.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Fixtures/CompositeIntIdEntity.php @@ -34,7 +34,7 @@ public function __construct($id1, $id2, $name) $this->name = $name; } - public function __toString() + public function __toString(): string { return $this->name; } diff --git a/src/Symfony/Bridge/Doctrine/Tests/Fixtures/CompositeStringIdEntity.php b/src/Symfony/Bridge/Doctrine/Tests/Fixtures/CompositeStringIdEntity.php index 0755a89e6a923..d6e8d2cd2aafa 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Fixtures/CompositeStringIdEntity.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Fixtures/CompositeStringIdEntity.php @@ -34,7 +34,7 @@ public function __construct($id1, $id2, $name) $this->name = $name; } - public function __toString() + public function __toString(): string { return $this->name; } diff --git a/src/Symfony/Bridge/Doctrine/Tests/Fixtures/Person.php b/src/Symfony/Bridge/Doctrine/Tests/Fixtures/Person.php index 6e383394bee47..b90a54ac02c61 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Fixtures/Person.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Fixtures/Person.php @@ -38,7 +38,7 @@ public function __construct($id, $name) $this->name = $name; } - public function __toString() + public function __toString(): string { return (string) $this->name; } diff --git a/src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleAssociationToIntIdEntity.php b/src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleAssociationToIntIdEntity.php index 5cd6d407962aa..bed8bb9a51d01 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleAssociationToIntIdEntity.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleAssociationToIntIdEntity.php @@ -31,7 +31,7 @@ public function __construct(SingleIntIdNoToStringEntity $entity, $name) $this->name = $name; } - public function __toString() + public function __toString(): string { return (string) $this->name; } diff --git a/src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleIntIdEntity.php b/src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleIntIdEntity.php index ff29145e3353f..612566b45d94b 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleIntIdEntity.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleIntIdEntity.php @@ -33,7 +33,7 @@ public function __construct($id, $name) $this->name = $name; } - public function __toString() + public function __toString(): string { return (string) $this->name; } diff --git a/src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleStringCastableIdEntity.php b/src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleStringCastableIdEntity.php index e457f69dd091b..128801a02c922 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleStringCastableIdEntity.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleStringCastableIdEntity.php @@ -35,7 +35,7 @@ public function __construct($id, $name) $this->name = $name; } - public function __toString() + public function __toString(): string { return (string) $this->name; } @@ -50,7 +50,7 @@ public function __construct($id) $this->id = $id; } - public function __toString() + public function __toString(): string { return (string) $this->id; } diff --git a/src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleStringIdEntity.php b/src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleStringIdEntity.php index 3e25e2aea52bd..83f7a9f9ab39d 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleStringIdEntity.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Fixtures/SingleStringIdEntity.php @@ -30,7 +30,7 @@ public function __construct($id, $name) $this->name = $name; } - public function __toString() + public function __toString(): string { return $this->name; } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AppKernel.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AppKernel.php index 0ea364b196940..0d329582b39ef 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AppKernel.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AppKernel.php @@ -79,7 +79,7 @@ protected function build(ContainerBuilder $container) $container->register('logger', NullLogger::class); } - public function __sleep() + public function __sleep(): array { return ['varDir', 'testCase', 'rootConfig', 'environment', 'debug']; } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Kernel/ConcreteMicroKernel.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Kernel/ConcreteMicroKernel.php index 7e6bb3481064c..954eef5948eed 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Kernel/ConcreteMicroKernel.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Kernel/ConcreteMicroKernel.php @@ -64,7 +64,7 @@ public function getLogDir(): string return $this->cacheDir; } - public function __sleep() + public function __sleep(): array { throw new \BadMethodCallException('Cannot serialize '.__CLASS__); } diff --git a/src/Symfony/Bundle/TwigBundle/TemplateIterator.php b/src/Symfony/Bundle/TwigBundle/TemplateIterator.php index b96a18318bf48..2f33a9ed310fb 100644 --- a/src/Symfony/Bundle/TwigBundle/TemplateIterator.php +++ b/src/Symfony/Bundle/TwigBundle/TemplateIterator.php @@ -43,7 +43,7 @@ public function __construct(KernelInterface $kernel, string $rootDir, array $pat } /** - * {@inheritdoc} + * @return \Traversable */ public function getIterator() { diff --git a/src/Symfony/Component/Config/Resource/GlobResource.php b/src/Symfony/Component/Config/Resource/GlobResource.php index e33cafc6e0266..ad7531dcd5c70 100644 --- a/src/Symfony/Component/Config/Resource/GlobResource.php +++ b/src/Symfony/Component/Config/Resource/GlobResource.php @@ -91,6 +91,9 @@ public function __sleep(): array return ['prefix', 'pattern', 'recursive', 'hash', 'forExclusion', 'excludedPrefixes']; } + /** + * @return \Traversable + */ public function getIterator() { if (!file_exists($this->prefix) || (!$this->recursive && '' === $this->pattern)) { diff --git a/src/Symfony/Component/Console/Helper/TableRows.php b/src/Symfony/Component/Console/Helper/TableRows.php index 4809daf1cac80..16aabb3fc9350 100644 --- a/src/Symfony/Component/Console/Helper/TableRows.php +++ b/src/Symfony/Component/Console/Helper/TableRows.php @@ -23,7 +23,7 @@ public function __construct(callable $generator) $this->generator = $generator; } - public function getIterator() + public function getIterator(): \Traversable { $g = $this->generator; diff --git a/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php b/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php index 440088822bdb5..1bd2b5d57bdf2 100644 --- a/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php +++ b/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php @@ -339,7 +339,7 @@ public function testFormatAndWrap() class TableCell { - public function __toString() + public function __toString(): string { return 'some info'; } diff --git a/src/Symfony/Component/Console/Tests/Helper/QuestionHelperTest.php b/src/Symfony/Component/Console/Tests/Helper/QuestionHelperTest.php index f9122a74c8536..83d01f6818517 100644 --- a/src/Symfony/Component/Console/Tests/Helper/QuestionHelperTest.php +++ b/src/Symfony/Component/Console/Tests/Helper/QuestionHelperTest.php @@ -835,7 +835,7 @@ public function __construct(array $values) $this->values = $values; } - public function getIterator() + public function getIterator(): \Traversable { return new \ArrayIterator($this->values); } diff --git a/src/Symfony/Component/Console/Tests/Logger/ConsoleLoggerTest.php b/src/Symfony/Component/Console/Tests/Logger/ConsoleLoggerTest.php index ef115767efccb..0f5884136b021 100644 --- a/src/Symfony/Component/Console/Tests/Logger/ConsoleLoggerTest.php +++ b/src/Symfony/Component/Console/Tests/Logger/ConsoleLoggerTest.php @@ -204,7 +204,7 @@ public function testContextExceptionKeyCanBeExceptionOrOtherValues() class DummyTest { - public function __toString() + public function __toString(): string { } } diff --git a/src/Symfony/Component/DependencyInjection/Argument/RewindableGenerator.php b/src/Symfony/Component/DependencyInjection/Argument/RewindableGenerator.php index b00a36c34f542..41fec786fd739 100644 --- a/src/Symfony/Component/DependencyInjection/Argument/RewindableGenerator.php +++ b/src/Symfony/Component/DependencyInjection/Argument/RewindableGenerator.php @@ -28,14 +28,14 @@ public function __construct(callable $generator, $count) $this->count = $count; } - public function getIterator() + public function getIterator(): \Traversable { $g = $this->generator; return $g(); } - public function count() + public function count(): int { if (\is_callable($count = $this->count)) { $this->count = $count(); diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectExtension.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectExtension.php index 81ea2b18bb4fc..4dee6add01911 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectExtension.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectExtension.php @@ -25,17 +25,17 @@ public function load(array $configs, ContainerBuilder $configuration) return $configuration; } - public function getXsdValidationBasePath() + public function getXsdValidationBasePath(): string { return false; } - public function getNamespace() + public function getNamespace(): string { return 'http://www.example.com/schema/project'; } - public function getAlias() + public function getAlias(): string { return 'project'; } diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectWithXsdExtension.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectWithXsdExtension.php index 2ee2f12dc8f58..f457abd2a379d 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectWithXsdExtension.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectWithXsdExtension.php @@ -2,17 +2,17 @@ class ProjectWithXsdExtension extends ProjectExtension { - public function getXsdValidationBasePath() + public function getXsdValidationBasePath(): string { return __DIR__.'/schema'; } - public function getNamespace() + public function getNamespace(): string { return 'http://www.example.com/schema/projectwithxsd'; } - public function getAlias() + public function getAlias(): string { return 'projectwithxsd'; } diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectWithXsdExtensionInPhar.phar b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectWithXsdExtensionInPhar.phar index 040e136a34252..93d4e87c0b89b 100644 Binary files a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectWithXsdExtensionInPhar.phar and b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectWithXsdExtensionInPhar.phar differ diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/classes.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/classes.php index 29913a8556093..f3a490691a41d 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/classes.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/classes.php @@ -83,17 +83,17 @@ public function callPassed() class DummyProxyDumper implements ProxyDumper { - public function isProxyCandidate(Definition $definition) + public function isProxyCandidate(Definition $definition): bool { return $definition->isLazy(); } - public function getProxyFactoryCode(Definition $definition, $id, $factoryCall = null) + public function getProxyFactoryCode(Definition $definition, $id, $factoryCall = null): string { return " // lazy factory for {$definition->getClass()}\n\n"; } - public function getProxyCode(Definition $definition) + public function getProxyCode(Definition $definition): string { return "// proxy code for {$definition->getClass()}\n"; } diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/createphar.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/createphar.php index c675478fd639c..3ad4a8cf0e04e 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/createphar.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/createphar.php @@ -11,17 +11,17 @@ class ProjectWithXsdExtensionInPhar extends ProjectExtension { - public function getXsdValidationBasePath() + public function getXsdValidationBasePath(): string { return __DIR__.'/schema'; } - public function getNamespace() + public function getNamespace(): string { return 'http://www.example.com/schema/projectwithxsdinphar'; } - public function getAlias() + public function getAlias(): string { return 'projectwithxsdinphar'; } diff --git a/src/Symfony/Component/Finder/Iterator/ExcludeDirectoryFilterIterator.php b/src/Symfony/Component/Finder/Iterator/ExcludeDirectoryFilterIterator.php index eb37f1310e428..6a1b291adea30 100644 --- a/src/Symfony/Component/Finder/Iterator/ExcludeDirectoryFilterIterator.php +++ b/src/Symfony/Component/Finder/Iterator/ExcludeDirectoryFilterIterator.php @@ -68,6 +68,9 @@ public function accept() return true; } + /** + * @return bool + */ public function hasChildren() { return $this->isRecursive && $this->iterator->hasChildren(); diff --git a/src/Symfony/Component/Finder/Iterator/SortableIterator.php b/src/Symfony/Component/Finder/Iterator/SortableIterator.php index eda093fa2ce22..cc955a7108b36 100644 --- a/src/Symfony/Component/Finder/Iterator/SortableIterator.php +++ b/src/Symfony/Component/Finder/Iterator/SortableIterator.php @@ -80,6 +80,9 @@ public function __construct(\Traversable $iterator, $sort, bool $reverseOrder = } } + /** + * @return \Traversable + */ public function getIterator() { if (1 === $this->sort) { diff --git a/src/Symfony/Component/Finder/Tests/Iterator/Iterator.php b/src/Symfony/Component/Finder/Tests/Iterator/Iterator.php index 3e21a070047aa..bc2eb53b393e0 100644 --- a/src/Symfony/Component/Finder/Tests/Iterator/Iterator.php +++ b/src/Symfony/Component/Finder/Tests/Iterator/Iterator.php @@ -33,7 +33,7 @@ public function rewind() reset($this->values); } - public function valid() + public function valid(): bool { return false !== $this->current(); } diff --git a/src/Symfony/Component/Form/Extension/DataCollector/FormDataCollector.php b/src/Symfony/Component/Form/Extension/DataCollector/FormDataCollector.php index df7726a83f019..ee600878f2a30 100644 --- a/src/Symfony/Component/Form/Extension/DataCollector/FormDataCollector.php +++ b/src/Symfony/Component/Form/Extension/DataCollector/FormDataCollector.php @@ -234,7 +234,7 @@ public function getData() /** * @internal */ - public function __sleep() + public function __sleep(): array { foreach ($this->data['forms_by_hash'] as &$form) { if (isset($form['type_class']) && !$form['type_class'] instanceof ClassStub) { diff --git a/src/Symfony/Component/Form/FormBuilder.php b/src/Symfony/Component/Form/FormBuilder.php index 87b4485a6f11b..e9c7213a98944 100644 --- a/src/Symfony/Component/Form/FormBuilder.php +++ b/src/Symfony/Component/Form/FormBuilder.php @@ -158,7 +158,7 @@ public function all() } /** - * {@inheritdoc} + * @return int */ public function count() { diff --git a/src/Symfony/Component/Form/Tests/ChoiceList/Factory/DefaultChoiceListFactoryTest.php b/src/Symfony/Component/Form/Tests/ChoiceList/Factory/DefaultChoiceListFactoryTest.php index b39f67acb7522..4472bd06c9403 100644 --- a/src/Symfony/Component/Form/Tests/ChoiceList/Factory/DefaultChoiceListFactoryTest.php +++ b/src/Symfony/Component/Form/Tests/ChoiceList/Factory/DefaultChoiceListFactoryTest.php @@ -860,7 +860,7 @@ public function __construct($property) $this->property = $property; } - public function __toString() + public function __toString(): string { return $this->property; } diff --git a/src/Symfony/Component/Form/Tests/Fixtures/CustomArrayObject.php b/src/Symfony/Component/Form/Tests/Fixtures/CustomArrayObject.php index 47fa14090e26d..5c12b6b400bb8 100644 --- a/src/Symfony/Component/Form/Tests/Fixtures/CustomArrayObject.php +++ b/src/Symfony/Component/Form/Tests/Fixtures/CustomArrayObject.php @@ -24,7 +24,7 @@ public function __construct(array $array = null) $this->array = $array ?: []; } - public function offsetExists($offset) + public function offsetExists($offset): bool { return \array_key_exists($offset, $this->array); } @@ -48,12 +48,12 @@ public function offsetUnset($offset) unset($this->array[$offset]); } - public function getIterator() + public function getIterator(): \Traversable { return new \ArrayIterator($this->array); } - public function count() + public function count(): int { return \count($this->array); } @@ -63,7 +63,7 @@ public function __serialize(): array return $this->array; } - public function serialize() + public function serialize(): string { return serialize($this->__serialize()); } diff --git a/src/Symfony/Component/Form/Tests/SimpleFormTest.php b/src/Symfony/Component/Form/Tests/SimpleFormTest.php index 33f815891b3fc..949885222e910 100644 --- a/src/Symfony/Component/Form/Tests/SimpleFormTest.php +++ b/src/Symfony/Component/Form/Tests/SimpleFormTest.php @@ -32,7 +32,7 @@ public function __construct($count) $this->count = $count; } - public function count() + public function count(): int { return $this->count; } @@ -47,7 +47,7 @@ public function __construct($count) $this->iterator = new \ArrayIterator($count > 0 ? array_fill(0, $count, 'Foo') : []); } - public function getIterator() + public function getIterator(): \Traversable { return $this->iterator; } diff --git a/src/Symfony/Component/Form/Util/InheritDataAwareIterator.php b/src/Symfony/Component/Form/Util/InheritDataAwareIterator.php index b48549c6e03a4..ec937570593c6 100644 --- a/src/Symfony/Component/Form/Util/InheritDataAwareIterator.php +++ b/src/Symfony/Component/Form/Util/InheritDataAwareIterator.php @@ -34,7 +34,7 @@ public function getChildren() } /** - * {@inheritdoc} + * @return bool */ public function hasChildren() { diff --git a/src/Symfony/Component/Form/Util/OrderedHashMap.php b/src/Symfony/Component/Form/Util/OrderedHashMap.php index 19ec4fc7d2a27..5d67b3124ec72 100644 --- a/src/Symfony/Component/Form/Util/OrderedHashMap.php +++ b/src/Symfony/Component/Form/Util/OrderedHashMap.php @@ -99,7 +99,7 @@ public function __construct(array $elements = []) } /** - * {@inheritdoc} + * @return bool */ public function offsetExists($key) { @@ -157,7 +157,7 @@ public function offsetUnset($key) } /** - * {@inheritdoc} + * @return \Traversable */ public function getIterator() { @@ -165,7 +165,7 @@ public function getIterator() } /** - * {@inheritdoc} + * @return int */ public function count() { diff --git a/src/Symfony/Component/Form/Util/OrderedHashMapIterator.php b/src/Symfony/Component/Form/Util/OrderedHashMapIterator.php index c34bf2e39b134..323fdd232961a 100644 --- a/src/Symfony/Component/Form/Util/OrderedHashMapIterator.php +++ b/src/Symfony/Component/Form/Util/OrderedHashMapIterator.php @@ -128,7 +128,7 @@ public function key() /** * {@inheritdoc} */ - public function valid() + public function valid(): bool { return null !== $this->key; } diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/AbstractSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/AbstractSessionHandler.php index 78340efbd2228..bcde59ee6b6d8 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/AbstractSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/AbstractSessionHandler.php @@ -29,7 +29,7 @@ abstract class AbstractSessionHandler implements \SessionHandlerInterface, \Sess private $igbinaryEmptyData; /** - * {@inheritdoc} + * @return bool */ public function open($savePath, $sessionName) { @@ -64,7 +64,7 @@ abstract protected function doWrite($sessionId, $data); abstract protected function doDestroy($sessionId); /** - * {@inheritdoc} + * @return bool */ public function validateId($sessionId) { @@ -75,7 +75,7 @@ public function validateId($sessionId) } /** - * {@inheritdoc} + * @return string */ public function read($sessionId) { @@ -98,7 +98,7 @@ public function read($sessionId) } /** - * {@inheritdoc} + * @return bool */ public function write($sessionId, $data) { @@ -115,7 +115,7 @@ public function write($sessionId, $data) } /** - * {@inheritdoc} + * @return bool */ public function destroy($sessionId) { diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php index 3faa336f69dd6..7a528e655a291 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php @@ -55,7 +55,7 @@ public function __construct(\Memcached $memcached, array $options = []) } /** - * {@inheritdoc} + * @return bool */ public function close() { @@ -71,7 +71,7 @@ protected function doRead($sessionId) } /** - * {@inheritdoc} + * @return bool */ public function updateTimestamp($sessionId, $data) { @@ -99,7 +99,7 @@ protected function doDestroy($sessionId) } /** - * {@inheritdoc} + * @return int */ public function gc($maxlifetime) { diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MigratingSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MigratingSessionHandler.php index 5293d2448a29e..ccf23de7eb299 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MigratingSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MigratingSessionHandler.php @@ -39,7 +39,7 @@ public function __construct(\SessionHandlerInterface $currentHandler, \SessionHa } /** - * {@inheritdoc} + * @return bool */ public function close() { @@ -50,7 +50,7 @@ public function close() } /** - * {@inheritdoc} + * @return bool */ public function destroy($sessionId) { @@ -61,7 +61,7 @@ public function destroy($sessionId) } /** - * {@inheritdoc} + * @return int */ public function gc($maxlifetime) { @@ -72,7 +72,7 @@ public function gc($maxlifetime) } /** - * {@inheritdoc} + * @return bool */ public function open($savePath, $sessionName) { @@ -83,7 +83,7 @@ public function open($savePath, $sessionName) } /** - * {@inheritdoc} + * @return string */ public function read($sessionId) { @@ -92,7 +92,7 @@ public function read($sessionId) } /** - * {@inheritdoc} + * @return bool */ public function write($sessionId, $sessionData) { @@ -103,7 +103,7 @@ public function write($sessionId, $sessionData) } /** - * {@inheritdoc} + * @return bool */ public function validateId($sessionId) { @@ -112,7 +112,7 @@ public function validateId($sessionId) } /** - * {@inheritdoc} + * @return bool */ public function updateTimestamp($sessionId, $sessionData) { diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php index 53d9369e8d53b..ad1bd24d4ff90 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php @@ -80,7 +80,7 @@ public function __construct(\MongoDB\Client $mongo, array $options) } /** - * {@inheritdoc} + * @return bool */ public function close() { @@ -100,7 +100,7 @@ protected function doDestroy($sessionId) } /** - * {@inheritdoc} + * @return int */ public function gc($maxlifetime) { @@ -134,7 +134,7 @@ protected function doWrite($sessionId, $data) } /** - * {@inheritdoc} + * @return bool */ public function updateTimestamp($sessionId, $data) { diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NullSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NullSessionHandler.php index 8d193155b090f..ba063960469c0 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NullSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NullSessionHandler.php @@ -19,7 +19,7 @@ class NullSessionHandler extends AbstractSessionHandler { /** - * {@inheritdoc} + * @return bool */ public function close() { @@ -27,7 +27,7 @@ public function close() } /** - * {@inheritdoc} + * @return bool */ public function validateId($sessionId) { @@ -43,7 +43,7 @@ protected function doRead($sessionId) } /** - * {@inheritdoc} + * @return bool */ public function updateTimestamp($sessionId, $data) { @@ -67,7 +67,7 @@ protected function doDestroy($sessionId) } /** - * {@inheritdoc} + * @return int */ public function gc($maxlifetime) { diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php index 043252cd31885..0cd1296c09169 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php @@ -260,7 +260,7 @@ public function isSessionExpired() } /** - * {@inheritdoc} + * @return bool */ public function open($savePath, $sessionName) { @@ -274,7 +274,7 @@ public function open($savePath, $sessionName) } /** - * {@inheritdoc} + * @return string */ public function read($sessionId) { @@ -288,7 +288,7 @@ public function read($sessionId) } /** - * {@inheritdoc} + * @return int */ public function gc($maxlifetime) { @@ -367,7 +367,7 @@ protected function doWrite($sessionId, $data) } /** - * {@inheritdoc} + * @return bool */ public function updateTimestamp($sessionId, $data) { @@ -391,7 +391,7 @@ public function updateTimestamp($sessionId, $data) } /** - * {@inheritdoc} + * @return bool */ public function close() { diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/RedisSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/RedisSessionHandler.php index c2e7d34dcfe09..752e58f73f58a 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/RedisSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/RedisSessionHandler.php @@ -104,7 +104,7 @@ public function gc($maxlifetime): bool } /** - * {@inheritdoc} + * @return bool */ public function updateTimestamp($sessionId, $data) { diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/StrictSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/StrictSessionHandler.php index 83a1f2c063c05..31a39a6973a42 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/StrictSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/StrictSessionHandler.php @@ -31,7 +31,7 @@ public function __construct(\SessionHandlerInterface $handler) } /** - * {@inheritdoc} + * @return bool */ public function open($savePath, $sessionName) { @@ -49,7 +49,7 @@ protected function doRead($sessionId) } /** - * {@inheritdoc} + * @return bool */ public function updateTimestamp($sessionId, $data) { @@ -65,7 +65,7 @@ protected function doWrite($sessionId, $data) } /** - * {@inheritdoc} + * @return bool */ public function destroy($sessionId) { @@ -86,7 +86,7 @@ protected function doDestroy($sessionId) } /** - * {@inheritdoc} + * @return bool */ public function close() { @@ -94,7 +94,7 @@ public function close() } /** - * {@inheritdoc} + * @return int */ public function gc($maxlifetime) { diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/SessionHandlerProxy.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/SessionHandlerProxy.php index b11cc397a0973..8034b7a46b1e2 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/SessionHandlerProxy.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/SessionHandlerProxy.php @@ -36,7 +36,7 @@ public function getHandler() // \SessionHandlerInterface /** - * {@inheritdoc} + * @return bool */ public function open($savePath, $sessionName) { @@ -44,7 +44,7 @@ public function open($savePath, $sessionName) } /** - * {@inheritdoc} + * @return bool */ public function close() { @@ -52,7 +52,7 @@ public function close() } /** - * {@inheritdoc} + * @return string */ public function read($sessionId) { @@ -60,7 +60,7 @@ public function read($sessionId) } /** - * {@inheritdoc} + * @return bool */ public function write($sessionId, $data) { @@ -68,7 +68,7 @@ public function write($sessionId, $data) } /** - * {@inheritdoc} + * @return bool */ public function destroy($sessionId) { @@ -76,7 +76,7 @@ public function destroy($sessionId) } /** - * {@inheritdoc} + * @return int */ public function gc($maxlifetime) { @@ -84,7 +84,7 @@ public function gc($maxlifetime) } /** - * {@inheritdoc} + * @return bool */ public function validateId($sessionId) { @@ -92,7 +92,7 @@ public function validateId($sessionId) } /** - * {@inheritdoc} + * @return bool */ public function updateTimestamp($sessionId, $data) { diff --git a/src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php b/src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php index 03b29653e8831..edce7dbf4bbfe 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php @@ -1054,7 +1054,7 @@ public function testReasonPhraseDefaultsAgainstIana($code, $reasonPhrase) class StringableObject { - public function __toString() + public function __toString(): string { return 'Foo'; } diff --git a/src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php index 408d6d31a21e8..7ace03ae68a5c 100644 --- a/src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php +++ b/src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php @@ -148,7 +148,7 @@ public function reset() /** * @internal */ - public function __sleep() + public function __sleep(): array { if (!$this->dataCount) { $this->data = []; diff --git a/src/Symfony/Component/HttpKernel/Tests/Controller/ControllerResolverTest.php b/src/Symfony/Component/HttpKernel/Tests/Controller/ControllerResolverTest.php index 77ce524fc60a2..014b21e83aff3 100644 --- a/src/Symfony/Component/HttpKernel/Tests/Controller/ControllerResolverTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/Controller/ControllerResolverTest.php @@ -203,7 +203,7 @@ public function __construct() { } - public function __toString() + public function __toString(): string { return ''; } diff --git a/src/Symfony/Component/HttpKernel/Tests/KernelTest.php b/src/Symfony/Component/HttpKernel/Tests/KernelTest.php index 35304bc982ef1..3d82538279633 100644 --- a/src/Symfony/Component/HttpKernel/Tests/KernelTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/KernelTest.php @@ -21,7 +21,6 @@ use Symfony\Component\HttpKernel\Bundle\BundleInterface; use Symfony\Component\HttpKernel\DependencyInjection\ResettableServicePass; use Symfony\Component\HttpKernel\DependencyInjection\ServicesResetter; -use Symfony\Component\HttpKernel\HttpKernel; use Symfony\Component\HttpKernel\HttpKernelInterface; use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\HttpKernel\Tests\Fixtures\KernelForOverrideName; diff --git a/src/Symfony/Component/HttpKernel/Tests/Log/LoggerTest.php b/src/Symfony/Component/HttpKernel/Tests/Log/LoggerTest.php index c89146aff5c12..c562af1bcb7a6 100644 --- a/src/Symfony/Component/HttpKernel/Tests/Log/LoggerTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/Log/LoggerTest.php @@ -200,7 +200,7 @@ public function testFormatter() class DummyTest { - public function __toString() + public function __toString(): string { } } diff --git a/src/Symfony/Component/Intl/Data/Util/ArrayAccessibleResourceBundle.php b/src/Symfony/Component/Intl/Data/Util/ArrayAccessibleResourceBundle.php index d1de8d5b096e7..037f704df7064 100644 --- a/src/Symfony/Component/Intl/Data/Util/ArrayAccessibleResourceBundle.php +++ b/src/Symfony/Component/Intl/Data/Util/ArrayAccessibleResourceBundle.php @@ -39,7 +39,7 @@ public function get($offset) return $value instanceof \ResourceBundle ? new static($value) : $value; } - public function offsetExists($offset) + public function offsetExists($offset): bool { return null !== $this->bundleImpl->get($offset); } @@ -59,12 +59,12 @@ public function offsetUnset($offset) throw new BadMethodCallException('Resource bundles cannot be modified.'); } - public function getIterator() + public function getIterator(): \Traversable { return $this->bundleImpl; } - public function count() + public function count(): int { return $this->bundleImpl->count(); } diff --git a/src/Symfony/Component/Intl/Data/Util/RingBuffer.php b/src/Symfony/Component/Intl/Data/Util/RingBuffer.php index 9b4a8605942f3..db33a4fc1599b 100644 --- a/src/Symfony/Component/Intl/Data/Util/RingBuffer.php +++ b/src/Symfony/Component/Intl/Data/Util/RingBuffer.php @@ -42,7 +42,7 @@ public function __construct(int $size) /** * {@inheritdoc} */ - public function offsetExists($key) + public function offsetExists($key): bool { return isset($this->indices[$key]); } diff --git a/src/Symfony/Component/Ldap/Adapter/ExtLdap/Collection.php b/src/Symfony/Component/Ldap/Adapter/ExtLdap/Collection.php index 4aa9663dc9930..2f3d22743d22d 100644 --- a/src/Symfony/Component/Ldap/Adapter/ExtLdap/Collection.php +++ b/src/Symfony/Component/Ldap/Adapter/ExtLdap/Collection.php @@ -42,6 +42,9 @@ public function toArray() return $this->entries; } + /** + * @return int + */ public function count() { $con = $this->connection->getResource(); @@ -58,6 +61,9 @@ public function count() return $count; } + /** + * @return \Traversable + */ public function getIterator() { if (0 === $this->count()) { @@ -81,6 +87,9 @@ public function getIterator() } } + /** + * @return bool + */ public function offsetExists($offset) { $this->toArray(); diff --git a/src/Symfony/Component/Ldap/Tests/LdapTest.php b/src/Symfony/Component/Ldap/Tests/LdapTest.php index 68e9da2451131..881a15a4b29e0 100644 --- a/src/Symfony/Component/Ldap/Tests/LdapTest.php +++ b/src/Symfony/Component/Ldap/Tests/LdapTest.php @@ -55,8 +55,9 @@ public function testLdapEscape() ->expects($this->once()) ->method('escape') ->with('foo', 'bar', 'baz') - ->willReturn(''); + ->willReturn('') ; + $this->ldap->escape('foo', 'bar', 'baz'); } diff --git a/src/Symfony/Component/Lock/Key.php b/src/Symfony/Component/Lock/Key.php index 798e571d008da..c53892ab6bed2 100644 --- a/src/Symfony/Component/Lock/Key.php +++ b/src/Symfony/Component/Lock/Key.php @@ -27,7 +27,7 @@ public function __construct(string $resource) $this->resource = $resource; } - public function __toString() + public function __toString(): string { return $this->resource; } diff --git a/src/Symfony/Component/Mime/RawMessage.php b/src/Symfony/Component/Mime/RawMessage.php index 17501ec1d0217..8a01049e51301 100644 --- a/src/Symfony/Component/Mime/RawMessage.php +++ b/src/Symfony/Component/Mime/RawMessage.php @@ -54,7 +54,7 @@ public function toIterable(): iterable /** * @internal */ - final public function serialize() + final public function serialize(): string { return serialize($this->__serialize()); } diff --git a/src/Symfony/Component/Process/InputStream.php b/src/Symfony/Component/Process/InputStream.php index 426ffa33a35aa..c952daf592f07 100644 --- a/src/Symfony/Component/Process/InputStream.php +++ b/src/Symfony/Component/Process/InputStream.php @@ -66,6 +66,9 @@ public function isClosed() return !$this->open; } + /** + * @return \Traversable + */ public function getIterator() { $this->open = true; diff --git a/src/Symfony/Component/PropertyAccess/Tests/Fixtures/NonTraversableArrayObject.php b/src/Symfony/Component/PropertyAccess/Tests/Fixtures/NonTraversableArrayObject.php index cb659f907c15b..cf02ee69f2979 100644 --- a/src/Symfony/Component/PropertyAccess/Tests/Fixtures/NonTraversableArrayObject.php +++ b/src/Symfony/Component/PropertyAccess/Tests/Fixtures/NonTraversableArrayObject.php @@ -24,7 +24,7 @@ public function __construct(array $array = null) $this->array = $array ?: []; } - public function offsetExists($offset) + public function offsetExists($offset): bool { return \array_key_exists($offset, $this->array); } @@ -48,7 +48,7 @@ public function offsetUnset($offset) unset($this->array[$offset]); } - public function count() + public function count(): int { return \count($this->array); } @@ -58,7 +58,7 @@ public function __serialize(): array return $this->array; } - public function serialize() + public function serialize(): string { return serialize($this->__serialize()); } diff --git a/src/Symfony/Component/PropertyAccess/Tests/Fixtures/TraversableArrayObject.php b/src/Symfony/Component/PropertyAccess/Tests/Fixtures/TraversableArrayObject.php index ba5ec36e76bd2..5693c6b73e685 100644 --- a/src/Symfony/Component/PropertyAccess/Tests/Fixtures/TraversableArrayObject.php +++ b/src/Symfony/Component/PropertyAccess/Tests/Fixtures/TraversableArrayObject.php @@ -24,7 +24,7 @@ public function __construct(array $array = null) $this->array = $array ?: []; } - public function offsetExists($offset) + public function offsetExists($offset): bool { return \array_key_exists($offset, $this->array); } @@ -48,12 +48,12 @@ public function offsetUnset($offset) unset($this->array[$offset]); } - public function getIterator() + public function getIterator(): \Traversable { return new \ArrayIterator($this->array); } - public function count() + public function count(): int { return \count($this->array); } @@ -63,7 +63,7 @@ public function __serialize(): array return $this->array; } - public function serialize() + public function serialize(): string { return serialize($this->__serialize()); } diff --git a/src/Symfony/Component/Routing/CompiledRoute.php b/src/Symfony/Component/Routing/CompiledRoute.php index 87278e702a899..b6f31b2ebe94d 100644 --- a/src/Symfony/Component/Routing/CompiledRoute.php +++ b/src/Symfony/Component/Routing/CompiledRoute.php @@ -64,6 +64,8 @@ public function __serialize(): array } /** + * @return string + * * @internal since Symfony 4.3 * @final since Symfony 4.3 */ diff --git a/src/Symfony/Component/Routing/Route.php b/src/Symfony/Component/Routing/Route.php index b402665b9220a..03ec76e0dde26 100644 --- a/src/Symfony/Component/Routing/Route.php +++ b/src/Symfony/Component/Routing/Route.php @@ -78,6 +78,8 @@ public function __serialize(): array } /** + * @return string + * * @internal since Symfony 4.3 * @final since Symfony 4.3 */ diff --git a/src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php b/src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php index ce16144639856..6c9903c780227 100644 --- a/src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php +++ b/src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php @@ -163,10 +163,9 @@ public function __serialize(): array } /** - * {@inheritdoc} + * @return string * * @final since Symfony 4.3, use __serialize() instead - * * @internal since Symfony 4.3, use __serialize() instead */ public function serialize() diff --git a/src/Symfony/Component/Security/Core/Exception/AuthenticationException.php b/src/Symfony/Component/Security/Core/Exception/AuthenticationException.php index 94e8d24cb7106..1cfec5352f31d 100644 --- a/src/Symfony/Component/Security/Core/Exception/AuthenticationException.php +++ b/src/Symfony/Component/Security/Core/Exception/AuthenticationException.php @@ -113,7 +113,7 @@ public function unserialize($serialized) /** * @internal */ - public function __sleep() + public function __sleep(): array { if (__CLASS__ !== $c = (new \ReflectionMethod($this, 'serialize'))->getDeclaringClass()->name) { @trigger_error(sprintf('Implementing the "%s::serialize()" method is deprecated since Symfony 4.3, implement the __serialize() and __unserialize() methods instead.', $c), E_USER_DEPRECATED); diff --git a/src/Symfony/Component/Security/Core/Tests/Authentication/AuthenticationTrustResolverTest.php b/src/Symfony/Component/Security/Core/Tests/Authentication/AuthenticationTrustResolverTest.php index 3556f4afeafcc..a446e61602be8 100644 --- a/src/Symfony/Component/Security/Core/Tests/Authentication/AuthenticationTrustResolverTest.php +++ b/src/Symfony/Component/Security/Core/Tests/Authentication/AuthenticationTrustResolverTest.php @@ -152,7 +152,7 @@ public function __serialize(): array { } - public function serialize() + public function serialize(): string { } diff --git a/src/Symfony/Component/Security/Core/Tests/Authentication/Token/AbstractTokenTest.php b/src/Symfony/Component/Security/Core/Tests/Authentication/Token/AbstractTokenTest.php index c8b5fed8d77f3..fe0ed08cc66d2 100644 --- a/src/Symfony/Component/Security/Core/Tests/Authentication/Token/AbstractTokenTest.php +++ b/src/Symfony/Component/Security/Core/Tests/Authentication/Token/AbstractTokenTest.php @@ -259,7 +259,7 @@ public function __construct($name) $this->name = $name; } - public function __toString() + public function __toString(): string { return $this->name; } diff --git a/src/Symfony/Component/Security/Core/Tests/SecurityTest.php b/src/Symfony/Component/Security/Core/Tests/SecurityTest.php index e30b14e7f97a9..49f6f8dbe3c3d 100644 --- a/src/Symfony/Component/Security/Core/Tests/SecurityTest.php +++ b/src/Symfony/Component/Security/Core/Tests/SecurityTest.php @@ -122,7 +122,7 @@ private function createContainer($serviceId, $serviceObject) class StringishUser { - public function __toString() + public function __toString(): string { return 'stringish_user'; } diff --git a/src/Symfony/Component/Security/Core/User/User.php b/src/Symfony/Component/Security/Core/User/User.php index cd763821c8391..ce41c02a1c7d8 100644 --- a/src/Symfony/Component/Security/Core/User/User.php +++ b/src/Symfony/Component/Security/Core/User/User.php @@ -45,7 +45,7 @@ public function __construct(?string $username, ?string $password, array $roles = $this->extraFields = $extraFields; } - public function __toString() + public function __toString(): string { return $this->getUsername(); } diff --git a/src/Symfony/Component/Security/Guard/Tests/Authenticator/FormLoginAuthenticatorTest.php b/src/Symfony/Component/Security/Guard/Tests/Authenticator/FormLoginAuthenticatorTest.php index 56ee7f39197b5..e0cd29131e125 100644 --- a/src/Symfony/Component/Security/Guard/Tests/Authenticator/FormLoginAuthenticatorTest.php +++ b/src/Symfony/Component/Security/Guard/Tests/Authenticator/FormLoginAuthenticatorTest.php @@ -111,7 +111,7 @@ public function onAuthenticationSuccess(Request $request, TokenInterface $token, /** * @param mixed $defaultSuccessRedirectUrl */ - public function setDefaultSuccessRedirectUrl($defaultSuccessRedirectUrl): TestFormLoginAuthenticator + public function setDefaultSuccessRedirectUrl($defaultSuccessRedirectUrl): self { $this->defaultSuccessRedirectUrl = $defaultSuccessRedirectUrl; @@ -121,7 +121,7 @@ public function setDefaultSuccessRedirectUrl($defaultSuccessRedirectUrl): TestFo /** * @param mixed $loginUrl */ - public function setLoginUrl($loginUrl): TestFormLoginAuthenticator + public function setLoginUrl($loginUrl): self { $this->loginUrl = $loginUrl; diff --git a/src/Symfony/Component/Security/Http/Tests/Firewall/UsernamePasswordFormAuthenticationListenerTest.php b/src/Symfony/Component/Security/Http/Tests/Firewall/UsernamePasswordFormAuthenticationListenerTest.php index 723b4ebb97cff..c83d7e878713a 100644 --- a/src/Symfony/Component/Security/Http/Tests/Firewall/UsernamePasswordFormAuthenticationListenerTest.php +++ b/src/Symfony/Component/Security/Http/Tests/Firewall/UsernamePasswordFormAuthenticationListenerTest.php @@ -191,7 +191,7 @@ public function getUsernameForLength() class DummyUserClass { - public function __toString() + public function __toString(): string { return ''; } diff --git a/src/Symfony/Component/Serializer/Tests/Fixtures/TraversableDummy.php b/src/Symfony/Component/Serializer/Tests/Fixtures/TraversableDummy.php index bcf46e512e26a..ac98f1c2e76e6 100644 --- a/src/Symfony/Component/Serializer/Tests/Fixtures/TraversableDummy.php +++ b/src/Symfony/Component/Serializer/Tests/Fixtures/TraversableDummy.php @@ -16,7 +16,7 @@ class TraversableDummy implements \IteratorAggregate public $foo = 'foo'; public $bar = 'bar'; - public function getIterator() + public function getIterator(): \Traversable { return new \ArrayIterator(get_object_vars($this)); } diff --git a/src/Symfony/Component/Templating/Tests/Fixtures/SimpleHelper.php b/src/Symfony/Component/Templating/Tests/Fixtures/SimpleHelper.php index 9538fcc313b54..5ddb9f13a9399 100644 --- a/src/Symfony/Component/Templating/Tests/Fixtures/SimpleHelper.php +++ b/src/Symfony/Component/Templating/Tests/Fixtures/SimpleHelper.php @@ -22,7 +22,7 @@ public function __construct($value) $this->value = $value; } - public function __toString() + public function __toString(): string { return $this->value; } diff --git a/src/Symfony/Component/Translation/Tests/TranslatorTest.php b/src/Symfony/Component/Translation/Tests/TranslatorTest.php index 87603a9dc867b..f171ed93fc812 100644 --- a/src/Symfony/Component/Translation/Tests/TranslatorTest.php +++ b/src/Symfony/Component/Translation/Tests/TranslatorTest.php @@ -662,7 +662,7 @@ public function __construct($str) $this->str = $str; } - public function __toString() + public function __toString(): string { return $this->str; } diff --git a/src/Symfony/Component/Validator/ConstraintViolationList.php b/src/Symfony/Component/Validator/ConstraintViolationList.php index c30ee57cb268b..e56c8e31f1253 100644 --- a/src/Symfony/Component/Validator/ConstraintViolationList.php +++ b/src/Symfony/Component/Validator/ConstraintViolationList.php @@ -116,7 +116,7 @@ public function getIterator() } /** - * {@inheritdoc} + * @return int */ public function count() { @@ -124,7 +124,7 @@ public function count() } /** - * {@inheritdoc} + * @return bool */ public function offsetExists($offset) { diff --git a/src/Symfony/Component/Validator/Tests/Constraints/AbstractComparisonValidatorTestCase.php b/src/Symfony/Component/Validator/Tests/Constraints/AbstractComparisonValidatorTestCase.php index 486901bfc31c9..944195f0f35bc 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/AbstractComparisonValidatorTestCase.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/AbstractComparisonValidatorTestCase.php @@ -25,7 +25,7 @@ public function __construct($value) $this->value = $value; } - public function __toString() + public function __toString(): string { return (string) $this->value; } diff --git a/src/Symfony/Component/Validator/Tests/Constraints/BicValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/BicValidatorTest.php index 80c00423e7745..b07f6f9f83b26 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/BicValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/BicValidatorTest.php @@ -248,7 +248,7 @@ public function __construct($value) $this->value = $value; } - public function __toString() + public function __toString(): string { return (string) $this->value; } diff --git a/src/Symfony/Component/Validator/Tests/Constraints/UrlValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/UrlValidatorTest.php index e59c6fe5c07f5..bcfa07ad9af4e 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/UrlValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/UrlValidatorTest.php @@ -387,7 +387,7 @@ public function testCheckDnsOptionIsDeprecated() class EmailProvider { - public function __toString() + public function __toString(): string { return ''; } diff --git a/src/Symfony/Component/Validator/Tests/Fixtures/Countable.php b/src/Symfony/Component/Validator/Tests/Fixtures/Countable.php index afc42376a254b..6479c23b2dd2c 100644 --- a/src/Symfony/Component/Validator/Tests/Fixtures/Countable.php +++ b/src/Symfony/Component/Validator/Tests/Fixtures/Countable.php @@ -20,7 +20,7 @@ public function __construct(array $content) $this->content = $content; } - public function count() + public function count(): int { return \count($this->content); } diff --git a/src/Symfony/Component/Validator/Tests/Fixtures/CustomArrayObject.php b/src/Symfony/Component/Validator/Tests/Fixtures/CustomArrayObject.php index 9b5303c167c0b..34b208b2bea0c 100644 --- a/src/Symfony/Component/Validator/Tests/Fixtures/CustomArrayObject.php +++ b/src/Symfony/Component/Validator/Tests/Fixtures/CustomArrayObject.php @@ -24,7 +24,7 @@ public function __construct(array $array = null) $this->array = $array ?: []; } - public function offsetExists($offset) + public function offsetExists($offset): bool { return \array_key_exists($offset, $this->array); } @@ -48,12 +48,12 @@ public function offsetUnset($offset) unset($this->array[$offset]); } - public function getIterator() + public function getIterator(): \Traversable { return new \ArrayIterator($this->array); } - public function count() + public function count(): int { return \count($this->array); } @@ -63,7 +63,7 @@ public function __serialize(): array return $this->array; } - public function serialize() + public function serialize(): string { return serialize($this->__serialize()); } diff --git a/src/Symfony/Component/Validator/Tests/Fixtures/ToString.php b/src/Symfony/Component/Validator/Tests/Fixtures/ToString.php index 714fdb9e98f5f..2512066bafc87 100644 --- a/src/Symfony/Component/Validator/Tests/Fixtures/ToString.php +++ b/src/Symfony/Component/Validator/Tests/Fixtures/ToString.php @@ -15,7 +15,7 @@ class ToString { public $data; - public function __toString() + public function __toString(): string { return 'toString'; } diff --git a/src/Symfony/Component/VarDumper/Cloner/Data.php b/src/Symfony/Component/VarDumper/Cloner/Data.php index 55baec5dde603..fd7a18a752385 100644 --- a/src/Symfony/Component/VarDumper/Cloner/Data.php +++ b/src/Symfony/Component/VarDumper/Cloner/Data.php @@ -106,11 +106,17 @@ public function getValue($recursive = false) return $children; } + /** + * @return int + */ public function count() { return \count($this->getValue()); } + /** + * @return \Traversable + */ public function getIterator() { if (!\is_array($value = $this->getValue())) { @@ -136,6 +142,9 @@ public function __isset($key) return null !== $this->seek($key); } + /** + * @return bool + */ public function offsetExists($key) { return $this->__isset($key); diff --git a/src/Symfony/Component/VarDumper/Cloner/Stub.php b/src/Symfony/Component/VarDumper/Cloner/Stub.php index 27dd3ef32c4df..7e9eb6d59f519 100644 --- a/src/Symfony/Component/VarDumper/Cloner/Stub.php +++ b/src/Symfony/Component/VarDumper/Cloner/Stub.php @@ -44,7 +44,7 @@ class Stub /** * @internal */ - public function __sleep() + public function __sleep(): array { $properties = []; diff --git a/src/Symfony/Component/VarExporter/Tests/VarExporterTest.php b/src/Symfony/Component/VarExporter/Tests/VarExporterTest.php index d80c2858ee91e..d62639095e2a6 100644 --- a/src/Symfony/Component/VarExporter/Tests/VarExporterTest.php +++ b/src/Symfony/Component/VarExporter/Tests/VarExporterTest.php @@ -209,7 +209,7 @@ public function provideExport() class MySerializable implements \Serializable { - public function serialize() + public function serialize(): string { return '123'; } @@ -227,7 +227,7 @@ class MyWakeup public $baz; public $def = 234; - public function __sleep() + public function __sleep(): array { return ['sub', 'baz']; } @@ -305,7 +305,7 @@ public function setFlags($flags) class GoodNight { - public function __sleep() + public function __sleep(): array { $this->good = 'night'; @@ -395,7 +395,7 @@ public function unserialize($str) class Php74Serializable implements \Serializable { - public function __serialize() + public function __serialize(): array { return [$this->foo = new \stdClass()]; } @@ -405,7 +405,7 @@ public function __unserialize(array $data) list($this->foo) = $data; } - public function __sleep() + public function __sleep(): array { throw new \BadMethodCallException(); } @@ -415,7 +415,7 @@ public function __wakeup() throw new \BadMethodCallException(); } - public function serialize() + public function serialize(): string { throw new \BadMethodCallException(); } diff --git a/src/Symfony/Component/Workflow/TransitionBlockerList.php b/src/Symfony/Component/Workflow/TransitionBlockerList.php index 8569b28fea36c..f7f4a63ea303a 100644 --- a/src/Symfony/Component/Workflow/TransitionBlockerList.php +++ b/src/Symfony/Component/Workflow/TransitionBlockerList.php @@ -63,7 +63,7 @@ public function isEmpty(): bool * * @return \ArrayIterator|TransitionBlocker[] */ - public function getIterator() + public function getIterator(): \Traversable { return new \ArrayIterator($this->blockers); }