Skip to content

Commit

Permalink
Rename plugin (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
loevgaard authored Aug 14, 2020
1 parent 121d548 commit cafcbf8
Show file tree
Hide file tree
Showing 69 changed files with 198 additions and 203 deletions.
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sylius Facebook Tracking Plugin
# Sylius Facebook Plugin

[![Latest Version][ico-version]][link-packagist]
[![Latest Unstable Version][ico-unstable-version]][link-packagist]
Expand All @@ -17,7 +17,7 @@ This plugin uses the [TagBagBundle](https://github.com/Setono/TagBagBundle) to i
Open a command console, enter your project directory and execute the following command to download the latest stable version of this plugin:

```bash
$ composer require setono/sylius-facebook-tracking-plugin
$ composer require setono/sylius-facebook-plugin

# Omit this line if you want to override layout.html.twig as described at https://github.com/Setono/TagBagBundle#usage
$ composer require setono/sylius-tag-bag-plugin
Expand All @@ -40,7 +40,7 @@ $bundles = [
// Omit this line if you didn't install the SyliusTagBagPlugin in step 1
Setono\SyliusTagBagPlugin\SetonoSyliusTagBagPlugin::class => ['all' => true],

Setono\SyliusFacebookTrackingPlugin\SetonoSyliusFacebookTrackingPlugin::class => ['all' => true],
Setono\SyliusFacebookPlugin\SetonoSyliusFacebookPlugin::class => ['all' => true],
Sylius\Bundle\GridBundle\SyliusGridBundle::class => ['all' => true],
];
```
Expand All @@ -51,16 +51,16 @@ $bundles = [
# config/packages/_sylius.yaml
imports:
# ...
- { resource: "@SetonoSyliusFacebookTrackingPlugin/Resources/config/app/config.yaml" }
- { resource: "@SetonoSyliusFacebookPlugin/Resources/config/app/config.yaml" }
# ...
```

### Step 4: Import routing

```yaml
# config/routes/setono_sylius_facebook_tracking.yaml
# config/routes/setono_sylius_facebook.yaml
setono_facebook_tracking:
resource: "@SetonoSyliusFacebookTrackingPlugin/Resources/config/routing.yaml"
resource: "@SetonoSyliusFacebookPlugin/Resources/config/routing.yaml"
```
### Step 5: Update your database schema
Expand All @@ -87,12 +87,12 @@ Ways you can contribute:

Thank you!

[ico-version]: https://poser.pugx.org/setono/sylius-facebook-tracking-plugin/v/stable
[ico-unstable-version]: https://poser.pugx.org/setono/sylius-facebook-tracking-plugin/v/unstable
[ico-license]: https://poser.pugx.org/setono/sylius-facebook-tracking-plugin/license
[ico-github-actions]: https://github.com/Setono/SyliusFacebookTrackingPlugin/workflows/build/badge.svg
[ico-code-quality]: https://img.shields.io/scrutinizer/g/Setono/SyliusFacebookTrackingPlugin.svg?style=flat-square
[ico-version]: https://poser.pugx.org/setono/sylius-facebook-plugin/v/stable
[ico-unstable-version]: https://poser.pugx.org/setono/sylius-facebook-plugin/v/unstable
[ico-license]: https://poser.pugx.org/setono/sylius-facebook-plugin/license
[ico-github-actions]: https://github.com/Setono/SyliusFacebookPlugin/workflows/build/badge.svg
[ico-code-quality]: https://img.shields.io/scrutinizer/g/Setono/SyliusFacebookPlugin.svg?style=flat-square

[link-packagist]: https://packagist.org/packages/setono/sylius-facebook-tracking-plugin
[link-github-actions]: https://github.com/Setono/SyliusFacebookTrackingPlugin/actions
[link-code-quality]: https://scrutinizer-ci.com/g/Setono/SyliusFacebookTrackingPlugin
[link-packagist]: https://packagist.org/packages/setono/sylius-facebook-plugin
[link-github-actions]: https://github.com/Setono/SyliusFacebookPlugin/actions
[link-code-quality]: https://scrutinizer-ci.com/g/Setono/SyliusFacebookPlugin
2 changes: 1 addition & 1 deletion behat.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ default:
FriendsOfBehat\SymfonyExtension:
bootstrap: tests/Application/config/bootstrap.php
kernel:
class: Tests\Setono\SyliusFacebookTrackingPlugin\Application\Kernel
class: Tests\Setono\SyliusFacebookPlugin\Application\Kernel

FriendsOfBehat\VariadicExtension: ~

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "setono/sylius-facebook-tracking-plugin",
"name": "setono/sylius-facebook-plugin",
"type": "symfony-bundle",
"description": "Sylius plugin that tracks visitors and sends the data to Facebook",
"keywords": [
Expand Down Expand Up @@ -39,12 +39,12 @@
},
"autoload": {
"psr-4": {
"Setono\\SyliusFacebookTrackingPlugin\\": "src/"
"Setono\\SyliusFacebookPlugin\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\Setono\\SyliusFacebookTrackingPlugin\\": "tests/"
"Tests\\Setono\\SyliusFacebookPlugin\\": "tests/"
},
"classmap": [
"tests/Application/Kernel.php"
Expand Down
4 changes: 2 additions & 2 deletions phpspec.yml.dist
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
suites:
main:
namespace: Setono\SyliusFacebookTrackingPlugin
psr4_prefix: Setono\SyliusFacebookTrackingPlugin
namespace: Setono\SyliusFacebookPlugin
psr4_prefix: Setono\SyliusFacebookPlugin
8 changes: 4 additions & 4 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ parameters:

ignoreErrors:
- '/Parameter \#1 \$configuration of method Symfony\\Component\\DependencyInjection\\Extension\\Extension\:\:processConfiguration\(\) expects Symfony\\Component\\Config\\Definition\\ConfigurationInterface, Symfony\\Component\\Config\\Definition\\ConfigurationInterface\|null given\./'
- '/Method Setono\\SyliusFacebookTrackingPlugin\\Builder\\BuilderInterface\:\:create\(\) has no return typehint specified\./'
- '/Method Setono\\SyliusFacebookTrackingPlugin\\Builder\\BuilderInterface\:\:createFromJson\(\) has no return typehint specified\./'
- '/Method Setono\\SyliusFacebookTrackingPlugin\\Builder\\Builder\:\:create\(\) has no return typehint specified\./'
- '/Method Setono\\SyliusFacebookTrackingPlugin\\Builder\\Builder\:\:createFromJson\(\) has no return typehint specified\./'
- '/Method Setono\\SyliusFacebookPlugin\\Builder\\BuilderInterface\:\:create\(\) has no return typehint specified\./'
- '/Method Setono\\SyliusFacebookPlugin\\Builder\\BuilderInterface\:\:createFromJson\(\) has no return typehint specified\./'
- '/Method Setono\\SyliusFacebookPlugin\\Builder\\Builder\:\:create\(\) has no return typehint specified\./'
- '/Method Setono\\SyliusFacebookPlugin\\Builder\\Builder\:\:createFromJson\(\) has no return typehint specified\./'
- '/Unsafe usage of new static\(\)\./'
- '/Call to function assert\(\) with bool will always evaluate to true\./'
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
colors="true"
bootstrap="tests/Application/config/bootstrap.php">
<testsuites>
<testsuite name="SetonoSyliusFacebookTrackingPlugin Test Suite">
<testsuite name="SetonoSyliusFacebookPlugin Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
Expand Down
6 changes: 3 additions & 3 deletions spec/Event/BuilderEventSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

declare(strict_types=1);

namespace spec\Setono\SyliusFacebookTrackingPlugin\Event;
namespace spec\Setono\SyliusFacebookPlugin\Event;

use PhpSpec\ObjectBehavior;
use Setono\SyliusFacebookTrackingPlugin\Builder\BuilderInterface;
use Setono\SyliusFacebookTrackingPlugin\Event\BuilderEvent;
use Setono\SyliusFacebookPlugin\Builder\BuilderInterface;
use Setono\SyliusFacebookPlugin\Event\BuilderEvent;

class BuilderEventSpec extends ObjectBehavior
{
Expand Down
2 changes: 1 addition & 1 deletion src/Builder/AddToCartBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Setono\SyliusFacebookTrackingPlugin\Builder;
namespace Setono\SyliusFacebookPlugin\Builder;

final class AddToCartBuilder extends Builder
{
Expand Down
2 changes: 1 addition & 1 deletion src/Builder/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Setono\SyliusFacebookTrackingPlugin\Builder;
namespace Setono\SyliusFacebookPlugin\Builder;

use function Safe\json_decode;
use function Safe\json_encode;
Expand Down
2 changes: 1 addition & 1 deletion src/Builder/BuilderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Setono\SyliusFacebookTrackingPlugin\Builder;
namespace Setono\SyliusFacebookPlugin\Builder;

interface BuilderInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Builder/ContentBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Setono\SyliusFacebookTrackingPlugin\Builder;
namespace Setono\SyliusFacebookPlugin\Builder;

use Webmozart\Assert\Assert;

Expand Down
2 changes: 1 addition & 1 deletion src/Builder/ContentIdsAwareBuilderTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Setono\SyliusFacebookTrackingPlugin\Builder;
namespace Setono\SyliusFacebookPlugin\Builder;

use Webmozart\Assert\Assert;

Expand Down
2 changes: 1 addition & 1 deletion src/Builder/ContentNameAwareBuilderTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Setono\SyliusFacebookTrackingPlugin\Builder;
namespace Setono\SyliusFacebookPlugin\Builder;

use function assert;

Expand Down
2 changes: 1 addition & 1 deletion src/Builder/ContentTypeAwareBuilderTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Setono\SyliusFacebookTrackingPlugin\Builder;
namespace Setono\SyliusFacebookPlugin\Builder;

use Webmozart\Assert\Assert;

Expand Down
2 changes: 1 addition & 1 deletion src/Builder/ContentsAwareBuilderTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Setono\SyliusFacebookTrackingPlugin\Builder;
namespace Setono\SyliusFacebookPlugin\Builder;

use function assert;
use InvalidArgumentException;
Expand Down
2 changes: 1 addition & 1 deletion src/Builder/PurchaseBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Setono\SyliusFacebookTrackingPlugin\Builder;
namespace Setono\SyliusFacebookPlugin\Builder;

final class PurchaseBuilder extends Builder
{
Expand Down
2 changes: 1 addition & 1 deletion src/Builder/ValueAwareBuilderTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Setono\SyliusFacebookTrackingPlugin\Builder;
namespace Setono\SyliusFacebookPlugin\Builder;

use function assert;

Expand Down
2 changes: 1 addition & 1 deletion src/Builder/ViewContentBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Setono\SyliusFacebookTrackingPlugin\Builder;
namespace Setono\SyliusFacebookPlugin\Builder;

final class ViewContentBuilder extends Builder
{
Expand Down
4 changes: 2 additions & 2 deletions src/Context/PixelContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Setono\SyliusFacebookTrackingPlugin\Context;
namespace Setono\SyliusFacebookPlugin\Context;

use Setono\SyliusFacebookTrackingPlugin\Repository\PixelRepositoryInterface;
use Setono\SyliusFacebookPlugin\Repository\PixelRepositoryInterface;
use Sylius\Component\Channel\Context\ChannelContextInterface;

final class PixelContext implements PixelContextInterface
Expand Down
4 changes: 2 additions & 2 deletions src/Context/PixelContextInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Setono\SyliusFacebookTrackingPlugin\Context;
namespace Setono\SyliusFacebookPlugin\Context;

use Setono\SyliusFacebookTrackingPlugin\Model\PixelInterface;
use Setono\SyliusFacebookPlugin\Model\PixelInterface;

interface PixelContextInterface
{
Expand Down
14 changes: 7 additions & 7 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

declare(strict_types=1);

namespace Setono\SyliusFacebookTrackingPlugin\DependencyInjection;
namespace Setono\SyliusFacebookPlugin\DependencyInjection;

use Setono\SyliusFacebookTrackingPlugin\Doctrine\ORM\PixelRepository;
use Setono\SyliusFacebookTrackingPlugin\Form\Type\PixelType;
use Setono\SyliusFacebookTrackingPlugin\Model\Pixel;
use Setono\SyliusFacebookTrackingPlugin\Model\PixelInterface;
use Setono\SyliusFacebookPlugin\Doctrine\ORM\PixelRepository;
use Setono\SyliusFacebookPlugin\Form\Type\PixelType;
use Setono\SyliusFacebookPlugin\Model\Pixel;
use Setono\SyliusFacebookPlugin\Model\PixelInterface;
use Sylius\Bundle\ResourceBundle\Controller\ResourceController;
use Sylius\Bundle\ResourceBundle\SyliusResourceBundle;
use Sylius\Component\Resource\Factory\Factory;
Expand All @@ -20,12 +20,12 @@ final class Configuration implements ConfigurationInterface
public function getConfigTreeBuilder(): TreeBuilder
{
if (method_exists(TreeBuilder::class, 'getRootNode')) {
$treeBuilder = new TreeBuilder('setono_sylius_facebook_tracking');
$treeBuilder = new TreeBuilder('setono_sylius_facebook');
$rootNode = $treeBuilder->getRootNode();
} else {
// BC layer for symfony/config 4.1 and older
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('setono_sylius_facebook_tracking');
$rootNode = $treeBuilder->root('setono_sylius_facebook');
}

$rootNode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,22 @@

declare(strict_types=1);

namespace Setono\SyliusFacebookTrackingPlugin\DependencyInjection;
namespace Setono\SyliusFacebookPlugin\DependencyInjection;

use Exception;
use Sylius\Bundle\ResourceBundle\DependencyInjection\Extension\AbstractResourceExtension;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;

final class SetonoSyliusFacebookTrackingExtension extends AbstractResourceExtension
final class SetonoSyliusFacebookExtension extends AbstractResourceExtension
{
/**
* {@inheritdoc}
*
* @throws Exception
*/
public function load(array $config, ContainerBuilder $container): void
{
$config = $this->processConfiguration($this->getConfiguration([], $container), $config);
$loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));

$loader->load('services.xml');

$this->registerResources('setono_sylius_facebook_tracking', $config['driver'], $config['resources'], $container);
$this->registerResources('setono_sylius_facebook', $config['driver'], $config['resources'], $container);
}
}
4 changes: 2 additions & 2 deletions src/Doctrine/ORM/PixelRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Setono\SyliusFacebookTrackingPlugin\Doctrine\ORM;
namespace Setono\SyliusFacebookPlugin\Doctrine\ORM;

use Setono\SyliusFacebookTrackingPlugin\Repository\PixelRepositoryInterface;
use Setono\SyliusFacebookPlugin\Repository\PixelRepositoryInterface;
use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository;
use Sylius\Component\Channel\Model\ChannelInterface;

Expand Down
4 changes: 2 additions & 2 deletions src/Event/BuilderEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Setono\SyliusFacebookTrackingPlugin\Event;
namespace Setono\SyliusFacebookPlugin\Event;

use Setono\SyliusFacebookTrackingPlugin\Builder\BuilderInterface;
use Setono\SyliusFacebookPlugin\Builder\BuilderInterface;
use Symfony\Component\EventDispatcher\Event;

final class BuilderEvent extends Event
Expand Down
6 changes: 3 additions & 3 deletions src/EventListener/AddLibrarySubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Setono\SyliusFacebookTrackingPlugin\EventListener;
namespace Setono\SyliusFacebookPlugin\EventListener;

use Setono\SyliusFacebookTrackingPlugin\Tag\Tags;
use Setono\SyliusFacebookPlugin\Tag\Tags;
use Setono\TagBag\Tag\TagInterface;
use Setono\TagBag\Tag\TwigTag;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
Expand Down Expand Up @@ -39,7 +39,7 @@ public function add(GetResponseEvent $event): void
}

$this->tagBag->addTag(
(new TwigTag('@SetonoSyliusFacebookTrackingPlugin/Tag/library.html.twig', [
(new TwigTag('@SetonoSyliusFacebookPlugin/Tag/library.html.twig', [
'pixels' => $this->getPixels(),
]))
->setSection(TagInterface::SECTION_HEAD)
Expand Down
18 changes: 9 additions & 9 deletions src/EventListener/AddToCartSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

declare(strict_types=1);

namespace Setono\SyliusFacebookTrackingPlugin\EventListener;

use Setono\SyliusFacebookTrackingPlugin\Builder\AddToCartBuilder;
use Setono\SyliusFacebookTrackingPlugin\Builder\ContentBuilder;
use Setono\SyliusFacebookTrackingPlugin\Context\PixelContextInterface;
use Setono\SyliusFacebookTrackingPlugin\Event\BuilderEvent;
use Setono\SyliusFacebookTrackingPlugin\Tag\FbqTag;
use Setono\SyliusFacebookTrackingPlugin\Tag\FbqTagInterface;
use Setono\SyliusFacebookTrackingPlugin\Tag\Tags;
namespace Setono\SyliusFacebookPlugin\EventListener;

use Setono\SyliusFacebookPlugin\Builder\AddToCartBuilder;
use Setono\SyliusFacebookPlugin\Builder\ContentBuilder;
use Setono\SyliusFacebookPlugin\Context\PixelContextInterface;
use Setono\SyliusFacebookPlugin\Event\BuilderEvent;
use Setono\SyliusFacebookPlugin\Tag\FbqTag;
use Setono\SyliusFacebookPlugin\Tag\FbqTagInterface;
use Setono\SyliusFacebookPlugin\Tag\Tags;
use Setono\TagBag\Tag\TagInterface;
use Setono\TagBag\TagBagInterface;
use Sylius\Component\Core\Model\OrderInterface;
Expand Down
Loading

0 comments on commit cafcbf8

Please sign in to comment.