Skip to content

#20921 [Config] Provide shorthand methods for ArrayNodeDefinition::pr… #20923

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

Conversation

skafandri
Copy link
Contributor

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #20921
License MIT

@@ -80,6 +80,76 @@ public function prototype($type)
}

/**
* Shorthand for prototype('variable').
Copy link
Member

Choose a reason for hiding this comment

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

could be removed, IMO it doesn't add any additional value

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think so, I think that the method name is self explanatory. But wouldn't break the code standards check?

Copy link
Member

Choose a reason for hiding this comment

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

Quite the contrary :) We are trying to only add phpdoc when it adds value.

*
* @return ScalarNodeDefinition
*/
public function prototypeScalar()
Copy link
Member

Choose a reason for hiding this comment

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

What about using scalarPrototype instead (same for the other new methods)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

scalarPrototype sounds better for me. The only motivation behind the current naming is to group the methods in an IDE auto complete list.

Copy link
Member

Choose a reason for hiding this comment

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

I understand that. But at least PhpStorm is even with the other names able to suggest all of these methods when typing prototype (if I am not completely mistaken).

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes you're right. That's not a big issue. Most IDE autocomplete are clever enough to show methods containing rather than starting with a string.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, my IDE does that too, I was only thinking about some friends who are still using IDEs with left prefix only autocomplete support (Netbeans 6). If you think we shouldn't care about this legacy, I am into it.

@skafandri
Copy link
Contributor Author

I don't understand the generated diff of fabbot.io Is that hook open source? :)

@fabpot
Copy link
Member

fabpot commented Dec 18, 2016

👍

1 similar comment
@xabbuh
Copy link
Member

xabbuh commented Dec 18, 2016

👍

@@ -227,6 +227,48 @@ public function testNormalizeKeys()
$this->assertFalse($this->getField($node, 'normalizeKeys'));
}

public function testPrototypeVariable()
Copy link
Contributor

Choose a reason for hiding this comment

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

What about a single test?

@skafandri
Copy link
Contributor Author

A single test with multiple asserts to cover all the cases. I am fine with that. What do you think guys?

@fabpot
Copy link
Member

fabpot commented Dec 19, 2016

Thank you @skafandri.

@fabpot fabpot closed this Dec 19, 2016
fabpot added a commit that referenced this pull request Dec 19, 2016
…eDefinition::pr… (skafandri)

This PR was squashed before being merged into the 3.3-dev branch (closes #20923).

Discussion
----------

#20921 [Config] Provide shorthand methods for ArrayNodeDefinition::pr…

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #20921
| License       | MIT

Commits
-------

22b8490 #20921 [Config] Provide shorthand methods for ArrayNodeDefinition::pr…
@oleg-andreyev
Copy link
Contributor

👍

nicolas-grekas added a commit that referenced this pull request Dec 28, 2016
This PR was merged into the 2.7 branch.

Discussion
----------

[Config] Improve PHPdoc / IDE autocomplete

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes-ish
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!--highly recommended for new features-->

The missing pieces for fixing the autocomplete in IDE's (tested in `PhpStorm 2016.3.2`).

Each method seems to be found now for the framework bundle configuration 😱

Actually uses #20923 where needed, but i think we should go with it consistently.

Relates to #20290 (comment)

Commits
-------

3f3c6e0 [Config] Improve PHPdoc / IDE autocomplete
@fabpot fabpot mentioned this pull request May 1, 2017
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.

7 participants