mirror of
https://github.com/Karaka-Management/oms-Media.git
synced 2026-02-08 13:38:42 +00:00
phpstan fixes
This commit is contained in:
parent
5439e1ba11
commit
2f45bf318b
|
|
@ -128,18 +128,22 @@ final class BackendController extends Controller
|
|||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$view->setTemplate('/Modules/Media/Theme/Backend/media-list');
|
||||
|
||||
$path = (string) ($request->getData('path') ?? '/');
|
||||
$path = (string) ($request->getData('path') ?? '/');
|
||||
|
||||
/** @var Media[] $media */
|
||||
$media = MediaMapper::getByVirtualPath($path);
|
||||
|
||||
$collection = CollectionMapper::getParentCollection($path);
|
||||
if (!empty($collection)) {
|
||||
$media += $collection->getSources();
|
||||
|
||||
/** @var string[] $glob */
|
||||
$glob = \glob(__DIR__ . '/../Files' . \trim($collection->getPath(), '/') . '/' . $collection->getName() . '/*');
|
||||
$glob = $glob === false ? [] : $glob;
|
||||
|
||||
foreach ($glob as $file) {
|
||||
foreach ($media as $obj) {
|
||||
if ($obj->getName() . '.' . $obj->getExtension() === \basename($file)){
|
||||
if ($obj->getName() . '.' . $obj->getExtension() === \basename($file)) {
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
|
|
@ -148,7 +152,7 @@ final class BackendController extends Controller
|
|||
|
||||
$localMedia = new Media();
|
||||
$localMedia->setName($pathinfo['filename']);
|
||||
$localMedia->setExtension($pathinfo['extension']);
|
||||
$localMedia->setExtension($pathinfo['extension'] ?? '');
|
||||
$localMedia->setCreatedBy(new Account());
|
||||
|
||||
$media[] = $localMedia;
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ class MediaMapper extends DataMapperAbstract
|
|||
* path if so desired without deleting or moving the orginal media files.
|
||||
*
|
||||
* @param string $virtualPath Virtual path
|
||||
* @param string $hidden Get hidden files
|
||||
* @param bool $hidden Get hidden files
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user