Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add fixing of "Classes.ClassDeclaration" sniff
- removed redundant code for checking that class closing brace is on it's own line - also test the case, when there are too many empty lines after class declaration
- Loading branch information
Alexander Obuhovich
committed
Oct 12, 2014
1 parent
235bf06
commit da60ac3
Showing
4 changed files
with
191 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -119,6 +119,8 @@ interface MyInterface extends | |
{ | ||
} | ||
|
||
|
||
|
||
class SomeClass | ||
{ | ||
|
||
|
127 changes: 127 additions & 0 deletions
127
CodingStandard/Tests/Classes/ClassDeclarationUnitTest.inc.fixed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
<?php | ||
class ClassName extends ParentClass implements \ArrayAccess, \Countable | ||
{ | ||
// constants, properties, methods | ||
} | ||
|
||
class ClassName extends ParentClass, AnotherParentClass implements \ArrayAccess, \Countable | ||
{ | ||
// constants, properties, methods | ||
} | ||
|
||
class ClassName extends ParentClass implements \ArrayAccess, \Countable | ||
{ | ||
// constants, properties, methods | ||
} | ||
|
||
class ClassName extends ParentClass implements | ||
\ArrayAccess, | ||
\Foo\Bar\Countable, | ||
\Serializable | ||
{ | ||
// constants, properties, methods | ||
|
||
} | ||
|
||
class ClassName extends ParentClass implements \ArrayAccess, | ||
\Countable, | ||
\Serializable | ||
{ | ||
// constants, properties, methods | ||
} | ||
|
||
class ClassName extends ParentClass implements | ||
\ArrayAccess, \Countable, \Foo\Serializable | ||
{ | ||
// constants, properties, methods | ||
} | ||
|
||
// Different indent | ||
if ($foo) { | ||
class ClassName extends ParentClass implements | ||
\ArrayAccess, | ||
\Countable, | ||
\Serializable | ||
{ | ||
// constants, properties, methods | ||
} | ||
|
||
} | ||
|
||
class Foo extends \Foo\Bar\Object | ||
{ | ||
} | ||
|
||
class ClassName extends ParentClass implements | ||
\Foo\Bar\Countable, | ||
\Serializable | ||
{ | ||
// constants, properties, methods | ||
} | ||
|
||
class ClassName extends ParentClass implements | ||
\Foo\Bar\Countable, | ||
\Serializable | ||
{ | ||
// constants, properties, methods | ||
} | ||
|
||
class Test | ||
{ | ||
public function test() { | ||
if (1) 1; | ||
1 ? (1 ? 1 : 1) : 1; | ||
} | ||
} | ||
|
||
class MyClass | ||
{ | ||
} | ||
|
||
class MyClass | ||
{ | ||
|
||
} | ||
|
||
class MyClass | ||
{ | ||
// Foo. | ||
} | ||
|
||
class MyClass | ||
{ | ||
// Foo. | ||
|
||
} | ||
|
||
abstract class Test implements | ||
TestInterface1, | ||
TestInterface2 | ||
{ | ||
} | ||
|
||
interface MyInterface extends LongInterfaceName1, LongInterfaceName2, LongInterfaceName3, LoginInterfaceName4 | ||
{ | ||
} | ||
|
||
interface MyInterface extends | ||
LongInterfaceName1, | ||
LongInterfaceName2, | ||
LongInterfaceName3, | ||
LoginInterfaceName4 | ||
{ | ||
} | ||
|
||
interface MyInterface extends | ||
LongInterfaceName1, | ||
LongInterfaceName2, | ||
LongInterfaceName3, | ||
{ | ||
} | ||
|
||
class SomeClass | ||
{ | ||
|
||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters