| Conditions | 4 |
| Paths | 2 |
| Total Lines | 20 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | public function setUp() |
||
| 20 | { |
||
| 21 | $key = getenv('AWS_KEY'); |
||
| 22 | $secret = getenv('AWS_SECRET'); |
||
| 23 | $region = getenv('AWS_REGION'); |
||
| 24 | |||
| 25 | if (empty($key) || empty($secret)) { |
||
| 26 | $this->markTestSkipped('Missing AWS_KEY and/or AWS_SECRET env vars.'); |
||
|
|
|||
| 27 | } |
||
| 28 | |||
| 29 | $this->bucket = uniqid(getenv('AWS_BUCKET')); |
||
| 30 | $this->client = new S3Client([ |
||
| 31 | 'region' => $region ? $region : 'eu-west-1', |
||
| 32 | 'version' => 'latest', |
||
| 33 | 'credentials' => [ |
||
| 34 | 'key' => $key, |
||
| 35 | 'secret' => $secret, |
||
| 36 | ], |
||
| 37 | ]); |
||
| 38 | } |
||
| 39 | |||
| 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.