This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/Config/Definition
Tobias Schultze 18793b7ca7 feature #31996 [5.0] Add return types in final classes (dFayet)
This PR was merged into the 5.0-dev branch.

Discussion
----------

[5.0] Add return types in final classes

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes/no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | no
| Fixed tickets | #31981
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

This is the first step for the issue #31981

I have some questions:

-  ~I have not added type for methods with `@inheritdoc` annotation, should I?~
- ~Don't we want to type also functions without `@return` annotation? (still in `final` classes)~
- ~If yes is the answer of the previous one, do we also want the `void` return type?~
- ~I have also added the return type in the `DependencyInjection` PhpDumper, but is it also wanted? (if yes, I will clean a bit the code changed)~
- ~Should we update the documentation's code samples when they display `final` classes?~

Todo:
- [x] Adjust the PR, following the answers of the questions
- [x] Add return type also when there is no `@return`, or with `@inheritdoc`
- [x] [src/Symfony/Component/Debug/ErrorHandler.php#L383](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Debug/ErrorHandler.php#L383) `@return` annotation is not correct according to the return, investigate and adjust if needed
- [x] [src/Symfony/Component/HttpKernel/ControllerMetadata/ArgumentMetadataFactory.php#L50](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/ControllerMetadata/ArgumentMetadataFactory.php#L50) `@return` annotation is not correct according to the return, investigate and adjust if needed
- [x] Do a PR on documentation to add return type on code snippets with final classes => unneeded as they were already typed

Commits
-------

ca5ae1989e Replace @return annotation by return type in final classes
2019-06-23 23:15:46 +01:00
..
Builder Merge branch '4.4' 2019-06-17 21:45:49 +02:00
Dumper Merge branch '3.4' into 4.1 2019-01-16 19:21:11 +01:00
Exception [DI] Fix suspicious test 2019-06-08 08:01:32 +02:00
ArrayNode.php Merge branch '3.4' into 4.2 2019-02-23 16:17:42 +01:00
BaseNode.php Add BC layer for updated constructor types 2019-06-17 20:49:26 +02:00
BooleanNode.php fixed CS 2019-01-16 19:35:49 +01:00
ConfigurationInterface.php
EnumNode.php fixed CS 2019-01-16 19:35:49 +01:00
FloatNode.php fixed CS 2019-01-16 19:35:49 +01:00
IntegerNode.php fixed CS 2019-01-16 19:35:49 +01:00
NodeInterface.php [Config] Handle nullable node name + fix inheritdocs 2018-03-19 21:05:09 +01:00
NumericNode.php Add feature allowing change of Path Separator 2018-01-21 16:11:55 +01:00
Processor.php Replace @return annotation by return type in final classes 2019-06-23 00:57:33 +02:00
PrototypedArrayNode.php Merge branch '3.4' into 4.2 2019-02-23 16:17:42 +01:00
PrototypeNodeInterface.php
ScalarNode.php Merge branch '4.2' into short-array-master 2019-01-16 22:53:39 +01:00
VariableNode.php [Config] Removed env var support with cannotBeEmpty() 2019-06-08 13:07:59 +02:00