Skip to content

Conversation

xalopp
Copy link
Contributor

@xalopp xalopp commented Jul 27, 2018

No description provided.

composer.json Outdated
@@ -28,6 +28,7 @@
"squizlabs/php_codesniffer": "^3.2.3",
"escapestudios/symfony2-coding-standard": "^3.0",
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.3",
"php": ">=5.6.0"
"php": ">=5.6.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

As Slevomat requires PHP 7.1, we could also bump this here.

@xalopp
Copy link
Contributor Author

xalopp commented Jul 29, 2018

Using Slevomat means to drop PHP 5. Symfony 3.4 is is requires at least 5.5.9.

So this PR would be a breaking change.

Or shall we create a new branch to keep compat to 3.4 for 5.5.9?

@mmoll
Copy link
Contributor

mmoll commented Jul 29, 2018

@xalopp Please see GH-84 for a separate PHP 7.1 change.

I'd suggest to merge GH-85 first and then branch off 2.x. But to be honest, personally I don't see any relationship between our CS and Symfony's PHP requirements. Even now we do require 5.6, which is >5.5.9.

Bringing in this new sniff here would require a major version bump anyway.

@xalopp xalopp force-pushed the fix_81_php7_return_type branch 2 times, most recently from 1416813 to d15bf7f Compare September 7, 2018 15:51
@codecov
Copy link

codecov bot commented Sep 7, 2018

Codecov Report

Merging #83 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #83   +/-   ##
=========================================
  Coverage     98.46%   98.46%           
  Complexity      124      124           
=========================================
  Files             6        6           
  Lines           522      522           
=========================================
  Hits            514      514           
  Misses            8        8

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 895be4b...d87604e. Read the comment docs.

@xalopp xalopp force-pushed the fix_81_php7_return_type branch from d15bf7f to 4947d2b Compare September 7, 2018 16:16
@xalopp xalopp changed the title WIP: Use Slevomat to check for stricter function signature Use Slevomat Coding Standard method typehinting Sep 7, 2018
README.md Outdated
@@ -35,7 +35,10 @@ The MO4 Coding Standard is an extension of the [Symfony Coding Standard](http://
* There must be at least one space around operators, and (except for aligning multiline statements) at most one, see the
[respective Squizlabs Sniff](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Customisable-Sniff-Properties#squizwhitespaceoperatorspacing)
we imported with `ignoreNewlines = false`
* Single quotes must be used instead of double quoutes, where possible.
* Single quotes must be used instead of double quotes, where possible.
* all method requires a return type; use `void` if the method returns nothing.
Copy link
Contributor

Choose a reason for hiding this comment

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

"all methods require"

Copy link
Contributor

Choose a reason for hiding this comment

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

And for consistency reasons with the bullet points above I'd vote for uppercase first :)

README.md Outdated
* Single quotes must be used instead of double quoutes, where possible.
* Single quotes must be used instead of double quotes, where possible.
* all method requires a return type; use `void` if the method returns nothing.
* all method parameters that defaults to null must be marked as nullable with the `?` symbol.
Copy link
Contributor

Choose a reason for hiding this comment

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

"that default" and maybe use backticks for the null

@mmoll
Copy link
Contributor

mmoll commented Sep 7, 2018

I ran this against a small modern codebase and the results are pretty great 👍

@mmoll
Copy link
Contributor

mmoll commented Sep 7, 2018

@xalopp could you please also add SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing?

@mmoll mmoll added this to the 3.0.0 milestone Sep 11, 2018
@xalopp xalopp force-pushed the fix_81_php7_return_type branch from 4947d2b to d87604e Compare September 12, 2018 11:20
@mmoll mmoll merged commit 371a902 into mayflower:master Sep 12, 2018
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.

3 participants