Skip to content

Commit 0e5e6bc

Browse files
WIP
1 parent dad5ede commit 0e5e6bc

13 files changed

Lines changed: 133 additions & 43 deletions

composer.json

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,34 @@
66
"require": {
77
"php": "^7.3",
88
"setono/doctrine-orm-batcher-bundle": "^0.3.1",
9-
"sylius/sylius": "^1.3",
9+
"sylius/core-bundle": "^1.0",
10+
"symfony/config": "^4.4 || ^5.0",
11+
"symfony/dependency-injection": "^4.4 || ^5.0",
1012
"symfony/event-dispatcher": "^4.4 || ^5.0",
13+
"symfony/http-kernel": "^4.4 || ^5.1.5",
1114
"symfony/messenger": "^4.4 || ^5.0",
1215
"thecodingmachine/safe": "^1.0",
1316
"violuke/php-barcodes": "^1.0"
1417
},
1518
"require-dev": {
16-
"behat/behat": "^3.4",
17-
"behat/mink": "^1.7@dev",
18-
"behat/mink-browserkit-driver": "^1.3",
19-
"behat/mink-extension": "^2.2",
20-
"behat/mink-selenium2-driver": "^1.3",
21-
"ergebnis/composer-normalize": "^2.0",
22-
"friends-of-behat/page-object-extension": "^0.3",
23-
"friends-of-behat/suite-settings-extension": "^1.0",
24-
"friends-of-behat/symfony-extension": "^2.0",
25-
"friends-of-behat/variadic-extension": "^1.1",
26-
"lakion/mink-debug-extension": "^1.2.3",
27-
"phpspec/phpspec": "^6.1",
28-
"phpstan/phpstan": "^0.12",
29-
"phpstan/phpstan-doctrine": "^0.12",
30-
"phpstan/phpstan-strict-rules": "^0.12",
31-
"phpstan/phpstan-webmozart-assert": "^0.12",
32-
"phpunit/phpunit": "^8.3",
19+
"api-platform/core": "^2.5",
20+
"doctrine/persistence": "^1.3.8",
21+
"lexik/jwt-authentication-bundle": "^2.8",
22+
"phpspec/phpspec": "^6.2",
23+
"phpunit/phpunit": "^9.2",
3324
"roave/security-advisories": "dev-master",
3425
"sensiolabs/security-checker": "^5.0",
35-
"sylius-labs/coding-standard": "^3.1",
26+
"setono/code-quality-pack": "^1.4",
27+
"setono/sylius-behat-pack": "^0.1.0",
28+
"sylius/sylius": "^1.8",
3629
"symfony/browser-kit": "^4.4 || ^5.0",
3730
"symfony/debug-bundle": "^4.4 || ^5.0",
3831
"symfony/dotenv": "^4.4 || ^5.0",
3932
"symfony/intl": "^4.4 || ^5.0",
40-
"symfony/web-profiler-bundle": "^4.4 || ^5.0",
41-
"symfony/web-server-bundle": "^4.4 || ^5.0",
42-
"thecodingmachine/phpstan-safe-rule": "^1.0"
33+
"symfony/maker-bundle": "^1.15",
34+
"symfony/property-info": "^5.0",
35+
"symfony/serializer": "^5.0",
36+
"symfony/web-profiler-bundle": "^4.4 || ^5.0"
4337
},
4438
"config": {
4539
"sort-packages": true
@@ -102,9 +96,9 @@
10296
],
10397
"phpspec": "vendor/bin/phpspec run",
10498
"phpunit": "vendor/bin/phpunit",
105-
"run": [
99+
"server-run": [
106100
"@ensure-env-copied",
107-
"(cd tests/Application && bin/console server:run -d public -e ${SYMFONY_ENV:-'dev'})"
101+
"(cd tests/Application && symfony server:start --daemon)"
108102
],
109103
"tests": [
110104
"@phpspec",
@@ -115,7 +109,7 @@
115109
"@ensure-vendors-installed",
116110
"@assets",
117111
"@fixtures",
118-
"@run"
112+
"@server-run"
119113
]
120114
}
121115
}

phpstan-baseline.neon

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: "#^Method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch\\(\\) invoked with 2 parameters, 1 required\\.$#"
5+
count: 2
6+
path: src/BarcodeChecker/BarcodeChecker.php
7+
8+
-
9+
message: "#^Call to function method_exists\\(\\) with 'Symfony\\\\\\\\Component\\\\\\\\Config\\\\\\\\Definition\\\\\\\\Builder\\\\\\\\TreeBuilder' and 'getRootNode' will always evaluate to true\\.$#"
10+
count: 1
11+
path: src/DependencyInjection/Configuration.php
12+
13+
-
14+
message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#"
15+
count: 1
16+
path: src/DependencyInjection/Configuration.php
17+
18+
-
19+
message: "#^Parameter \\#1 \\$configuration of method Symfony\\\\Component\\\\DependencyInjection\\\\Extension\\\\Extension\\:\\:processConfiguration\\(\\) expects Symfony\\\\Component\\\\Config\\\\Definition\\\\ConfigurationInterface, Symfony\\\\Component\\\\Config\\\\Definition\\\\ConfigurationInterface\\|null given\\.$#"
20+
count: 1
21+
path: src/DependencyInjection/LoevgaardSyliusBarcodeExtension.php
22+

