Automated formatting changes

This commit is contained in:
Formatter Bot 2021-09-19 17:54:05 +00:00
parent 843dfd6ea2
commit 064ad86f32
6 changed files with 18 additions and 16 deletions

View File

@ -17,14 +17,14 @@ namespace Modules\Media\Admin;
use Modules\Admin\Models\AccountMapper; use Modules\Admin\Models\AccountMapper;
use Modules\Admin\Models\NullAccount; use Modules\Admin\Models\NullAccount;
use Modules\Media\Controller\ApiController; use Modules\Media\Controller\ApiController;
use Modules\Media\Models\MediaType;
use Modules\Media\Models\MediaTypeMapper;
use Modules\Media\Models\MediaTypeL11n;
use Modules\Media\Models\MediaTypeL11nMapper;
use Modules\Media\Models\Collection; use Modules\Media\Models\Collection;
use Modules\Media\Models\CollectionMapper; use Modules\Media\Models\CollectionMapper;
use Modules\Media\Models\Media; use Modules\Media\Models\Media;
use Modules\Media\Models\MediaMapper; use Modules\Media\Models\MediaMapper;
use Modules\Media\Models\MediaType;
use Modules\Media\Models\MediaTypeL11n;
use Modules\Media\Models\MediaTypeL11nMapper;
use Modules\Media\Models\MediaTypeMapper;
use Modules\Media\Models\UploadFile; use Modules\Media\Models\UploadFile;
use phpOMS\Application\ApplicationAbstract; use phpOMS\Application\ApplicationAbstract;
use phpOMS\Config\SettingsInterface; use phpOMS\Config\SettingsInterface;
@ -186,13 +186,13 @@ final class Installer extends InstallerAbstract
*/ */
private static function createType(DatabasePool $dbPool, array $data) : MediaType private static function createType(DatabasePool $dbPool, array $data) : MediaType
{ {
$type = new MediaType(); $type = new MediaType();
$type->name = $data['name'] ?? ''; $type->name = $data['name'] ?? '';
$id = MediaTypeMapper::create($type); $id = MediaTypeMapper::create($type);
foreach ($data['l11n'] as $l11n) { foreach ($data['l11n'] as $l11n) {
$l11n = new MediaTypeL11n($l11n['title'], $l11n['lang']); $l11n = new MediaTypeL11n($l11n['title'], $l11n['lang']);
$l11n->type = $id; $l11n->type = $id;
MediaTypeL11nMapper::create($l11n); MediaTypeL11nMapper::create($l11n);

View File

@ -51,7 +51,9 @@ class Media implements \JsonSerializable
* @var null|int|MediaType * @var null|int|MediaType
* @since 1.0.0 * @since 1.0.0
*/ */
public null|int|MediaType $type = null; public null | int |
MediaType $type = null;
/** /**
* Extension. * Extension.

View File

@ -77,7 +77,7 @@ class MediaType implements \JsonSerializable, ArrayableInterface
* Set title * Set title
* *
* @param string|MediaTypeL11n $title Media article title * @param string|MediaTypeL11n $title Media article title
* @param string $lang Language * @param string $lang Language
* *
* @return void * @return void
* *
@ -104,7 +104,7 @@ class MediaType implements \JsonSerializable, ArrayableInterface
return [ return [
'id' => $this->id, 'id' => $this->id,
'title' => $this->title, 'title' => $this->title,
'name' => $this->name, 'name' => $this->name,
]; ];
} }

View File

@ -116,10 +116,10 @@ class MediaTypeL11n implements \JsonSerializable, ArrayableInterface
public function toArray() : array public function toArray() : array
{ {
return [ return [
'id' => $this->id, 'id' => $this->id,
'title' => $this->title, 'title' => $this->title,
'type' => $this->type, 'type' => $this->type,
'language' => $this->language, 'language' => $this->language,
]; ];
} }

View File

@ -33,10 +33,10 @@ final class MediaTypeL11nMapper extends DataMapperAbstract
* @since 1.0.0 * @since 1.0.0
*/ */
protected static array $columns = [ protected static array $columns = [
'media_type_l11n_id' => ['name' => 'media_type_l11n_id', 'type' => 'int', 'internal' => 'id'], 'media_type_l11n_id' => ['name' => 'media_type_l11n_id', 'type' => 'int', 'internal' => 'id'],
'media_type_l11n_title' => ['name' => 'media_type_l11n_title', 'type' => 'string', 'internal' => 'title', 'autocomplete' => true], 'media_type_l11n_title' => ['name' => 'media_type_l11n_title', 'type' => 'string', 'internal' => 'title', 'autocomplete' => true],
'media_type_l11n_type' => ['name' => 'media_type_l11n_type', 'type' => 'int', 'internal' => 'type'], 'media_type_l11n_type' => ['name' => 'media_type_l11n_type', 'type' => 'int', 'internal' => 'type'],
'media_type_l11n_language' => ['name' => 'media_type_l11n_language', 'type' => 'string', 'internal' => 'language'], 'media_type_l11n_language' => ['name' => 'media_type_l11n_language', 'type' => 'string', 'internal' => 'language'],
]; ];
/** /**

View File

@ -34,7 +34,7 @@ final class MediaTypeMapper extends DataMapperAbstract
*/ */
protected static array $columns = [ protected static array $columns = [
'media_type_id' => ['name' => 'media_type_id', 'type' => 'int', 'internal' => 'id'], 'media_type_id' => ['name' => 'media_type_id', 'type' => 'int', 'internal' => 'id'],
'media_type_name' => ['name' => 'media_type_name', 'type' => 'string', 'internal' => 'name'], 'media_type_name' => ['name' => 'media_type_name', 'type' => 'string', 'internal' => 'name'],
]; ];
/** /**