File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,12 +45,12 @@ public function check(array &$errors = null):int {
4545 */
4646 public function build (array &$ errors = null ):array {
4747 $ updatedTasks = [];
48- foreach ($ this ->taskList as $ pathMatch => $ task ) {
48+ foreach ($ this ->taskList as $ task ) {
4949 if ($ task ->build ($ errors )) {
5050 $ updatedTasks []= $ task ;
5151 }
5252 }
5353
5454 return $ updatedTasks ;
5555 }
56- }
56+ }
Original file line number Diff line number Diff line change @@ -57,20 +57,23 @@ public function check(array &$errors = null):void {
5757 }
5858
5959 public function build (array &$ errors = null ):bool {
60- $ changes = false ;
60+ $ hashMiss = false ;
6161
6262 foreach (Glob::glob ($ this ->absolutePath ) as $ matchedPath ) {
6363 $ hash = filemtime ($ matchedPath );
6464 $ existingHash = $ this ->fileHashList [$ matchedPath ] ?? null ;
6565
6666 if ($ hash !== $ existingHash ) {
67- $ changes = $ this -> execute ( $ errors ) ;
67+ $ hashMiss = true ;
6868 }
6969
7070 $ this ->fileHashList [$ matchedPath ] = $ hash ;
7171 }
7272
73- return $ changes ;
73+ if ($ hashMiss ) {
74+ return $ this ->execute ($ errors );
75+ }
76+ return false ;
7477 }
7578
7679 public function requirementFromRequireBlockItem (
@@ -160,4 +163,4 @@ protected function isAbsolutePath(string $path):bool {
160163 // Windows:
161164 || preg_match ('~\A[A-Z]:(?![^/ \\\\])~i ' ,$ path ) > 0 ;
162165 }
163- }
166+ }
You can’t perform that action at this time.
0 commit comments