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

[CodingStandard] Add anntotation new-line indent rule #2078

Merged
merged 4 commits into from
Aug 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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