Conditions | 1 |
Paths | 1 |
Total Lines | 16 |
Code Lines | 10 |
Lines | 16 |
Ratio | 100 % |
Changes | 0 |
1 | <?php |
||
44 | View Code Duplication | public function displaySnapshots() |
|
45 | { |
||
46 | $titles = ['Number', 'Projector', 'Last processed event id', 'Created at', 'Name']; |
||
47 | |||
48 | $rows = $this->snapshots->map(function (Snapshot $snapshot, int $index) { |
||
49 | return [ |
||
50 | $index, |
||
51 | $snapshot->projectorName(), |
||
52 | $snapshot->lastProcessedEventId(), |
||
53 | $snapshot->createdAt(), |
||
54 | $snapshot->name(), |
||
55 | ]; |
||
56 | }); |
||
57 | |||
58 | $this->table($titles, $rows); |
||
59 | } |
||
60 | } |
||
61 |
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: