| Conditions | 1 |
| Paths | 1 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 1 |
| CRAP Score | 1.6296 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | 1 | public function getSongPublicUrl(Song $song): string |
|
| 21 | { |
||
| 22 | return $this->cache->remember("OSUrl/{$song->id}", 60, function () use ($song): string { |
||
| 23 | $cmd = $this->s3Client->getCommand('GetObject', [ |
||
|
|
|||
| 24 | 'Bucket' => $song->s3_params['bucket'], |
||
| 25 | 'Key' => $song->s3_params['key'], |
||
| 26 | ]); |
||
| 27 | |||
| 28 | // Here we specify that the request is valid for 1 hour. |
||
| 29 | // We'll also cache the public URL for future reuse. |
||
| 30 | $request = $this->s3Client->createPresignedRequest($cmd, '+1 hour'); |
||
| 31 | $url = (string) $request->getUri(); |
||
| 32 | |||
| 33 | return $url; |
||
| 34 | 1 | }); |
|
| 37 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.