You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 21, 2020. It is now read-only.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+37Lines changed: 37 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,43 @@
2
2
3
3
All notable changes to this project will be documented in this file, in reverse chronological order by release.
4
4
5
+
## 2.0.0-alpha.3 - TBD
6
+
7
+
### Added
8
+
9
+
-[#8](https://github.com/zendframework/zend-coding-standard/pull/8) adds some sniffs from webimpress/coding-standard.
10
+
11
+
- Forbid null values for class properties
12
+
- Comments at the end of the line, with at least single space
13
+
- Requires one space after namespace keyword
14
+
- One space after break/continue with argument, remove redundant 1
15
+
- Forbid continue in switch; use break instead
16
+
- Require camelCase variable names
17
+
- Detects for-loops that can be simplified to a while-loop
18
+
- Detects unconditional if- and elseif-statements
19
+
- Forbid goto instruction
20
+
- Forbid multiple traits by declaration
21
+
- Require lowercase function and const keywords in imports with one space after
22
+
- Forbid superfluous leading backslash in use statements
23
+
- Forbid whitespace around double colon operator
24
+
- Forbid whitespace around double colon operator
25
+
26
+
### Changed
27
+
28
+
-[#8](https://github.com/zendframework/zend-coding-standard/pull/8) replaces sniffs in favor of webimpress/coding-standard as these are more reliable or fixes more cases.
- Comment tags `@param`, `@throws` and `@return` should not be aligned or contain multiple spaces between the tag,
81
+
- Comment tags `@param`, `@throws` and `@return` should not be aligned or contain multiple spaces between the tag,
82
82
type and description. [*](ruleset.md#squizcommentingfunctioncomment)
83
83
- If a function throws any exceptions, they should be documented in `@throws` tags.
84
84
[*](ruleset.md#squizcommentingfunctioncomment)
@@ -93,12 +93,12 @@ In addition to [PSR-12](https://github.com/php-fig/fig-standards/blob/master/pro
93
93
- Each PHP file should have a page level docblock with `@see`, `@copyright` and `@license`. The copyright date should
94
94
only be adjusted if the file has changed.
95
95
- Each PHP file should have a strict type declaration at the top after the page level docblock. [*](ruleset.md#slevomatcodingstandardtypehintsdeclarestricttypes)
96
-
- Import statements should be alphabetically sorted. [*](ruleset.md#slevomatcodingstandardnamespacesalphabeticallysorteduses)
96
+
- Import statements should be alphabetically sorted. [*](ruleset.md#webimpresscodingstandardphpinstantiatingparenthesis)
97
97
- Import statements should not be grouped. [*](ruleset.md#slevomatcodingstandardnamespacesdisallowgroupuse)
98
98
- Each import statement should be on its own line. [*](ruleset.md#slevomatcodingstandardnamespacesmultipleusesperline)
99
99
- Absolute class name references, functions and constants should be imported. [*](ruleset.md#slevomatcodingstandardnamespacesreferenceusednamesonly)
100
-
- Unused import statements are not allowed. [*](ruleset.md#slevomatcodingstandardnamespacesunuseduses)
101
-
- Classes and function within the same namespace should not be imported. [*](ruleset.md#slevomatcodingstandardnamespacesusefromsamenamespace)
100
+
- Unused import statements are not allowed. [*](ruleset.md#webimpresscodingstandardnamespacesunusedusestatement)
101
+
- Classes and function within the same namespace should not be imported. [*](ruleset.md#webimpresscodingstandardnamespacesunusedusestatement)
102
102
- Imports should not have an alias with the same name. [*](ruleset.md#slevomatcodingstandardnamespacesuselessalias)
103
103
- A class should not have unused private constants, (or write-only) properties and methods. [*](ruleset.md#slevomatcodingstandardclassesunusedprivateelements)
104
104
@@ -137,10 +137,10 @@ class FooBar
137
137
138
138
In addition to [PSR-12](https://github.com/php-fig/fig-standards/blob/master/proposed/extended-coding-style-guide.md#4-classes-properties-and-methods):
139
139
140
-
- Class name resolution via `::class` should be used instead of `__CLASS__`, `get_class()`, `get_class($this)`,
140
+
- Class name resolution via `::class` should be used instead of `__CLASS__`, `get_class()`, `get_class($this)`,
141
141
`get_called_class()` and `get_parent_class()`. [*](ruleset.md#slevomatcodingstandardclassesmodernclassnamereference)
142
142
- Methods may not have the final declaration in classes declared as final. [*](ruleset.md#genericcodeanalysisunnecessaryfinalmodifier)
143
-
- The colon used with return type declarations MUST be surrounded with 1 space. [*](ruleset.md#slevomatcodingstandardtypehintsreturntypehintspacing)
143
+
- The colon used with return type declarations MUST be surrounded with 1 space. [*](ruleset.md#webimpresscodingstandardformattingreturntype)
144
144
- Nullable and optional arguments, which are marked as `= null`, must have the `?` symbol present. [*](ruleset.md#slevomatcodingstandardtypehintsnullabletypefornulldefaultvalue)
public function fooBarBaz(int $arg1, &$arg2, array $arg3 = [], ?$arg4 = null) : void
167
167
{
168
168
return;
169
169
}
170
-
170
+
171
171
public function aVeryLongMethodName(
172
172
FirstInterface $arg1,
173
173
&$arg2,
@@ -367,7 +367,7 @@ $instance = new class extends Foo implements
367
367
- Short list syntax `[...]` should be used instead of `list(...)`. [*](ruleset.md#slevomatcodingstandardphpshortlist)
368
368
- Short form of type keywords must be used. i.e. `bool` instead of `boolean`, `int` instead of `integer`, etc.
369
369
The `binary` and `unset` cast operators are not allowed. [*](ruleset.md#slevomatcodingstandardphptypecast)
370
-
- Parentheses should not be used if they can be omitted. [*](ruleset.md#slevomatcodingstandardphpuselessparentheses)
370
+
- Parentheses should not be used if they can be omitted. [*](ruleset.md#webimpresscodingstandardformattingunnecessaryparentheses)
371
371
- Semicolons `;` should not be used if they can be omitted. [*](ruleset.md#slevomatcodingstandardphpuselesssemicolon)
372
372
- Variables should be returned directly instead of assigned to a variable which is not used. [*](ruleset.md#slevomatcodingstandardvariablesuselessvariable)
373
373
- The `self` keyword should be used instead of the current class name, and should not have spaces around `::`.
@@ -376,8 +376,8 @@ $instance = new class extends Foo implements
376
376
- Double quote strings may only be used if they contain variables. [*](ruleset.md#squizstringsdoublequoteusage)
377
377
- Strings should not be enclosed in parentheses when being echoed. [*](ruleset.md#squizstringsechoedstrings)
378
378
- Type casts should not have whitespace inside the parentheses. [*](ruleset.md#squizwhitespacecastspacing)
379
-
- The opening brace for functions should be on a new line with no blank lines surrounding it. [*](ruleset.md#squizwhitespacefunctionopeningbracespace)
380
-
- The PHP constructs `echo`, `print`, `return`, `include`, `include_once`, `require`, `require_once`, and `new`, should
379
+
- The opening brace for functions should be on a new line with no blank lines surrounding it. [*](ruleset.md#webimpresscodingstandardwhitespacebraceblankline)
380
+
- The PHP constructs `echo`, `print`, `return`, `include`, `include_once`, `require`, `require_once`, and `new`, should
381
381
have one space after them. [*](ruleset.md#squizwhitespacelanguageconstructspacing)
382
382
- The object operator `->` should not have any spaces around it. [*](ruleset.md#squizwhitespaceobjectoperatorspacing)
383
383
- Semicolons should not have spaces before them. [*](ruleset.md#squizwhitespacesemicolonspacing)
0 commit comments