__DIR__ . '/../vendor-prefixed/gregwar/captcha/src/Gregwar/Captcha/CaptchaBuilder.php', 'find' => [ 'protected $backgroundColor = null;' . "\n" . ' /**', ], 'replace' => [ 'protected $backgroundColor = null;' . PHP_EOL . ' protected $background = null;' . PHP_EOL . ' /**', ], ], ]; // 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); }