Skip to content
This repository has been archived by the owner on Jan 11, 2019. It is now read-only.

Commit

Permalink
Merge pull request #39 from pamil/road-to-hell
Browse files Browse the repository at this point in the history
Maintenance + stable Sylius support
  • Loading branch information
pjedrzejewski committed Nov 10, 2017
2 parents c93cfa4 + 5c1104d commit 35726d6
Show file tree
Hide file tree
Showing 55 changed files with 90 additions and 99 deletions.
9 changes: 5 additions & 4 deletions composer.json
Expand Up @@ -17,13 +17,14 @@
"php": "^7.1",

"php-amqplib/rabbitmq-bundle": "^1.12",
"sylius-labs/rabbitmq-simplebus-bundle": "^1.0.0@beta",
"sylius/sylius": "1.0.0-beta.3"
"sylius-labs/rabbitmq-simplebus-bundle": "^1.0",
"sylius/sylius": "^1.0"
},
"require-dev": {
"matthiasnoback/symfony-dependency-injection-test": "^1.0",
"phpspec/phpspec": "^3.2",
"phpunit/phpunit": "^5.6"
"phpspec/phpspec": "^4.0",
"phpunit/phpunit": "^5.6",
"sylius-labs/coding-standard": "^1.0"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 2 additions & 0 deletions easy-coding-standard.neon
@@ -0,0 +1,2 @@
includes:
- vendor/sylius-labs/coding-standard/easy-coding-standard.neon
2 changes: 2 additions & 0 deletions spec/Denormalizer/AssociationTypeUpdatedDenormalizerSpec.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace spec\Sylake\SyliusConsumerPlugin\Denormalizer;

use PhpAmqpLib\Message\AMQPMessage;
Expand Down
2 changes: 2 additions & 0 deletions spec/Denormalizer/AttributeOptionUpdatedDenormalizerSpec.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace spec\Sylake\SyliusConsumerPlugin\Denormalizer;

use PhpAmqpLib\Message\AMQPMessage;
Expand Down
2 changes: 2 additions & 0 deletions spec/Denormalizer/AttributeUpdatedDenormalizerSpec.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace spec\Sylake\SyliusConsumerPlugin\Denormalizer;

use PhpAmqpLib\Message\AMQPMessage;
Expand Down
2 changes: 2 additions & 0 deletions spec/Denormalizer/FamilyUpdatedDenormalizerSpec.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace spec\Sylake\SyliusConsumerPlugin\Denormalizer;

use PhpAmqpLib\Message\AMQPMessage;
Expand Down
2 changes: 2 additions & 0 deletions spec/Denormalizer/GroupUpdatedDenormalizerSpec.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace spec\Sylake\SyliusConsumerPlugin\Denormalizer;

use PhpAmqpLib\Message\AMQPMessage;
Expand Down
2 changes: 2 additions & 0 deletions spec/Denormalizer/TaxonUpdatedDenormalizerSpec.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace spec\Sylake\SyliusConsumerPlugin\Denormalizer;

use PhpAmqpLib\Message\AMQPMessage;
Expand Down
3 changes: 2 additions & 1 deletion spec/Model/TranslationsSpec.php
@@ -1,9 +1,10 @@
<?php

declare(strict_types=1);

namespace spec\Sylake\SyliusConsumerPlugin\Model;

use PhpSpec\ObjectBehavior;
use Prophecy\Argument;

final class TranslationsSpec extends ObjectBehavior
{
Expand Down
2 changes: 2 additions & 0 deletions src/Denormalizer/AssociationTypeUpdatedDenormalizer.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sylake\SyliusConsumerPlugin\Denormalizer;

use Sylake\SyliusConsumerPlugin\Event\AssociationTypeUpdated;
Expand Down
2 changes: 2 additions & 0 deletions src/Denormalizer/AttributeUpdatedDenormalizer.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sylake\SyliusConsumerPlugin\Denormalizer;

use Sylake\SyliusConsumerPlugin\Event\AttributeUpdated;
Expand Down
1 change: 0 additions & 1 deletion src/Denormalizer/ProductUpdatedDenormalizer.php
Expand Up @@ -9,7 +9,6 @@

final class ProductUpdatedDenormalizer extends AkeneoDenormalizer
{

/**
* {@inheritdoc}
*/
Expand Down
2 changes: 2 additions & 0 deletions src/Denormalizer/TaxonUpdatedDenormalizer.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sylake\SyliusConsumerPlugin\Denormalizer;

use Sylake\SyliusConsumerPlugin\Event\TaxonUpdated;
Expand Down
2 changes: 2 additions & 0 deletions src/DependencyInjection/Configuration.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sylake\SyliusConsumerPlugin\DependencyInjection;

use Symfony\Component\Config\Definition\Builder\TreeBuilder;
Expand Down
2 changes: 2 additions & 0 deletions src/DependencyInjection/SylakeSyliusConsumerExtension.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sylake\SyliusConsumerPlugin\DependencyInjection;

use Symfony\Component\Config\FileLocator;
Expand Down
2 changes: 2 additions & 0 deletions src/Event/AssociationTypeUpdated.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sylake\SyliusConsumerPlugin\Event;

use Sylake\SyliusConsumerPlugin\Model\Translations;
Expand Down
2 changes: 2 additions & 0 deletions src/Event/AttributeOptionUpdated.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sylake\SyliusConsumerPlugin\Event;

use Sylake\SyliusConsumerPlugin\Model\Translations;
Expand Down
4 changes: 3 additions & 1 deletion src/Event/AttributeUpdated.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sylake\SyliusConsumerPlugin\Event;

use Sylake\SyliusConsumerPlugin\Model\Translations;
Expand All @@ -12,7 +14,7 @@ final class AttributeUpdated
/** @var string */
private $type;

/**@var Translations */
/** @var Translations */
private $names;

public function __construct(string $code, string $type, Translations $names)
Expand Down
2 changes: 2 additions & 0 deletions src/Event/FamilyUpdated.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sylake\SyliusConsumerPlugin\Event;

use Sylake\SyliusConsumerPlugin\Model\Translations;
Expand Down
2 changes: 2 additions & 0 deletions src/Event/GroupUpdated.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sylake\SyliusConsumerPlugin\Event;

use Sylake\SyliusConsumerPlugin\Model\Translations;
Expand Down
2 changes: 2 additions & 0 deletions src/Event/ProductUpdated.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sylake\SyliusConsumerPlugin\Event;

final class ProductUpdated
Expand Down
2 changes: 2 additions & 0 deletions src/Event/TaxonUpdated.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sylake\SyliusConsumerPlugin\Event;

use Sylake\SyliusConsumerPlugin\Model\Translations;
Expand Down
2 changes: 2 additions & 0 deletions src/Model/Translations.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sylake\SyliusConsumerPlugin\Model;

final class Translations implements \IteratorAggregate
Expand Down
2 changes: 2 additions & 0 deletions src/Projector/AssociationTypeProjector.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sylake\SyliusConsumerPlugin\Projector;

use Psr\Log\LoggerInterface;
Expand Down
2 changes: 2 additions & 0 deletions src/Projector/AttributeOptionProjector.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sylake\SyliusConsumerPlugin\Projector;

use Psr\Log\LoggerInterface;
Expand Down
2 changes: 2 additions & 0 deletions src/Projector/AttributeProjector.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sylake\SyliusConsumerPlugin\Projector;

use Psr\Log\LoggerInterface;
Expand Down
3 changes: 2 additions & 1 deletion src/Projector/FamilyProjector.php
@@ -1,10 +1,11 @@
<?php

declare(strict_types=1);

namespace Sylake\SyliusConsumerPlugin\Projector;

use Psr\Log\LoggerInterface;
use Sylake\SyliusConsumerPlugin\Entity\AkeneoAttributeOption;
use Sylake\SyliusConsumerPlugin\Entity\AkeneoFamily;
use Sylake\SyliusConsumerPlugin\Event\FamilyUpdated;
use Sylake\SyliusConsumerPlugin\Model\Translations;
use Sylius\Component\Attribute\AttributeType\TextAttributeType;
Expand Down
3 changes: 2 additions & 1 deletion src/Projector/GroupProjector.php
@@ -1,10 +1,11 @@
<?php

declare(strict_types=1);

namespace Sylake\SyliusConsumerPlugin\Projector;

use Psr\Log\LoggerInterface;
use Sylake\SyliusConsumerPlugin\Entity\AkeneoAttributeOption;
use Sylake\SyliusConsumerPlugin\Entity\AkeneoGroup;
use Sylake\SyliusConsumerPlugin\Event\GroupUpdated;
use Sylake\SyliusConsumerPlugin\Model\Translations;
use Sylius\Component\Attribute\AttributeType\TextAttributeType;
Expand Down
Expand Up @@ -87,7 +87,7 @@ private function supports(Attribute $attribute): bool
return $this->priceAttribute === $attribute->attribute() && is_array($attribute->data());
}

private function processChannelPricings(Attribute $attribute, ProductVariantInterface$productVariant): array
private function processChannelPricings(Attribute $attribute, ProductVariantInterface $productVariant): array
{
/** @var ChannelPricingInterface[] $channelPricings */
$channelPricings = [];
Expand All @@ -107,7 +107,7 @@ private function processChannelPricings(Attribute $attribute, ProductVariantInte
/** @var ChannelPricingInterface|null $channelPricing */
$channelPricing = $this->channelPricingRepository->findOneBy([
'productVariant' => $productVariant,
'channelCode' => $channel->getCode()
'channelCode' => $channel->getCode(),
]);

if (null === $channelPricing) {
Expand All @@ -124,5 +124,4 @@ private function processChannelPricings(Attribute $attribute, ProductVariantInte

return $channelPricings;
}

}
Expand Up @@ -36,5 +36,4 @@ private function supports(Attribute $attribute): bool
{
return $this->descriptionAttribute === $attribute->attribute() && is_string($attribute->data());
}

}
1 change: 0 additions & 1 deletion src/Projector/Product/Attribute/NameAttributeProcessor.php
Expand Up @@ -36,5 +36,4 @@ private function supports(Attribute $attribute): bool
{
return $this->nameAttribute === $attribute->attribute() && (is_string($attribute->data()) || null === $attribute->data());
}

}
6 changes: 4 additions & 2 deletions src/Projector/Product/Attribute/ScalarAttributeProcessor.php
Expand Up @@ -6,8 +6,6 @@

use Sylake\SyliusConsumerPlugin\Model\Attribute;
use Sylius\Component\Attribute\AttributeType\CheckboxAttributeType;
use Sylius\Component\Attribute\AttributeType\DateAttributeType;
use Sylius\Component\Attribute\AttributeType\IntegerAttributeType;
use Sylius\Component\Attribute\AttributeType\TextareaAttributeType;
use Sylius\Component\Attribute\AttributeType\TextAttributeType;
use Sylius\Component\Attribute\Model\AttributeValueInterface;
Expand Down Expand Up @@ -57,6 +55,10 @@ private function getValue(Attribute $attribute)
{
$value = $attribute->data();

if (is_int($value) || is_float($value)) {
return (string) $value;
}

if (!is_string($value)) {
return $value;
}
Expand Down
2 changes: 2 additions & 0 deletions src/Projector/TaxonProjector.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sylake\SyliusConsumerPlugin\Projector;

use Psr\Log\LoggerInterface;
Expand Down
2 changes: 2 additions & 0 deletions src/SylakeSyliusConsumerPlugin.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Sylake\SyliusConsumerPlugin;

use Sylius\Bundle\CoreBundle\Application\SyliusPluginTrait;
Expand Down
5 changes: 2 additions & 3 deletions tests/Application/app/AppKernel.php
@@ -1,11 +1,10 @@
<?php

declare(strict_types=1);

use Sylius\Bundle\CoreBundle\Application\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;

/**
* @author Kamil Kokot <kamil@kokot.me>
*/
class AppKernel extends Kernel
{
/**
Expand Down
4 changes: 3 additions & 1 deletion tests/Application/app/autoload.php
@@ -1,7 +1,9 @@
<?php

use Doctrine\Common\Annotations\AnnotationRegistry;
declare(strict_types=1);

use Composer\Autoload\ClassLoader;
use Doctrine\Common\Annotations\AnnotationRegistry;

/** @var ClassLoader $loader */
$loader = require __DIR__ . '/../../../vendor/autoload.php';
Expand Down
5 changes: 2 additions & 3 deletions tests/DependencyInjection/ExtensionTest.php
@@ -1,13 +1,12 @@
<?php

declare(strict_types=1);

namespace Tests\Sylake\SyliusConsumerPlugin\DependencyInjection;

use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractExtensionTestCase;
use Sylake\SyliusConsumerPlugin\DependencyInjection\SylakeSyliusConsumerExtension;

/**
* @author Kamil Kokot <kamil@kokot.me>
*/
final class ExtensionTest extends AbstractExtensionTestCase
{
/**
Expand Down
10 changes: 2 additions & 8 deletions tests/Functional/AssociationTypeSynchronizationTest.php
@@ -1,19 +1,13 @@
<?php

declare(strict_types=1);

namespace Tests\Sylake\SyliusConsumerPlugin\Functional;

use Doctrine\Common\DataFixtures\Purger\ORMPurger;
use Doctrine\ORM\EntityManagerInterface;
use OldSound\RabbitMqBundle\RabbitMq\ConsumerInterface;
use PhpAmqpLib\Message\AMQPMessage;
use PHPUnit\Framework\Assert;
use Sylius\Component\Product\Model\ProductAssociationTypeInterface;
use Sylius\Component\Product\Repository\ProductAssociationTypeRepositoryInterface;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;

/**
* @author Kamil Kokot <kamil@kokot.me>
*/
final class AssociationTypeSynchronizationTest extends SynchronizationTestCase
{
/**
Expand Down

0 comments on commit 35726d6

Please sign in to comment.