| Total Complexity | 3 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class SubAccountDeleteCommand extends AbstractCommand |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var string |
||
| 13 | */ |
||
| 14 | private $accountID; |
||
| 15 | |||
| 16 | protected function configure() |
||
| 17 | { |
||
| 18 | parent::configure(); |
||
| 19 | |||
| 20 | $this |
||
| 21 | ->setName('subaccount:delete') |
||
| 22 | ->addArgument('account-id', InputArgument::REQUIRED, 'sub account identifier') |
||
| 23 | ; |
||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @param InputInterface $input |
||
| 28 | * @param OutputInterface $output |
||
| 29 | */ |
||
| 30 | protected function initialize(InputInterface $input, OutputInterface $output) |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @param InputInterface $input |
||
| 39 | * @param OutputInterface $output |
||
| 40 | * |
||
| 41 | * @return int |
||
| 42 | */ |
||
| 43 | protected function execute(InputInterface $input, OutputInterface $output) |
||
| 46 | } |
||
| 47 | } |
||
| 48 |
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
$accountIdthat can either hold an Id object or false (if there is no account id yet). Your code now assigns that value to theidproperty of an instance of theAccountclass. 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.