Skip to content

Commit

Permalink
Merge pull request #16 from nette/spaces-test
Browse files Browse the repository at this point in the history
spaces between constants, properties and first method
  • Loading branch information
Tomáš Votruba committed Sep 26, 2017
2 parents c00f0d0 + ae2426d commit ecff17f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 4 deletions.
8 changes: 8 additions & 0 deletions coding-standard-php56.neon
Expand Up @@ -143,6 +143,14 @@ checkers:
Nette\CodingStandard\Fixer\ClassNotation\ClassAndTraitVisibilityRequiredFixer: Nette\CodingStandard\Fixer\ClassNotation\ClassAndTraitVisibilityRequiredFixer:
elements: [property, method] elements: [property, method]


# Constants and Properties should be separated by 1 space
Symplify\CodingStandard\Fixer\ClassNotation\PropertyAndConstantSeparationFixer:
space_count: 1

# Last property and 1st method should be separated by 2 spaces
Symplify\CodingStandard\Fixer\ClassNotation\LastPropertyAndFirstMethodSeparationFixer:
space_count: 2

# Control Statements - https://nette.org/en/coding-standard#toc-control-statements # Control Statements - https://nette.org/en/coding-standard#toc-control-statements


# The keyword `elseif` should be used instead of `else if` so that all control keywords look like single words. # The keyword `elseif` should be used instead of `else if` so that all control keywords look like single words.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -3,7 +3,7 @@
"license": "MIT", "license": "MIT",
"require": { "require": {
"php": "^7.1", "php": "^7.1",
"symplify/easy-coding-standard": "^2.3" "symplify/easy-coding-standard": "^2.4"
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
Expand Down
5 changes: 2 additions & 3 deletions examples/ValidClass.php
Expand Up @@ -6,9 +6,8 @@


class ValidClass class ValidClass
{ {
public const JOY_COUNT = 5; protected const CHILD_COUNT = 1,

HOUSE_COUNT = 10; // allow comment
protected const CHILD_COUNT = 1;


private const DREAM_COUNT = 250; private const DREAM_COUNT = 250;


Expand Down
15 changes: 15 additions & 0 deletions examples/ValidPropertyAndMethodSpacing.php
@@ -0,0 +1,15 @@
<?php
declare(strict_types=1);

namespace Nette\CodingStandard\Examples;


class ValidPropertyAndMethodSpacing
{
private $var;


public function __construct()
{
}
}

0 comments on commit ecff17f

Please sign in to comment.