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
Fabien Potencier 6ee3efac79 minor #32066 Fine tune constructor types (Tobion)
This PR was merged into the 4.4 branch.

Discussion
----------

Fine tune constructor types

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets |
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Fine tunes some constructor types that have been added in #24722

Form names as integer was only a workaround as forms names are used as array keys which get transformed to int. So it was added as a workaround in https://github.com/symfony/symfony/pull/6355#discussion_r2422205
With typehints added in #24722 those were mostly auto-cast anyway, e.g. in FormBuilder. There are only a few integer form names remaining documented, in the main entry points of the Form component (`\Symfony\Component\Form\FormInterface::add`). Internally it's always a string now. So I could remove some int docs which also fixes #30032 what @xabbuh tried to do.

Some of these changes we're just not done before because of broken tests. It's mainly a missing explicit mock for `TranslationInterface::trans` which returned null. If we had return types hints in interfaces, this wouldn't happen.

Commits
-------

507794a575 Fine tune constructor types
2019-06-17 18:40:55 +02:00
..
Bridge [PhpUnitBridge] Bump PHPUnit 7+8 2019-06-16 13:16:20 +02:00
Bundle Prepare for PHP 7.4 preload 2019-06-15 00:30:02 +02:00
Component minor #32066 Fine tune constructor types (Tobion) 2019-06-17 18:40:55 +02:00
Contracts Prepare for PHP 7.4 preload 2019-06-15 00:30:02 +02:00