From 7c297e89ea82b84a0584b282ce595af07b8a3e2d Mon Sep 17 00:00:00 2001 From: Claudiu Cristea Date: Sun, 26 May 2024 13:30:41 +0200 Subject: [PATCH] Trait to check if a given context is allowed in git_stage --- src/Task/GitContextTrait.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/Task/GitContextTrait.php diff --git a/src/Task/GitContextTrait.php b/src/Task/GitContextTrait.php new file mode 100644 index 00000000..4dc1fe36 --- /dev/null +++ b/src/Task/GitContextTrait.php @@ -0,0 +1,23 @@ + 'pre-commit', + $context instanceof GitPrePushContext => 'pre-push', + default => null, + }; + return in_array($gitStage, $this->getConfig()->getMetadata()->gitStages(), true); + } +}