Skip to content

New with parentheses #20

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 2 commits into from
Feb 6, 2018
Merged

New with parentheses #20

merged 2 commits into from
Feb 6, 2018

Conversation

carusogabriel
Copy link
Contributor

@carusogabriel carusogabriel commented Jan 29, 2018

@kukulich
Copy link
Contributor

@carusogabriel I can write the sniff for https://github.com/slevomat/coding-standard, would it be ok?

@carusogabriel
Copy link
Contributor Author

@kukulich Perfect. I'm not good at sniffers, so I appreciate your help 😄

@kukulich
Copy link
Contributor

Please test: slevomat/coding-standard@a3c36e9

$foo = new \DateTimeImmutable();

$barClassName = 'Bar';
$bar = new $barClassName();
Copy link
Member

Choose a reason for hiding this comment

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

This = should be aligned with the one in the line above (this file only)

$bar = new $barClassName();

$classNamesInArray = ['Baz'];
$foo = new $classNamesInArray[0]();
Copy link
Member

Choose a reason for hiding this comment

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

This = should be aligned with the one in the line above (this file only)

$classNamesInArray = ['Baz'];
$foo = new $classNamesInArray[0]();

$classNamesInObject = new stdClass();
Copy link
Member

Choose a reason for hiding this comment

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

This = should be aligned with the one in the line bellow (this file only)


$classNamesInObject = new stdClass();
$classNamesInObject->foo = 'Foo';
$foo = new $classNamesInObject->foo();
Copy link
Member

Choose a reason for hiding this comment

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

This = should be aligned with the one in the line above (this file only)

@@ -95,6 +95,8 @@
<rule ref="SlevomatCodingStandard.ControlStructures.DisallowEqualOperators"/>
<!-- Require language constructs without parentheses -->
<rule ref="SlevomatCodingStandard.ControlStructures.LanguageConstructWithParentheses"/>
<!-- Require new instances with parentheses -->
<rule ref="SlevomatCodingStandard.ControlStructures.NewWithParenthesesSniff"/>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kukulich What is the correct Sniff name? Travis isn't find it 😢

Copy link
Contributor

Choose a reason for hiding this comment

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

@carusogabriel Remove "Sniff" at the end :)

<rule ref="SlevomatCodingStandard.ControlStructures.NewWithParentheses"/>

@carusogabriel
Copy link
Contributor Author

@Ocramius @Majkl578 @lcobucci How should we proceed now?

composer.json Outdated
@@ -18,7 +18,7 @@
"php": "^7.1",
"squizlabs/php_codesniffer": "^3.2",
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.2",
"slevomat/coding-standard": "^4.3.0"
"slevomat/coding-standard": "dev-master"
Copy link
Member

Choose a reason for hiding this comment

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

This needs to become a stable dependency before merging

Copy link
Contributor

@Majkl578 Majkl578 Feb 5, 2018

Choose a reason for hiding this comment

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

+ requires bump once tagged in Slevomat CS. 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

4.4 is out

@Ocramius
Copy link
Member

Ocramius commented Feb 5, 2018

@carusogabriel I'd say this is good to go. We just need a stable version of slevomat/coding-standard and then a new major release.

@kukulich
Copy link
Contributor

kukulich commented Feb 5, 2018

@carusogabriel I only wait for confirmation that slevomat/coding-standard#258 is ok and I'll do a release.

@Majkl578 Majkl578 added this to the 3.0.0 milestone Feb 5, 2018
@Majkl578
Copy link
Contributor

Majkl578 commented Feb 5, 2018

@carusogabriel Version bumped in 979478d.

@carusogabriel carusogabriel changed the title [WIP] New with parentheses New with parentheses Feb 5, 2018
@Majkl578
Copy link
Contributor

Majkl578 commented Feb 5, 2018

Merge branch 'master' into new-with-parentheses

Please, always rebase on top of master, not merge it into PR branch.

@Ocramius Ocramius self-assigned this Feb 6, 2018
Copy link
Member

@Ocramius Ocramius left a comment

Choose a reason for hiding this comment

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

🚢

@Ocramius Ocramius merged commit 598df57 into doctrine:master Feb 6, 2018
@carusogabriel carusogabriel deleted the new-with-parentheses branch February 6, 2018 09:56
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