automated phpcs fixes

This commit is contained in:
Dennis Eichhorn 2023-05-31 13:21:47 +00:00
parent 64f4920b36
commit d750f558ba
3 changed files with 30 additions and 16 deletions

View File

@ -1148,7 +1148,7 @@ final class ApiController extends Controller
$path = '../../../Temp/' . $randomName . '.' . $media->getExtension(); $path = '../../../Temp/' . $randomName . '.' . $media->getExtension();
$absolutePath = __DIR__ . '/' . $path; $absolutePath = __DIR__ . '/' . $path;
} while(!\is_file($absolutePath) && $counter < 1000); } while (!\is_file($absolutePath) && $counter < 1000);
if ($counter >= 1000) { if ($counter >= 1000) {
return new NullMedia(); return new NullMedia();

View File

@ -319,11 +319,25 @@ class Media implements \JsonSerializable
return $this->isAbsolute ? $this->path : \ltrim($this->path, '\\/'); return $this->isAbsolute ? $this->path : \ltrim($this->path, '\\/');
} }
/**
* Get the media path
*
* @return string
*
* @since 1.0.0
*/
public function getFileName() : string public function getFileName() : string
{ {
return \basename($this->path); return \basename($this->path);
} }
/**
* Get the media path
*
* @return string
*
* @since 1.0.0
*/
public function getExtension() : string public function getExtension() : string
{ {
$pos = \strrpos('.', $this->path); $pos = \strrpos('.', $this->path);