diff --git a/.gitignore b/.gitignore index 16bc576..cab7f77 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ /.idea /vendor -.php_cs.cache -/composer.lock \ No newline at end of file +.php-cs-fixer.cache +/composer.lock diff --git a/composer.json b/composer.json index a2f8f83..794aa0e 100644 --- a/composer.json +++ b/composer.json @@ -32,15 +32,16 @@ "minimum-stability": "dev", "prefer-stable": true, "require-dev": { + "enlightn/security-checker": "^1.9", + "friendsofphp/php-cs-fixer": "^3.8", + "php-parallel-lint/php-parallel-lint": "^1.0", "phpmd/phpmd": "^2.8", "phpro/grumphp": "^1.1.0", "phpspec/phpspec": "^7.2", - "phpstan/phpstan": "1.5.4", - "php-parallel-lint/php-parallel-lint": "^1.0", - "enlightn/security-checker": "^1.9", - "friendsofphp/php-cs-fixer": "^2.18" + "phpstan/phpstan": "1.5.4" }, "config": { + "sort-packages": true, "allow-plugins": { "phpro/grumphp": true } diff --git a/grumphp.yml b/grumphp.yml index b724f2e..681c7d5 100644 --- a/grumphp.yml +++ b/grumphp.yml @@ -28,4 +28,4 @@ grumphp: securitychecker_enlightn: ~ phpcsfixer2: allow_risky: true - config: 'ruleset/.php_cs' \ No newline at end of file + config: 'ruleset/.php-cs-fixer.php' diff --git a/ruleset/.php_cs b/ruleset/.php-cs-fixer.php similarity index 77% rename from ruleset/.php_cs rename to ruleset/.php-cs-fixer.php index f5b813b..ae07cf9 100644 --- a/ruleset/.php_cs +++ b/ruleset/.php-cs-fixer.php @@ -9,17 +9,15 @@ $config ->setRiskyAllowed(true) ->setRules([ + 'psr_autoloading' => true, '@PSR1' => true, '@PSR2' => true, - 'psr0' => true, - 'psr4' => true, 'ordered_imports' => true, - 'no_extra_consecutive_blank_lines' => ['use'], + 'no_extra_blank_lines' => true, 'php_unit_namespaced' => ['target' => '6.0'], 'php_unit_expectation' => true, - ]) ->setFinder($finder) ; -return $config; \ No newline at end of file +return $config; diff --git a/src/Synolia/Bundle/StockAlertBundle/Async/StockAlertNotificationProcessor.php b/src/Synolia/Bundle/StockAlertBundle/Async/StockAlertNotificationProcessor.php index 878d2e4..d1ea41a 100644 --- a/src/Synolia/Bundle/StockAlertBundle/Async/StockAlertNotificationProcessor.php +++ b/src/Synolia/Bundle/StockAlertBundle/Async/StockAlertNotificationProcessor.php @@ -44,8 +44,7 @@ public function __construct( Mailer $mailer, TranslatorInterface $translator, Environment $twig - ) - { + ) { $this->configManager = $configManager; $this->mailer = $mailer; $this->translator = $translator; diff --git a/src/Synolia/Bundle/StockAlertBundle/Entity/Repository/StockAlertRepository.php b/src/Synolia/Bundle/StockAlertBundle/Entity/Repository/StockAlertRepository.php index 6a071be..3e20aea 100644 --- a/src/Synolia/Bundle/StockAlertBundle/Entity/Repository/StockAlertRepository.php +++ b/src/Synolia/Bundle/StockAlertBundle/Entity/Repository/StockAlertRepository.php @@ -4,8 +4,8 @@ namespace Synolia\Bundle\StockAlertBundle\Entity\Repository; -use Oro\Bundle\ProductBundle\Entity\Product; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; +use Oro\Bundle\ProductBundle\Entity\Product; class StockAlertRepository extends ServiceEntityRepository { diff --git a/src/Synolia/Bundle/StockAlertBundle/Entity/StockAlert.php b/src/Synolia/Bundle/StockAlertBundle/Entity/StockAlert.php index b31a1cd..ab12395 100644 --- a/src/Synolia/Bundle/StockAlertBundle/Entity/StockAlert.php +++ b/src/Synolia/Bundle/StockAlertBundle/Entity/StockAlert.php @@ -77,7 +77,6 @@ class StockAlert extends ExtendStockAlert implements */ protected $expirationDate; - public function getId(): int { return $this->id; diff --git a/src/Synolia/Bundle/StockAlertBundle/Handler/StockAlertHandler.php b/src/Synolia/Bundle/StockAlertBundle/Handler/StockAlertHandler.php index c9cf4cd..1873cd4 100644 --- a/src/Synolia/Bundle/StockAlertBundle/Handler/StockAlertHandler.php +++ b/src/Synolia/Bundle/StockAlertBundle/Handler/StockAlertHandler.php @@ -94,7 +94,6 @@ private function getExpirationDate(): DateTime return (new DateTime())->add(new DateInterval('P3M')); } - private function getStockAlert(Product $product, CustomerUser $user, Organization $organization) { $stockAlertRepository = $this->entityManager->getRepository(StockAlert::class);