Type and cs fixes

This commit is contained in:
Dennis Eichhorn 2020-03-07 00:23:17 +01:00
parent 4ca0f4d7cd
commit f8e49e241f
2 changed files with 7 additions and 7 deletions

View File

@ -103,16 +103,16 @@ final class ApiController extends Controller
$this->createLocalFile($fullPath, (string) $request->getData('image')); $this->createLocalFile($fullPath, (string) $request->getData('image'));
$status = [ $status = [
'path' => $path, 'path' => $path,
'filename' => $filename, 'filename' => $filename,
'name' => (string) $request->getData('title'), 'name' => (string) $request->getData('title'),
'size' => File::size($fullPath), 'size' => File::size($fullPath),
'extension' => $extension, 'extension' => $extension,
'status' => UploadStatus::OK, 'status' => UploadStatus::OK,
]; ];
$media = MediaController::createDbEntry($status, $request->getHeader()->getAccount()); $media = MediaController::createDbEntry($status, $request->getHeader()->getAccount());
$draw = DrawImage::fromMedia($media); $draw = $media !== null ? DrawImage::fromMedia($media) : null;
$this->createModel($request->getHeader()->getAccount(), $draw, DrawImageMapper::class, 'draw'); $this->createModel($request->getHeader()->getAccount(), $draw, DrawImageMapper::class, 'draw');
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Draw', 'Draw successfully created.', $draw); $this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Draw', 'Draw successfully created.', $draw);

View File

@ -41,7 +41,7 @@ final class DrawImageMapper extends DataMapperAbstract
/** /**
* Has one relation. * Has one relation.
* *
* @var array<string, array{mapper:string, self:string, by?:string}> * @var array<string, array{mapper:string, self:string, by?:string, column?:string}>
* @since 1.0.0 * @since 1.0.0
*/ */
protected static array $ownsOne = [ protected static array $ownsOne = [