Skip to content

Commit

Permalink
wip: cs
Browse files Browse the repository at this point in the history
  • Loading branch information
Nattfarinn committed Mar 7, 2018
1 parent 296800b commit de3be2e
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 10 deletions.
5 changes: 1 addition & 4 deletions src/bundle/Controller/ContentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
use EzSystems\EzPlatformAdminUi\RepositoryForms\View\ContentCreateOnTheFlyView;
use EzSystems\RepositoryForms\Content\View\ContentCreateView;
use EzSystems\RepositoryForms\Data\Mapper\ContentCreateMapper;
use EzSystems\RepositoryForms\Form\ActionDispatcher\ContentDispatcher;
use EzSystems\RepositoryForms\Form\Type\Content\ContentEditType;
use Symfony\Component\Form\Form;
use Symfony\Component\HttpFoundation\JsonResponse;
Expand Down Expand Up @@ -144,7 +143,6 @@ public function createAction(Request $request): Response

/**
* @param Request $request
*
* @param string $languageCode
* @param ContentType $contentType
* @param Location $parentLocation
Expand Down Expand Up @@ -220,8 +218,7 @@ public function hasOnTheFlyCreateAccessAction(Request $request, string $language
$response->setData([
'access' => true,
]);
}
catch (ApiException\UnauthorizedException $exception) {
} catch (ApiException\UnauthorizedException $exception) {
$response->setData([
'access' => false,
'message' => $exception->getMessage(),
Expand Down
5 changes: 2 additions & 3 deletions src/bundle/ParamConverter/ContentTypeParamConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,13 @@ public function apply(Request $request, ParamConverter $configuration)
if ($request->get(self::PARAMETER_CONTENT_TYPE_ID)) {
$id = (int)$request->get(self::PARAMETER_CONTENT_TYPE_ID);
$contentType = $this->contentTypeService->loadContentType($id, $this->siteAccessLanguages);
}
else if ($request->get(self::PARAMETER_CONTENT_TYPE_IDENTIFIER)) {
} elseif ($request->get(self::PARAMETER_CONTENT_TYPE_IDENTIFIER)) {
$identifier = $request->get(self::PARAMETER_CONTENT_TYPE_IDENTIFIER);
$contentType = $this->contentTypeService->loadContentTypeByIdentifier($identifier, $this->siteAccessLanguages);
}

if (!$contentType) {
throw new NotFoundHttpException("ContentType " . $id ?? $identifier . " not found!");
throw new NotFoundHttpException('ContentType ' . $id ?? $identifier . ' not found!');
}

$request->attributes->set($configuration->getName(), $contentType);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php

/**
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

namespace EzSystems\EzPlatformAdminUi\RepositoryForms\Dispatcher;
Expand Down Expand Up @@ -29,4 +34,4 @@ protected function getActionEventBaseName()
{
return self::EVENT_BASE_NAME;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php

/**
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

namespace EzSystems\EzPlatformAdminUi\RepositoryForms\Form\Processor\Content;
Expand Down Expand Up @@ -62,4 +67,4 @@ public function processPublish(FormActionEvent $event)
)
);
}
}
}
7 changes: 6 additions & 1 deletion src/lib/RepositoryForms/View/ContentCreateOnTheFlyView.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php

/**
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

namespace EzSystems\EzPlatformAdminUi\RepositoryForms\View;
Expand All @@ -7,4 +12,4 @@

class ContentCreateOnTheFlyView extends BaseView
{
}
}

0 comments on commit de3be2e

Please sign in to comment.