1 | <?php |
||
19 | class TicketService implements |
||
20 | JiraTicketMappedEventAware, |
||
21 | BitbucketTicketMappedEventAware, |
||
22 | TicketDirIndexedEventAware |
||
23 | { |
||
24 | /** @var array */ |
||
25 | private $jiraData; |
||
26 | |||
27 | /** @var array */ |
||
28 | private $bitBucketData; |
||
29 | |||
30 | /** @var array */ |
||
31 | private $dirData; |
||
32 | |||
33 | /** @var TicketBuilder */ |
||
34 | private $builder; |
||
35 | |||
36 | /** @var Ticket */ |
||
37 | private $ticket; |
||
38 | |||
39 | /** @var EventDispatcherInterface */ |
||
40 | private $dispatcher; |
||
41 | |||
42 | /** @var LoggerInterface */ |
||
43 | private $logger; |
||
44 | |||
45 | /** @var bool */ |
||
46 | private $jiraCompleted; |
||
47 | |||
48 | /** @var bool */ |
||
49 | private $bbCompleted; |
||
50 | |||
51 | /** @var bool */ |
||
52 | private $dirCompleted; |
||
53 | |||
54 | /** @var int */ |
||
55 | private $parts; |
||
56 | |||
57 | /** @var int */ |
||
58 | private $currentId; |
||
59 | |||
60 | 1 | public function __construct( |
|
73 | |||
74 | /** |
||
75 | * Uses data array passed in event to build BitBucket part of ticket. |
||
76 | */ |
||
77 | 1 | public function onBitbucketTicketMapped(BitbucketTicketMappedEvent $event) : void |
|
88 | |||
89 | /** |
||
90 | * Uses data array passed in event to build JIRA part of ticket. |
||
91 | */ |
||
92 | 1 | public function onJiraTicketMapped(JiraTicketMappedEvent $event) : void |
|
101 | |||
102 | /** |
||
103 | * Uses data array passed in event to build part of ticket with local directory info. |
||
104 | */ |
||
105 | 1 | public function onTicketDirIndexed(TicketDirIndexedEvent $event) : void |
|
114 | |||
115 | /** |
||
116 | * Calls ticketIsComplete method. |
||
117 | * Then calls getTicket method if true returned. |
||
118 | */ |
||
119 | 1 | private function buildTicket() : void |
|
125 | |||
126 | /** |
||
127 | * Logs how many parts of ticket are already ready. |
||
128 | */ |
||
129 | 1 | private function printCompletionInfo() : void |
|
141 | |||
142 | /** |
||
143 | * Checks whether all 3 parts of ticket were built. |
||
144 | */ |
||
145 | 1 | private function ticketIsComplete() : bool |
|
149 | |||
150 | /** |
||
151 | * Gets ticket from ticket builder when all parts are complete. |
||
152 | */ |
||
153 | 1 | private function getTicket() : void |
|
169 | } |
||
170 |
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 theid
property of an instance of theAccount
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.