phpstan.neon

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
includes:
2-
- vendor/phpstan/phpstan-doctrine/extension.neon
3-
- vendor/phpstan/phpstan-webmozart-assert/extension.neon
4-
- vendor/phpstan/phpstan-strict-rules/rules.neon
5-
- vendor/thecodingmachine/phpstan-safe-rule/phpstan-safe-rule.neon
2+
- phpstan-baseline.neon
63

74
parameters:
8-
reportUnmatchedIgnoredErrors: true
95
checkMissingIterableValueType: false
106

11-
excludes_analyse:
12-
# Makes PHPStan crash
13-
- 'src/DependencyInjection/Configuration.php'
7+
level: max
8+
9+
paths:
10+
- src/
1411

15-
ignoreErrors:
16-
- '/Parameter #1 \$configuration of method .+processConfiguration\(\) expects .+ConfigurationInterface, .+ConfigurationInterface\|null given\./'
17-
- '/Method Symfony\\Contracts\\EventDispatcher\\EventDispatcherInterface\:\:dispatch\(\) invoked with 2 parameters, 1 required\./'
12+
reportUnmatchedIgnoredErrors: true

phpunit.xml.dist

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
</testsuite>
1111
</testsuites>
1212

13+
<filter>
14+
<whitelist addUncoveredFilesFromWhitelist="true" processUncoveredFilesFromWhitelist="true">
15+
<directory suffix=".php">src/</directory>
16+
</whitelist>
17+
</filter>
18+
1319
<php>
1420
<env name="APP_ENV" value="test"/>
1521
<env name="SHELL_VERBOSITY" value="-1" />

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']);

tests/Application/.env

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,11 @@ DATABASE_URL=mysql://root@127.0.0.1/sylius_barcode_%kernel.environment%?serverVe
2121
# Delivery is disabled by default via "null://localhost"
2222
MAILER_URL=smtp://localhost
2323
###< symfony/swiftmailer-bundle ###
24+
25+
###> lexik/jwt-authentication-bundle ###
26+
JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private.pem
27+
JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public.pem
28+
JWT_PASSPHRASE=acme_plugin_development
29+
###< lexik/jwt-authentication-bundle ###
30+
31+
SYLIUS_ADMIN_ROUTING_PATH_NAME=admin

tests/Application/config/bundles.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,9 @@
5757
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true],
5858
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true],
5959
FriendsOfBehat\SymfonyExtension\Bundle\FriendsOfBehatSymfonyExtensionBundle::class => ['test' => true, 'test_cached' => true],
60+
61+
ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true],
62+
Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle::class => ['all' => true],
63+
Sylius\Bundle\ApiBundle\SyliusApiBundle::class => ['all' => true],
64+
SyliusLabs\DoctrineMigrationsExtraBundle\SyliusLabsDoctrineMigrationsExtraBundle::class => ['all' => true],
6065
];

tests/Application/config/packages/_sylius.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ imports:
55
- { resource: "@SyliusAdminApiBundle/Resources/config/app/config.yml" }
66

77
- { resource: "@SyliusShopBundle/Resources/config/app/config.yml" }
8+
- { resource: "@SyliusApiBundle/Resources/config/app/config.yaml" }
89

910
parameters:
1011
sylius_core.public_dir: '%kernel.project_dir%/public'
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
doctrine_migrations:
2-
dir_name: "%kernel.project_dir%/src/Migrations"
3-
4-
# Namespace is arbitrary but should be different from App\Migrations as migrations classes should NOT be autoloaded
5-
namespace: DoctrineMigrations
2+
migrations_paths:
3+
# namespace is arbitrary but should be different from App\Migrations
4+
# as migrations classes should NOT be autoloaded
5+
'DoctrineMigrations': '%kernel.project_dir%/src/Migrations'
6+
storage:
7+
table_storage:
8+
table_name: 'migration_versions'
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
lexik_jwt_authentication:
2+
secret_key: '%env(resolve:JWT_SECRET_KEY)%'
3+
public_key: '%env(resolve:JWT_PUBLIC_KEY)%'
4+
pass_phrase: '%env(JWT_PASSPHRASE)%'

0 commit comments

Comments
 (0)