Skip to content

Commit

Permalink
remove rule doc examples, as description is good enough for 12 rules
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Jul 25, 2023
1 parent 8026635 commit 4ed99b1
Show file tree
Hide file tree
Showing 14 changed files with 12 additions and 559 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,3 @@ composer require symplify/easy-coding-standard --dev
return static function (ECSConfig $ecsConfig): void {
+ $ecsConfig->sets([SetList::SYMPLIFY]);
```

## Rules Overview

- [Rules Overview](/docs/rules_overview.md)
7 changes: 2 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@
"require": {
"php": ">=8.1",
"nette/utils": "^3.2",
"friendsofphp/php-cs-fixer": "^3.18",
"symplify/rule-doc-generator-contracts": "^11.1"
"friendsofphp/php-cs-fixer": "^3.22"
},
"require-dev": {
"symplify/easy-coding-standard": "^12.0.1",
"squizlabs/php_codesniffer": "^3.7.2",
"phpunit/phpunit": "^10.2",
"symplify/rule-doc-generator": "^11.2",
"php-parallel-lint/php-parallel-lint": "^1.3",
"phpstan/extension-installer": "^1.3",
"phpstan/phpstan": "^1.10.26",
Expand Down Expand Up @@ -42,7 +40,6 @@
"check-cs": "vendor/bin/ecs check --ansi",
"fix-cs": "vendor/bin/ecs check --fix --ansi",
"phpstan": "vendor/bin/phpstan analyse --ansi --error-format symplify",
"rector": "vendor/bin/rector process --dry-run --ansi",
"docs": "vendor/bin/rule-doc-generator generate src --output-file docs/rules_overview.md --ansi"
"rector": "vendor/bin/rector process --dry-run --ansi"
}
}
243 changes: 0 additions & 243 deletions docs/rules_overview.md

This file was deleted.

30 changes: 1 addition & 29 deletions src/Fixer/Annotation/RemovePHPStormAnnotationFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,11 @@
use SplFileInfo;
use Symplify\CodingStandard\Fixer\AbstractSymplifyFixer;
use Symplify\CodingStandard\TokenRunner\Traverser\TokenReverser;
use Symplify\RuleDocGenerator\Contract\DocumentedRuleInterface;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;

/**
* @see \Symplify\CodingStandard\Tests\Fixer\Annotation\RemovePHPStormAnnotationFixer\RemovePHPStormAnnotationFixerTest
*/
final class RemovePHPStormAnnotationFixer extends AbstractSymplifyFixer implements DocumentedRuleInterface
final class RemovePHPStormAnnotationFixer extends AbstractSymplifyFixer
{
/**
* @see https://regex101.com/r/nGZBzj/2
Expand Down Expand Up @@ -72,29 +69,4 @@ public function fix(SplFileInfo $fileInfo, Tokens $tokens): void
$tokens->clearAt($index);
}
}

public function getRuleDefinition(): RuleDefinition
{
return new RuleDefinition(self::ERROR_MESSAGE, [
new CodeSample(
<<<'CODE_SAMPLE'
/**
* Created by PhpStorm.
* User: ...
* Date: 17/10/17
* Time: 8:50 AM
*/
class SomeClass
{
}
CODE_SAMPLE
,
<<<'CODE_SAMPLE'
class SomeClass
{
}
CODE_SAMPLE
),
]);
}
}
21 changes: 1 addition & 20 deletions src/Fixer/ArrayNotation/ArrayListItemNewlineFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,11 @@
use Symplify\CodingStandard\TokenRunner\Arrays\ArrayItemNewliner;
use Symplify\CodingStandard\TokenRunner\Traverser\ArrayBlockInfoFinder;
use Symplify\CodingStandard\TokenRunner\ValueObject\TokenKinds;
use Symplify\RuleDocGenerator\Contract\DocumentedRuleInterface;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;

/**
* @see \Symplify\CodingStandard\Tests\Fixer\ArrayNotation\ArrayListItemNewlineFixer\ArrayListItemNewlineFixerTest
*/
final class ArrayListItemNewlineFixer extends AbstractSymplifyFixer implements DocumentedRuleInterface
final class ArrayListItemNewlineFixer extends AbstractSymplifyFixer
{
/**
* @var string
Expand Down Expand Up @@ -71,20 +68,4 @@ public function fix(SplFileInfo $fileInfo, Tokens $tokens): void
$this->arrayItemNewliner->fixArrayOpener($tokens, $arrayBlockInfo);
}
}

public function getRuleDefinition(): RuleDefinition
{
return new RuleDefinition(self::ERROR_MESSAGE, [
new CodeSample(
<<<'CODE_SAMPLE'
$value = ['simple' => 1, 'easy' => 2];
CODE_SAMPLE
,
<<<'CODE_SAMPLE'
$value = ['simple' => 1,
'easy' => 2];
CODE_SAMPLE
),
]);
}
}
22 changes: 1 addition & 21 deletions src/Fixer/ArrayNotation/ArrayOpenerAndCloserNewlineFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,11 @@
use Symplify\CodingStandard\TokenRunner\Traverser\ArrayBlockInfoFinder;
use Symplify\CodingStandard\TokenRunner\ValueObject\TokenKinds;
use Symplify\CodingStandard\ValueObject\BlockInfoMetadata;
use Symplify\RuleDocGenerator\Contract\DocumentedRuleInterface;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;

/**
* @see \Symplify\CodingStandard\Tests\Fixer\ArrayNotation\ArrayOpenerAndCloserNewlineFixer\ArrayOpenerAndCloserNewlineFixerTest
*/
final class ArrayOpenerAndCloserNewlineFixer extends AbstractSymplifyFixer implements DocumentedRuleInterface
final class ArrayOpenerAndCloserNewlineFixer extends AbstractSymplifyFixer
{
/**
* @var string
Expand Down Expand Up @@ -52,23 +49,6 @@ public function getPriority(): int
return 34;
}

public function getRuleDefinition(): RuleDefinition
{
return new RuleDefinition(self::ERROR_MESSAGE, [
new CodeSample(
<<<'CODE_SAMPLE'
$items = [1 => 'Hey'];
CODE_SAMPLE
,
<<<'CODE_SAMPLE'
$items = [
1 => 'Hey'
];
CODE_SAMPLE
),
]);
}

/**
* @param Tokens<Token> $tokens
*/
Expand Down
Loading

0 comments on commit 4ed99b1

Please sign in to comment.