Skip to content

Commit b3377be

Browse files
committed
Fix old code
1 parent f0e85b3 commit b3377be

20 files changed

Lines changed: 84 additions & 80 deletions

.scrutinizer.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

composer.json

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
"description": "Add barcodes to your products using this plugin",
55
"license": "MIT",
66
"require": {
7-
"php": ">=7.3",
7+
"php": ">=7.4",
88
"doctrine/persistence": "^1.3 || ^2.0",
99
"setono/doctrine-orm-batcher-bundle": "^0.3.1",
1010
"sylius/sylius": "^1.3",
11-
"symfony/config": "^4.4 || ^5.0",
12-
"symfony/event-dispatcher": "^4.4 || ^5.0",
13-
"symfony/messenger": "^4.4 || ^5.0",
11+
"symfony/config": "^4.4 || ^5.4",
12+
"symfony/event-dispatcher": "^4.4 || ^5.4",
13+
"symfony/event-dispatcher-contracts": "^1.0 || ^2.0 || ^3.0",
14+
"symfony/messenger": "^4.4 || ^5.4",
1415
"thecodingmachine/safe": "^1.0",
1516
"violuke/php-barcodes": "^1.0"
1617
},
@@ -20,34 +21,29 @@
2021
"behat/mink-browserkit-driver": "^1.3",
2122
"behat/mink-extension": "^2.2",
2223
"behat/mink-selenium2-driver": "^1.3",
23-
"ergebnis/composer-normalize": "^2.0",
2424
"friends-of-behat/page-object-extension": "^0.3",
2525
"friends-of-behat/suite-settings-extension": "^1.0",
2626
"friends-of-behat/symfony-extension": "^2.0",
2727
"friends-of-behat/variadic-extension": "^1.1",
2828
"lakion/mink-debug-extension": "^1.2.3",
2929
"phpspec/phpspec": "^6.1",
30-
"phpstan/phpstan": "^0.12",
31-
"phpstan/phpstan-doctrine": "^0.12",
32-
"phpstan/phpstan-strict-rules": "^0.12",
33-
"phpstan/phpstan-webmozart-assert": "^0.12",
3430
"phpunit/phpunit": "^8.3",
3531
"roave/security-advisories": "dev-latest",
3632
"sensiolabs/security-checker": "^5.0",
37-
"sylius-labs/coding-standard": "^3.1",
33+
"setono/code-quality-pack": "^2.1.3",
3834
"symfony/browser-kit": "^4.4 || ^5.0",
3935
"symfony/debug-bundle": "^4.4 || ^5.0",
4036
"symfony/dotenv": "^4.4 || ^5.0",
4137
"symfony/intl": "^4.4 || ^5.0",
4238
"symfony/web-profiler-bundle": "^4.4 || ^5.0",
43-
"symfony/web-server-bundle": "^4.4 || ^5.0",
44-
"thecodingmachine/phpstan-safe-rule": "^1.0"
39+
"symfony/web-server-bundle": "^4.4 || ^5.0"
4540
},
4641
"config": {
4742
"sort-packages": true,
4843
"allow-plugins": {
4944
"symfony/thanks": true,
50-
"ergebnis/composer-normalize": true
45+
"ergebnis/composer-normalize": true,
46+
"dealerdirect/phpcodesniffer-composer-installer": false
5147
}
5248
},
5349
"extra": {
@@ -72,7 +68,7 @@
7268
"@checks",
7369
"@tests"
7470
],
75-
"analyse": "vendor/bin/phpstan analyse -c phpstan.neon -l max src/",
71+
"analyse": "psalm",
7672
"assets": [
7773
"@ensure-assets-installed",
7874
"@ensure-assets-compiled"
@@ -82,7 +78,7 @@
8278
"SYMFONY_ENV=test composer ensure-env-copied",
8379
"vendor/bin/behat --tags=\"~@javascript\" --no-interaction --format=progress"
8480
],
85-
"check-style": "vendor/bin/ecs check src/ spec/",
81+
"check-style": "ecs check",
8682
"checks": [
8783
"composer validate --strict",
8884
"composer normalize --dry-run",
@@ -101,7 +97,7 @@
10197
"ensure-env-test-copied": "(cd tests/Application && ([[ -f .env.test.local ]] || cp .env.test .env.test.local))",
10298
"ensure-schema-updated": "composer ensure-env-copied && (cd tests/Application && bin/console doctrine:schema:update --force -e ${SYMFONY_ENV:-'dev'})",
10399
"ensure-vendors-installed": "[[ -f vendor/autoload.php ]] || php -d memory_limit=-1 /usr/local/bin/composer install",
104-
"fix-style": "vendor/bin/ecs check src/ spec/ --fix",
100+
"fix-style": "ecs check --fix",
105101
"fixtures": [
106102
"@ensure-database-ready",
107103
"(cd tests/Application && bin/console sylius:fixtures:load --no-interaction -e ${SYMFONY_ENV:-'dev'})"

easy-coding-standard.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

ecs.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
6+
use Symplify\EasyCodingStandard\ValueObject\Option;
7+
use PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer;
8+
9+
return static function (ContainerConfigurator $containerConfigurator): void {
10+
$containerConfigurator->import('vendor/sylius-labs/coding-standard/ecs.php');
11+
12+
$containerConfigurator->parameters()->set(Option::PATHS, [
13+
'src', 'tests', 'spec'
14+
]);
15+
16+
$containerConfigurator->parameters()->set(Option::SKIP, [
17+
VisibilityRequiredFixer::class => ['*Spec.php'],
18+
]);
19+
};

phpstan.neon

Lines changed: 0 additions & 17 deletions
This file was deleted.

psalm.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0"?>
2+
<psalm
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
errorLevel="4"
5+
xmlns="https://getpsalm.org/schema/config"
6+
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
7+
>
8+
<projectFiles>
9+
<directory name="src"/>
10+
<ignoreFiles>
11+
<directory name="vendor"/>
12+
</ignoreFiles>
13+
</projectFiles>
14+
<forbiddenFunctions>
15+
<function name="dd"/>
16+
<function name="dump"/>
17+
</forbiddenFunctions>
18+
</psalm>

src/BarcodeChecker/BarcodeChecker.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,12 @@
1313

1414
final class BarcodeChecker implements BarcodeCheckerInterface
1515
{
16-
/** @var EventDispatcherInterface */
16+
/** @var LegacyEventDispatcherProxy */
1717
private $eventDispatcher;
1818

1919
public function __construct(EventDispatcherInterface $eventDispatcher)
2020
{
21-
/** @var EventDispatcherInterface $eventDispatcher */
22-
$eventDispatcher = LegacyEventDispatcherProxy::decorate($eventDispatcher);
23-
24-
$this->eventDispatcher = $eventDispatcher;
21+
$this->eventDispatcher = LegacyEventDispatcherProxy::decorate($eventDispatcher);
2522
}
2623

2724
public function check(BarcodeAwareInterface $barcodeAware): void

src/DependencyInjection/LoevgaardSyliusBarcodeExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
final class LoevgaardSyliusBarcodeExtension extends Extension
1313
{
14-
public function load(array $config, ContainerBuilder $container): void
14+
public function load(array $configs, ContainerBuilder $container): void
1515
{
16-
$config = $this->processConfiguration($this->getConfiguration([], $container), $config);
16+
$config = $this->processConfiguration($this->getConfiguration([], $container), $configs);
1717
$container->setParameter('loevgaard_sylius_barcode.form.require', $config['form']['require']);
1818
$container->setParameter('loevgaard_sylius_barcode.form.require_valid', $config['form']['require_valid']);
1919
$container->setParameter('loevgaard_sylius_barcode.form.require_unique', $config['form']['require_unique']);

src/Event/PostBarcodeCheckEvent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace Loevgaard\SyliusBarcodePlugin\Event;
66

77
use Loevgaard\SyliusBarcodePlugin\Model\BarcodeAwareInterface;
8-
use Symfony\Component\EventDispatcher\Event;
8+
use Symfony\Contracts\EventDispatcher\Event;
99

1010
final class PostBarcodeCheckEvent extends Event
1111
{

src/Event/PreBarcodeCheckEvent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace Loevgaard\SyliusBarcodePlugin\Event;
66

77
use Loevgaard\SyliusBarcodePlugin\Model\BarcodeAwareInterface;
8-
use Symfony\Component\EventDispatcher\Event;
8+
use Symfony\Contracts\EventDispatcher\Event;
99

1010
final class PreBarcodeCheckEvent extends Event
1111
{

0 commit comments

Comments
 (0)