-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
Description
Bug report
We're using PHPStan 0.12.14 and this issue appeared recently, basically PHPStan errors out with hundred of errors like:
Could not read file: callout.php
And we cannot find out what exactly is causing it, if you take a look bellow, 'callout' is just one of the array keys. Why PHPStan picks that one in particular, i have no idea.
Code snippet that reproduces the problem
public function run()
{
// update old layouts
$models = ListPageType::model()->findAll();
$searchReplace = [
'panel panel-default' => 'box box-primary borderless',
'panel-heading' => 'box-header',
'panel-title' => 'box-title',
'panel-body' => 'box-body',
'callout' => 'callout callout-info',
'panel-footer' => 'box-footer',
'panel-' => 'box-',
'@import url(\'http://fonts.googleapis.com/css?family=Open+Sans\');' => '',
'@import url(\'http://fonts.googleapis.com/css?family=Noto+Sans:700italic\');' => '',
'#b94a48' => '#367fa9',
'\'Open Sans\',' => '',
'\'Noto Sans\',' => '',
];
foreach ($models as $model) {
$model->content = str_replace(array_keys($searchReplace), array_values($searchReplace), $model->content);
$model->save(false);
}
/** @var OptionEmailTemplate $optionEmailTemplate */
$optionEmailTemplate = container()->get(OptionEmailTemplate::class);
$common = str_replace('#b94a48', '#367fa9', $optionEmailTemplate->common);
$optionEmailTemplate->saveAttributes(['common' => $common]);
// end update
}Expected output
We're expecting PHPStan to show no error, at least not an error related to loading a file based on a defined array key.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels