| Conditions | 4 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 40 | public function tearDown() |
||
| 41 | { |
||
| 42 | if ($this->client === null || !$this->client->doesBucketExist($this->bucket)) { |
||
| 43 | return; |
||
| 44 | } |
||
| 45 | |||
| 46 | $result = $this->client->listObjects(['Bucket' => $this->bucket]); |
||
| 47 | $staleObjects = $result->get('Contents'); |
||
| 48 | |||
| 49 | foreach ($staleObjects as $staleObject) { |
||
| 50 | $this->client->deleteObject(['Bucket' => $this->bucket, 'Key' => $staleObject['Key']]); |
||
| 51 | } |
||
| 52 | |||
| 53 | $this->client->deleteBucket(['Bucket' => $this->bucket]); |
||
| 54 | } |
||
| 55 | } |
||
| 56 |
This check looks for methods that are used by a trait but not required by it.
To illustrate, let’s look at the following code example
The trait
Idableprovides a methodequalsIdthat in turn relies on the methodgetId(). If this method does not exist on a class mixing in this trait, the method will fail.Adding the
getId()as an abstract method to the trait will make sure it is available.