Skip to content
This repository has been archived by the owner on Dec 3, 2023. It is now read-only.

Commit

Permalink
[CodingStandard] Add anntotation new-line indent rule (#2078)
Browse files Browse the repository at this point in the history
* [CodingStandard] Add anntotation new-line indent rule

* [CS] update README and prepare for split

* [CS] Split long god-README to smaller 3 files files - fixes, sniff and rules

* [rector] [CS] Split long god-README to smaller 3 files files - fixes, sniff and rules

Co-authored-by: rector-bot <[email protected]>
  • Loading branch information
TomasVotruba and rector-bot committed Sep 11, 2020
1 parent 2d112bd commit a690d66
Show file tree
Hide file tree
Showing 16 changed files with 1,646 additions and 1,278 deletions.
14 changes: 9 additions & 5 deletions ci/check_coding_standard_readme_sync.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ final class CodingStandardSyncChecker
/**
* @var string
*/
private const CODING_STANDARD_README_PATH = __DIR__ . '/../packages/coding-standard/README.md';
private const CODING_STANDARD_DOCS_GLOB_PATH = __DIR__ . '/../packages/coding-standard/*/**.md';

/**
* @see https://regex101.com/r/Unygf7/3/
Expand Down Expand Up @@ -69,12 +69,16 @@ public function run(): void
*/
private function resolveCheckerClassesInReadme(): array
{
$codingStandardReadmeContent = $this->smartFileSystem->readFile(self::CODING_STANDARD_README_PATH);
$checkerClassMatches = Strings::matchAll($codingStandardReadmeContent, self::CHECKER_CLASS_PATTERN);
$filePaths = glob(self::CODING_STANDARD_DOCS_GLOB_PATH);

$checkerClasses = [];
foreach ($checkerClassMatches as $checkerClassMatch) {
$checkerClasses[] = $checkerClassMatch['checker_class'];
foreach ($filePaths as $filePath) {
$docFileContent = $this->smartFileSystem->readFile($filePath);

$checkerClassMatches = Strings::matchAll($docFileContent, self::CHECKER_CLASS_PATTERN);
foreach ($checkerClassMatches as $checkerClassMatch) {
$checkerClasses[] = $checkerClassMatch['checker_class'];
}
}

$checkerClasses = array_unique($checkerClasses);
Expand Down
Loading

0 comments on commit a690d66

Please sign in to comment.