Skip to content

Commit

Permalink
Merge pull request #25 from bitbag-commerce/dev
Browse files Browse the repository at this point in the history
Update Sylius to 1.0.0 and PHP to 7.1+
  • Loading branch information
bitbager authored Sep 13, 2017
2 parents 1c53a74 + a9a70cf commit 0246ced
Show file tree
Hide file tree
Showing 30 changed files with 245 additions and 212 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "MIT",
"require": {
"php": "^7.1",
"sylius/sylius": "^1.0.0-rc.1"
"sylius/sylius": "^1.0.0"
},
"require-dev": {
"phpspec/phpspec": "^3.2",
Expand Down
21 changes: 10 additions & 11 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/Controller/PageSlugController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
* an email on [email protected].
*/

declare(strict_types=1);

namespace BitBag\CmsPlugin\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
Expand All @@ -24,7 +26,7 @@ final class PageSlugController extends Controller
*
* @return JsonResponse
*/
public function generateAction(Request $request)
public function generateAction(Request $request): JsonResponse
{
$name = $request->query->get('name');

Expand Down
4 changes: 3 additions & 1 deletion src/DependencyInjection/BitBagCmsExtension.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* This file was created by the developers from BitBag.
* Feel free to contact us once you face any issues or want to start
Expand All @@ -21,7 +23,7 @@ final class BitBagCmsExtension extends Extension
/**
* {@inheritdoc}
*/
public function load(array $configs, ContainerBuilder $container)
public function load(array $configs, ContainerBuilder $container): void
{
}
}
31 changes: 0 additions & 31 deletions src/DependencyInjection/Configuration.php

This file was deleted.

35 changes: 19 additions & 16 deletions src/Entity/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
* an email on [email protected].
*/

declare(strict_types=1);

namespace BitBag\CmsPlugin\Entity;

use Sylius\Component\Core\Model\ImageInterface;
Expand All @@ -17,6 +19,7 @@

/**
* @author Patryk Drapik <[email protected]>
* @author Mikołaj Król <[email protected]>
*/
class Block implements BlockInterface
{
Expand Down Expand Up @@ -48,119 +51,119 @@ public function __construct()
/**
* {@inheritdoc}
*/
public function getCode()
public function getCode(): ?string
{
return $this->code;
}

/**
* {@inheritdoc}
*/
public function setCode($code)
public function setCode(?string $code): void
{
$this->code = $code;
}

/**
* {@inheritdoc}
*/
public function getType()
public function getType(): string
{
return $this->type;
}

/**
* {@inheritdoc}
*/
public function setType($type)
public function setType(string $type): void
{
$this->type = $type;
}

/**
* {@inheritdoc}
*/
public function getId()
public function getId(): ?int
{
return $this->id;
}

/**
* @return string
*/
public function getName()
public function getName(): ?string
{
return $this->getBlockTranslation()->getName();
}

/**
* @param string $name
* @param string|null $name
*/
public function setName($name)
public function setName(?string $name): void
{
$this->getBlockTranslation()->setName($name);
}

/**
* {@inheritdoc}
*/
public function getContent()
public function getContent(): ?string
{
return $this->getBlockTranslation()->getContent();
}

/**
* {@inheritdoc}
*/
public function setContent($content)
public function setContent(?string $content): void
{
$this->getBlockTranslation()->setContent($content);
}

/**
* {@inheritdoc}
*/
public function getImage()
public function getImage(): ?ImageInterface
{
return $this->getBlockTranslation()->getImage();
}

/**
* {@inheritdoc}
*/
public function setImage(ImageInterface $image)
public function setImage(?ImageInterface $image): void
{
$this->getBlockTranslation()->setImage($image);
}

/**
* {@inheritdoc}
*/
public function getLink()
public function getLink(): ?string
{
return $this->getBlockTranslation()->getLink();
}

/**
* {@inheritdoc}
*/
public function setLink($link)
public function setLink(?string $link): void
{
$this->getBlockTranslation()->setLink($link);
}

/**
* @return BlockTranslationInterface|TranslationInterface
*/
protected function getBlockTranslation()
protected function getBlockTranslation(): ?TranslationInterface
{
return $this->getTranslation();
}

/**
* {@inheritdoc}
*/
protected function createTranslation()
protected function createTranslation(): BlockTranslation
{
return new BlockTranslation();
}
Expand Down
41 changes: 22 additions & 19 deletions src/Entity/BlockInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
* an email on [email protected].
*/

declare(strict_types=1);

namespace BitBag\CmsPlugin\Entity;

use Sylius\Component\Core\Model\ImageInterface;
Expand All @@ -16,6 +18,7 @@

/**
* @author Patryk Drapik <[email protected]>
* @author Mikołaj Król <[email protected]>
*/
interface BlockInterface extends ResourceInterface, TranslatableInterface
{
Expand All @@ -26,60 +29,60 @@ interface BlockInterface extends ResourceInterface, TranslatableInterface
/**
* @return string
*/
public function getType();
public function getType(): string;

/**
* @param string $type
*/
public function setType($type);
public function setType(string $type): void;

/**
* @return string
* @return string|null
*/
public function getCode();
public function getCode(): ?string;

/**
* @param string $code
* @param string|null $code
*/
public function setCode($code);
public function setCode(?string $code): void;

/**
* @return string
* @return string|null
*/
public function getName();
public function getName(): ?string;

/**
* @param string $name
* @param string|null $name
*/
public function setName($name);
public function setName(?string $name): void;

/**
* @return string
* @return string|null
*/
public function getContent();
public function getContent(): ?string;

/**
* @param string $content
*/
public function setContent($content);
public function setContent(?string $content): void;

/**
* @return ImageInterface
*/
public function getImage();
public function getImage(): ?ImageInterface;

/**
* @param ImageInterface $image
*/
public function setImage(ImageInterface $image);
public function setImage(?ImageInterface $image): void;

/**
* @return string
* @return string|null
*/
public function getLink();
public function getLink(): ?string;

/**
* @param string $link
* @param string|null $link
*/
public function setLink($link);
public function setLink(?string $link): void;
}
Loading

0 comments on commit 0246ced

Please sign in to comment.