__DIR__ . '/../vendor/consolidation/robo/src/Common/CommandArguments.php', 'find' => [ '$this->arguments .= \' \' . implode(\' \', array_map(\'static::escape\', $args));', ], 'replace' => [ '$this->arguments .= \' \' . implode(\' \', array_map([static::class, \'escape\'], $args));', ], ], [ 'file' => __DIR__ . '/../vendor/consolidation/robo/src/Task/Base/Exec.php', 'find' => [ '$stopRunningJobs = Closure::fromCallable([\'self\', \'stopRunningJobs\']);', ], 'replace' => [ '$stopRunningJobs = Closure::fromCallable(self::class.\'::stopRunningJobs\');', ], ], ]; // Apply replacements foreach ($replacements as $singleFile) { $data = file_get_contents($singleFile['file']); $data = str_replace($singleFile['find'], $singleFile['replace'], $data); file_put_contents($singleFile['file'], $data); }