Avoid variables with short names like $fs. Configured minimum length is 3.
Short variable names may make your code harder to understand. Variable names should
be self-descriptive. This check looks for variable names who are shorter than
a configured minimum.
Loading history...
30
31
62
public function __construct()
32
{
33
62
$this->fs = new Filesystem();
34
62
}
35
36
/**
37
* {@inheritdoc}
38
*/
39
58
public function setLogger(LoggerInterface $logger)
40
{
41
58
$this->output = $logger;
42
58
}
43
44
/**
45
* {@inheritdoc}
46
*/
47
14
public function setContainer(ContainerInterface $container = null)
It seems like $container can also be of type object<Symfony\Component...ion\ContainerInterface>. However, the property $container is declared as type object<Symfony\Component...ncyInjection\Container>. 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;}
Loading history...
50
14
}
51
52
/**
53
* Build the manager's internals after it's been configured.
Short variable names may make your code harder to understand. Variable names should be self-descriptive. This check looks for variable names who are shorter than a configured minimum.