Closed
Description
Currently relative class names are used in PHPDoc type hints.
/**
* @param array|ArrayAccess $array
*/
When it is used it becomes like this:
<?php
namespace MyVendor\MyProject\Tests\_generated;
// This class was automatically generated by build task
// You should not change it manually as it will be overwritten on next build
// @codingStandardsIgnoreFile
trait UnitTesterActions
{
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Asserts that an array has a specified key.
*
* @param int|string $key
* @param array|ArrayAccess $array
* @see \Codeception\Module\AbstractAsserts::assertArrayHasKey()
*/
public function assertArrayHasKey($key, $array, string $message = "") {
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertArrayHasKey', func_get_args()));
}
}
☝️ it is still relative.
Using the ::assertArrayHasKey()
trough the tester:
$this->tester->assertArrayHasKey('foo', $myArrayOrArrayAccess);
PHPStorm highlights this line with an error, because:
Expected parameter of type 'array|\MyVendor\MyProject\Tests\_generated\ArrayAccess', '\MyVendor\MyProject\Foo' provided.
Recommended soulution
Use Fully Qualified Names for classes, traits and interfaces in PHPDoc type hints.
Metadata
Metadata
Assignees
Labels
No labels