This class seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
11
{
12
13
/**
14
* @var websiteMapper
15
*/
16
protected $websiteMapper;
17
18
/**
19
* @var UserServiceOptionsInterface
20
*/
21
protected $options;
22
23
/**
24
*
25
* @var ServiceManager
26
*/
27
protected $serviceLocator;
28
29
public function __construct(ServiceLocatorInterface $locator)
$locator is of type object<Zend\ServiceManag...erviceLocatorInterface>, but the property $serviceLocator was declared to be of type object<Zend\ServiceManager\ServiceManager>. Are you sure that you always receive this specific sub-class here, or does it make sense to add an instanceof check?
Our type inference engine has found a suspicous assignment of a value to a property.
This check raises an issue when a value that can be of a given class or a super-class
is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.
It seems like $this->serviceLocator->g...ndcore_website_mapper') can also be of type array. However, the property $websiteMapper is declared as type object<PlaygroundCore\Service\websiteMapper>. Maybe add an additional type check?
Our type inference engine has found a suspicous assignment of a value to a property.
This check raises an issue when a value that can be of a mixed type is assigned to
a property that is type hinted more strictly.
For example, imagine you have a variable $accountId that can either hold an
Id object or false (if there is no account id yet). Your code now assigns that
value to the id property of an instance of the Account class. This class
holds a proper account, so the id value must no longer be false.
Either this assignment is in error or a type check should be added for that assignment.
classId{public$id;publicfunction__construct($id){$this->id=$id;}}classAccount{/** @var Id $id */public$id;}$account_id=false;if(starsAreRight()){$account_id=newId(42);}$account=newAccount();if($accountinstanceofId){$account->id=$account_id;}
The expression $this->websiteMapper; of type object|array adds the type array to the return on line 45 which is incompatible with the return type documented by PlaygroundCore\Service\Website::getWebsiteMapper of type PlaygroundCore\Service\websiteMapper.
The doc-type Mapper/Website could not be parsed: Unknown type name "Mapper/Website" at position 0. (view supported doc-types)
This check marks PHPDoc comments that could not be parsed by our parser. To see
which comment annotations we can parse, please refer to our documentation on
supported doc-types.
It seems like $options of type object<PlaygroundCore\Options\ModuleOptions> is incompatible with the declared type object<PlaygroundCore\Se...erviceOptionsInterface> of property $options.
Our type inference engine has found an assignment to a property that is incompatible
with the declared type of that property.
Either this assignment is in error or the assigned type should be added
to the documentation/type hint for that property..
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.