Skip to content

Commit

Permalink
Update update_copyright in RoboFile
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvinmo committed Mar 24, 2024
1 parent fec69ba commit 91f965c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions RoboFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

/**
Expand Down

0 comments on commit 91f965c

Please sign in to comment.