diff --git a/ecs.php b/ecs.php index 0a1526b..dcbd9ef 100644 --- a/ecs.php +++ b/ecs.php @@ -58,7 +58,8 @@ ForbiddenFunctionsSniff::class => [ 'tests/**', 'console/**' - ] + ], + 'tests/_support/_generated' ]); // $ecsConfig->skip([ diff --git a/src/Codeception/Lib/Connector/Yii2.php b/src/Codeception/Lib/Connector/Yii2.php index 8be068c..80af9d7 100644 --- a/src/Codeception/Lib/Connector/Yii2.php +++ b/src/Codeception/Lib/Connector/Yii2.php @@ -222,10 +222,7 @@ public function getInternalDomains(): array $domains = [$this->getDomainRegex($urlManager->hostInfo)]; if ($urlManager->enablePrettyUrl) { foreach ($urlManager->rules as $rule) { - /** - * @var \yii\web\UrlRule $rule - */ - if ($rule->host !== null) { + if (isset($rule->host)) { $domains[] = $this->getDomainRegex($rule->host); } } diff --git a/tests/Yii.stub b/tests/Yii.stub index bbfd44a..87cd9aa 100644 --- a/tests/Yii.stub +++ b/tests/Yii.stub @@ -95,4 +95,12 @@ namespace yii\web { public function setScriptFile($path): void {} } + interface UrlRuleInterface{} + class UrlManager { + /** + * @var UrlRuleInterface[] $rules; + */ + public array $rules = []; + } + }