| Conditions | 4 |
| Paths | 25 |
| Total Lines | 25 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | public function getSasUrl(Request $request, SignUploadListener $listener, $disk = 'libraries') |
||
| 32 | { |
||
| 33 | try { |
||
| 34 | $blobUri = $request->input('bloburi'); |
||
| 35 | $method = $request->input('_method'); |
||
| 36 | $permissions = '' ; |
||
| 37 | if (strtolower($method) === 'put') { |
||
| 38 | $permissions = 'w'; |
||
| 39 | } else if (strtolower($method) === 'delete') { |
||
| 40 | $permissions = 'd'; |
||
| 41 | } |
||
| 42 | |||
| 43 | $this->blobSharedAccessSignatureHelper = new BlobSharedAccessSignatureHelper( |
||
|
|
|||
| 44 | $this->config->get('filesystems.disks.' . $disk . '.name'), |
||
| 45 | $this->config->get('filesystems.disks.' . $disk . '.key') |
||
| 46 | ); |
||
| 47 | |||
| 48 | $now = new DateTime("now", new DateTimeZone("UTC")); |
||
| 49 | $expire = $now->modify('+15 min'); |
||
| 50 | |||
| 51 | $path = $this->config->get('filesystems.disks.' . $disk .'.container') . str_replace(azureEndpoint($disk), '', $blobUri); |
||
| 52 | $sasUrl = $blobUri . '?' . $this->blobSharedAccessSignatureHelper->generateBlobServiceSharedAccessSignatureToken('b', $path, $permissions, $expire); |
||
| 53 | return $listener->uploadIsSigned($sasUrl, false); |
||
| 54 | } catch (\Exception $e) { |
||
| 55 | return $listener->uploadIsNotValid(); |
||
| 56 | } |
||
| 59 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..