| Conditions | 1 |
| Paths | 1 |
| Total Lines | 8 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | protected function setup() |
||
| 12 | { |
||
| 13 | $this->client = $this->prophesize(Client::class); |
||
|
|
|||
| 14 | $this->writer = new BulkWriter($this->client->reveal(), ['_index' => 'foo']); |
||
| 15 | |||
| 16 | $this->reflection = new \ReflectionProperty(BulkWriter::class, 'items'); |
||
| 17 | $this->reflection->setAccessible(true); |
||
| 18 | } |
||
| 19 | |||
| 46 | } |
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: