From 91f965c105031e8c008fb4c825f9409673a166f5 Mon Sep 17 00:00:00 2001 From: Kelvin Mo Date: Sun, 24 Mar 2024 14:40:38 +1100 Subject: [PATCH] Update update_copyright in RoboFile --- RoboFile.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/RoboFile.php b/RoboFile.php index 960e5f1..630c6ff 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -59,20 +59,21 @@ public function phar() { public function update_copyright() { $current_year = date('Y', time()); + $col = $this->collectionBuilder(); $finder = new Finder(); $finder->in(['src', 'bin'])->name('*.php')->append(['LICENSE.txt']); foreach($finder as $file) { - $this->taskReplaceInFile($file) + $col->taskReplaceInFile($file) ->regex('/Copyright \(C\) Kelvin Mo (\d{4})-(\d{4})(\R)/m') - ->to('Copyright (C) Kelvin Mo $1-'. $current_year . '$3') - ->run(); - $this->taskReplaceInFile($file) + ->to('Copyright (C) Kelvin Mo $1-'. $current_year . '$3'); + $col->taskReplaceInFile($file) ->regex('/Copyright \(C\) Kelvin Mo (\d{4})(\R)/m') - ->to('Copyright (C) Kelvin Mo $1-'. $current_year . '$2') - ->run(); + ->to('Copyright (C) Kelvin Mo $1-'. $current_year . '$2'); } + + return $col->run(); } /**