public function up()
{
$affectedFiles = array();
$allPathsAndFilenames = Files::readDirectoryRecursively($this->targetPackageData['path'], null, true);
foreach ($allPathsAndFilenames as $pathAndFilename) {
if (substr($pathAndFilename, -14) !== 'ViewHelper.php') {
continue;
}
$fileContents = file_get_contents($pathAndFilename);
if (preg_match('/\\$this->reflectionService/', $fileContents) === 1) {
$affectedFiles[] = substr($pathAndFilename, strlen($this->targetPackageData['path']) + 1);
}
}
if ($affectedFiles !== array()) {
$this->showWarning('Following ViewHelpers might use a removed ReflectionService dependency from AbstractViewHelper, please inject a ReflectionService instance yourself:' . PHP_EOL . PHP_EOL . '* ' . implode(PHP_EOL . '* ', $affectedFiles));
}
}