| Conditions | 4 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 52 | public function tearDown() |
||
| 53 | { |
||
| 54 | if ($this->client === null || !$this->client->doesBucketExist($this->bucket)) { |
||
| 55 | return; |
||
| 56 | } |
||
| 57 | |||
| 58 | $result = $this->client->listObjects(['Bucket' => $this->bucket]); |
||
| 59 | $staleObjects = $result->get('Contents'); |
||
| 60 | |||
| 61 | foreach ($staleObjects as $staleObject) { |
||
| 62 | $this->client->deleteObject(['Bucket' => $this->bucket, 'Key' => $staleObject['Key']]); |
||
| 63 | } |
||
| 64 | |||
| 65 | $this->client->deleteBucket(['Bucket' => $this->bucket]); |
||
| 66 | } |
||
| 67 | } |
||
| 68 |
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.