-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NGGW-94 rename class, extend list of default extensions, refactor dup…
…licated function
- Loading branch information
Marijan Klaric
committed
Mar 6, 2023
1 parent
a9a1c1a
commit 9157fea
Showing
3 changed files
with
16 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,4 +45,17 @@ private function isEnabled(ActionConfig $action): bool | |
{ | ||
return $action->getOptions()->get('enabled', true); | ||
} | ||
|
||
public function getChangedFiles(Config\Action $action, Repository $repository): array | ||
This comment has been minimized.
Sorry, something went wrong. |
||
{ | ||
$excludedFiles = $action->getOptions()->get('excluded_files'); | ||
$extensions = $action->getOptions()->get('extensions', ['php', 'twig']); | ||
This comment has been minimized.
Sorry, something went wrong.
emodric
Member
|
||
|
||
$changedFiles = []; | ||
foreach ($extensions as $extension) { | ||
$changedFiles = [...$changedFiles, ...$repository->getIndexOperator()->getStagedFilesOfType($extension)]; | ||
} | ||
|
||
return array_diff($changedFiles, $excludedFiles); | ||
} | ||
} |
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
Should be protected.