Skip to content

Enhancement: Use short list syntax#173

Closed
localheinz wants to merge 1 commit intodoctrine:masterfrom
localheinz:feature/list
Closed

Enhancement: Use short list syntax#173
localheinz wants to merge 1 commit intodoctrine:masterfrom
localheinz:feature/list

Conversation

@localheinz
Copy link
Copy Markdown
Contributor

This PR

  • uses short list() syntax

$this->match(DocLexer::T_CLOSE_CURLY_BRACES);

foreach ($values as $value) {
list ($key, $val) = $value;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

How about inlining this to

diff --git a/lib/Doctrine/Common/Annotations/DocParser.php b/lib/Doctrine/Common/Annotations/DocParser.php
index 4d41e84c..e4ffed0f 100644
--- a/lib/Doctrine/Common/Annotations/DocParser.php
+++ b/lib/Doctrine/Common/Annotations/DocParser.php
@@ -1120,9 +1120,7 @@ final class DocParser

         $this->match(DocLexer::T_CLOSE_CURLY_BRACES);

-        foreach ($values as $value) {
-            [$key, $val] = $value;
-
+        foreach ($values as [$key, $val]) {
             if ($key !== null) {
                 $array[$key] = $val;
             } else {

?

@lcobucci
Copy link
Copy Markdown
Member

lcobucci commented Feb 3, 2018

@localheinz we should add doctrine/coding-standard to this project and also CS validation to the build, do you want to handle that?

@localheinz
Copy link
Copy Markdown
Contributor Author

@lcobucci

Sounds good, give me a moment!

@lcobucci
Copy link
Copy Markdown
Member

lcobucci commented Feb 3, 2018

@localheinz you're awesome, thanks!

@lcobucci
Copy link
Copy Markdown
Member

lcobucci commented Feb 3, 2018

@localheinz you can use doctrine/inflector#73 as example

@localheinz
Copy link
Copy Markdown
Contributor Author

localheinz commented Feb 3, 2018

Fixing with #177.

@localheinz localheinz closed this Feb 3, 2018
@localheinz localheinz deleted the feature/list branch February 3, 2018 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants