Skip to content

[Config] Add parameter types #41575

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 29, 2021
Merged

Conversation

derrabus
Copy link
Member

@derrabus derrabus commented Jun 6, 2021

Q A
Branch? 6.0
Bug fix? no
New feature? no
Deprecations? no
Tickets Part of #41424
License MIT
Doc PR N/A

This PR adds parameter types to all methods of the Config component.

@@ -52,7 +52,7 @@ public function __construct(ContainerBuilder $container, FileLocatorInterface $l
*
* @param bool|string $ignoreErrors Whether errors should be ignored; pass "not_found" to ignore only when the loaded resource is not found
*/
public function import($resource, string $type = null, $ignoreErrors = false, string $sourceResource = null, $exclude = null)
public function import(mixed $resource, string $type = null, bool | string $ignoreErrors = false, string $sourceResource = null, $exclude = null)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've omitted the type declaration for $exclude in order to maintain compatibility with Config 5.4. Shall I keep it that way or shall I bump?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's keep compat

@carsonbot
Copy link

Hey!

I think @jschaedl has recently worked with this code. Maybe they can help review this?

Cheers!

Carsonbot

@derrabus derrabus requested a review from nicolas-grekas June 7, 2021 22:49
derrabus added a commit that referenced this pull request Jun 9, 2021
This PR was merged into the 4.4 branch.

Discussion
----------

[Config] Backport type declarations

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | N/A
| License       | MIT
| Doc PR        | N/A

This PR backports type declarations from #41575 where it's safe to do so.

Commits
-------

46e18af [Config] Backport type declarations
@derrabus derrabus force-pushed the types/config branch 2 times, most recently from 5aa99b3 to a9e75c2 Compare June 9, 2021 11:16
@derrabus derrabus force-pushed the types/config branch 2 times, most recently from 9fada46 to 4754580 Compare June 29, 2021 09:43
@derrabus derrabus force-pushed the types/config branch 4 times, most recently from 35eec33 to 7ec2142 Compare June 29, 2021 10:31
Signed-off-by: Alexander M. Turek <me@derrabus.de>
@nicolas-grekas
Copy link
Member

Thank you @derrabus.

@nicolas-grekas nicolas-grekas merged commit 76ee4a5 into symfony:6.0 Jun 29, 2021
@derrabus derrabus deleted the types/config branch June 29, 2021 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants