Skip to content

Commit

Permalink
Clean up code
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre RAMBAUD committed Dec 17, 2020
1 parent a81281b commit 0aefff3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Adapter/CMS/Page/CommandHandler/EditCmsPageHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,11 @@ public function handle(EditCmsPageCommand $command)
private function createCmsFromCommand(EditCmsPageCommand $command)
{
$cms = $this->getCmsPageIfExistsById($command->getCmsPageId()->getValue());
$cmsCategoryId = null !== $command->getCmsPageCategoryId() ? $command->getCmsPageCategoryId()->getValue() : null;

if (null !== $cmsCategoryId) {
$this->assertCmsCategoryExists($cmsCategoryId);
if (null !== $command->getCmsPageCategoryId()) {
$this->assertCmsCategoryExists($command->getCmsPageCategoryId()->getValue());

$cms->id_cms_category = $cmsCategoryId;
$cms->id_cms_category = $command->getCmsPageCategoryId()->getValue();
}

if (null !== $command->getLocalizedTitle()) {
Expand Down

0 comments on commit 0aefff3

Please sign in to comment.