Conditions | 1 |
Paths | 1 |
Total Lines | 19 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | public function handle() |
||
14 | { |
||
15 | $titles = ['Number', 'Projector', 'Last processed event id', 'Created at', 'Name']; |
||
16 | |||
17 | $rows = $this->snapshotRepository->get()->map(function (Snapshot $snapshot) { |
||
|
|||
18 | static $number = 0; |
||
19 | return [ |
||
20 | $number++, |
||
21 | $snapshot->projectorName(), |
||
22 | $snapshot->lastProcessedEventId(), |
||
23 | $snapshot->createdAt(), |
||
24 | $snapshot->name(), |
||
25 | ]; |
||
26 | }); |
||
27 | |||
28 | $this->table($titles, $rows); |
||
29 | |||
30 | $snapshotNumber = $this->ask('Which snapshot would you like to delete?'); |
||
31 | } |
||
32 | } |
||
33 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: