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/DependencyInjection
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
..
Argument Replace @return annotation by return type in final classes 2019-06-23 00:57:33 +02:00
Compiler feature #31996 [5.0] Add return types in final classes (dFayet) 2019-06-23 23:15:46 +01:00
Config Replace @return annotation by return type in final classes 2019-06-23 00:57:33 +02:00
Dumper Merge branch '4.4' 2019-06-09 18:08:04 +02:00
Exception [Contracts][EventDispatcher] add EventDispatcherInterface to symfony/contracts and use it where possible 2019-03-25 18:18:00 +01:00
Extension [DI] removed support for extension config without ConfigurationInterface implem 2019-05-30 08:17:44 +02:00
LazyProxy Replace @return annotation by return type in final classes 2019-06-23 00:57:33 +02:00
Loader Replace @return annotation by return type in final classes 2019-06-23 00:57:33 +02:00
ParameterBag [DI] remove support for non-string default env() parameters 2019-05-30 13:48:35 +02:00
Tests Merge branch '4.4' 2019-06-17 19:43:54 +02:00
.gitignore
Alias.php [DI] add id of referencing service when a deprecated alias is found 2019-01-28 17:40:12 +01:00
CHANGELOG.md [DI] removed tagged 2019-06-09 21:05:58 +02:00
ChildDefinition.php Merge branch '3.4' into 4.2 2019-02-23 16:17:42 +01:00
composer.json Add back all conflict rules 2019-05-29 10:53:30 +02:00
Container.php [DI] remove deprecated code paths 2019-06-08 13:09:13 +02:00
ContainerAwareInterface.php [HttpKernel] Fix inheritdocs 2018-08-29 14:45:36 +02:00
ContainerAwareTrait.php [DI] minor docblock fixes 2017-10-24 13:40:19 +02:00
ContainerBuilder.php Replace @return annotation by return type in final classes 2019-06-23 00:57:33 +02:00
ContainerInterface.php [DI] Add ContainerInterface::RUNTIME_EXCEPTION_ON_INVALID_REFERENCE 2018-03-24 17:54:13 +01:00
Definition.php Merge branch '4.4' 2019-06-13 13:15:36 +02:00
EnvVarProcessor.php Add a require env var processor 2019-04-07 08:29:53 +00:00
EnvVarProcessorInterface.php [DI] EnvVarProcessorInterface: fix missing use 2017-09-29 13:52:29 +02:00
ExpressionLanguage.php fixed CS 2019-01-16 19:35:49 +01:00
ExpressionLanguageProvider.php switched array() to [] 2019-01-16 10:39:14 +01:00
LICENSE update year in license files 2019-01-01 14:45:19 +01:00
Parameter.php Replace more docblocks by type-hints 2017-11-07 15:45:01 +01:00
phpunit.xml.dist Bump phpunit XSD version to 5.2 2018-11-11 12:18:13 +01:00
README.md
Reference.php fixed some deprecation messages 2017-12-31 06:12:25 +01:00
ReverseContainer.php Replace @return annotation by return type in final classes 2019-06-23 00:57:33 +02:00
ServiceLocator.php [DI][Contracts] add and implement ServiceProviderInterface 2019-03-28 12:22:02 +01:00
TaggedContainerInterface.php
TypedReference.php fixed CS 2019-06-13 12:57:15 +02:00
Variable.php Replace more docblocks by type-hints 2017-11-07 15:45:01 +01:00

DependencyInjection Component

The DependencyInjection component allows you to standardize and centralize the way objects are constructed in your application.

Resources