Skip to content
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

[Console] Fix input values allowed types #28448

Merged
merged 1 commit into from
Sep 12, 2018

Conversation

chalasr
Copy link
Member

@chalasr chalasr commented Sep 11, 2018

Q A
Branch? 2.8
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets n/a
License MIT
Doc PR n/a

Continuation of #28374

@chalasr chalasr added this to the 2.8 milestone Sep 11, 2018
@fabpot
Copy link
Member

fabpot commented Sep 12, 2018

Thank you @chalasr.

@fabpot fabpot merged commit 0c16cd9 into symfony:2.8 Sep 12, 2018
fabpot added a commit that referenced this pull request Sep 12, 2018
This PR was merged into the 2.8 branch.

Discussion
----------

[Console] Fix input values allowed types

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Continuation of #28374

Commits
-------

0c16cd9 [Console] Fix input values allowed types
@chalasr chalasr deleted the input-values-types branch September 12, 2018 07:56
chalasr pushed a commit that referenced this pull request Oct 1, 2018
… (chalasr)

This PR was merged into the 2.8 branch.

Discussion
----------

[Console] Add missing null to input values allowed types

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

When switching from `mixed` in #28448 we forgot that input arguments/options are default `null` and can be set to null (e.g. when passed empty with mode `VALUE_OPTIONAL`).
Spotted by @ro0NL

Commits
-------

f0bc2a6 [Console] Add missing null to input values allowed types
@curry684
Copy link
Contributor

This change and its brethren is suddenly causing PHPStan errors in my project after upgrade to 4.1.6.

Even if following the example from the docs at https://symfony.com/doc/current/console/input.html you would get this:

$this
    // ...
    ->addOption(
        'iterations',
        'i',
        InputOption::VALUE_REQUIRED,
        'How many times should the message be printed?',
        1
    );

This would correctly give the same error I'm having now:

Parameter #5 $default of class Symfony\...\InputOption constructor expects array<string>|bool|string|null, int given.

I'm not really sure why this was suddenly limited to the provided types, shouldn't it just be mixed for cases like this where the input is stored and returned verbatim?

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.

4 participants