Skip to content

Commit

Permalink
New dir structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Prometee committed Dec 19, 2024
1 parent c62afb5 commit 923349a
Show file tree
Hide file tree
Showing 18 changed files with 34 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:

-
name: Run ECS
run: vendor/bin/ecs check src
run: vendor/bin/ecs check
if: always() && steps.end-of-setup.outcome == 'success'

-
Expand Down
9 changes: 5 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@
"friends-of-behat/variadic-extension": "^1.3",
"nyholm/psr7": "^1.4",
"phpspec/phpspec": "^7.0",
"phpstan/extension-installer": "^1.2",
"phpstan/phpstan-doctrine": "^1",
"phpstan/phpstan-strict-rules": "^1",
"phpstan/phpstan-webmozart-assert": "^1",
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan": "^1.12",
"phpstan/phpstan-doctrine": "^1.5",
"phpstan/phpstan-symfony": "^1.4",
"phpstan/phpstan-webmozart-assert": "^1.2",
"phpunit/phpunit": "^10",
"polishsymfonycommunity/symfony-mocker-container": "^1.0",
"robertfausk/behat-panther-extension": "^1.1",
Expand Down
File renamed without changes.
13 changes: 7 additions & 6 deletions ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

declare(strict_types=1);

use PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer;
use Symplify\EasyCodingStandard\Config\ECSConfig;

return static function (ECSConfig $config): void {
$config->import('vendor/sylius-labs/coding-standard/ecs.php');
$config->paths([
return ECSConfig::configure()
->withSets([
'vendor/sylius-labs/coding-standard/ecs.php',
])
->withPaths([
'src',
'tests',
]);
};
])
;
6 changes: 6 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
includes:
- 'phpstan.neon.dist'

parameters:
editorUrl: '%%file%%:%%line%%'

17 changes: 1 addition & 16 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -1,22 +1,7 @@
parameters:
reportUnmatchedIgnoredErrors: false
checkMissingIterableValueType: false

level: max

paths:
- src
- tests

excludePaths:
# Makes PHPStan crash
- 'src/DependencyInjection/Configuration.php'

- tests/Application/Kernel.php
- tests/Application/public/index.php
- tests/Application/config/**.php
- tests/Application/var/**.php
- tests/Application/node_modules/**.php

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\./'
- tests/Behat
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@ public function process(ContainerBuilder $container): void
if (false === $container->has(ClientInterface::class)) {
$container->setDefinition(
ClientInterface::class,
new Definition(Psr18Client::class)
new Definition(Psr18Client::class),
);
}

if (false === $container->has(RequestFactoryInterface::class)) {
$container->setDefinition(
RequestFactoryInterface::class,
new Definition(Psr17Factory::class)
new Definition(Psr17Factory::class),
);
}

if (false === $container->has(StreamFactoryInterface::class)) {
$container->setDefinition(
StreamFactoryInterface::class,
new Definition(Psr17Factory::class)
new Definition(Psr17Factory::class),
);
}
}
Expand Down
7 changes: 3 additions & 4 deletions src/DependencyInjection/FluxSESyliusHCaptchaExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\Extension;
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;

final class FluxSESyliusHCaptchaExtension extends Extension implements PrependExtensionInterface
final class FluxSESyliusHCaptchaExtension extends Extension
{
public function load(array $configs, ContainerBuilder $container): void
{
Expand All @@ -27,7 +26,7 @@ public function prepend(ContainerBuilder $container): void
'form_themes' => [
'@FluxSESyliusHCaptchaPlugin/hcaptcha.html.twig',
],
]
],
);
}

Expand All @@ -53,7 +52,7 @@ public function prepend(ContainerBuilder $container): void
],
],
],
]
],
);
}
}
Expand Down
5 changes: 5 additions & 0 deletions src/FluxSESyliusHCaptchaPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,9 @@ public function build(ContainerBuilder $container): void
->addCompilerPass(new SymfonyHttpClientCompilerPass())
;
}

public function getPath(): string
{
return dirname(__DIR__);
}
}
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/Application/config/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@

$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) ?: 'dev';
$_SERVER['APP_DEBUG'] = $_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? 'prod' !== $_SERVER['APP_ENV'];
$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = (int) $_SERVER['APP_DEBUG'] || filter_var($_SERVER['APP_DEBUG'], FILTER_VALIDATE_BOOLEAN) ? '1' : '0';
$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = (int) $_SERVER['APP_DEBUG'] || filter_var($_SERVER['APP_DEBUG'], \FILTER_VALIDATE_BOOLEAN) ? '1' : '0';
2 changes: 2 additions & 0 deletions tests/Application/config/sylius/1.12/bundles.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
BabDev\PagerfantaBundle\BabDevPagerfantaBundle::class => ['all' => true],
SyliusLabs\Polyfill\Symfony\Security\Bundle\SyliusLabsPolyfillSymfonySecurityBundle::class => ['all' => true],
Expand Down
3 changes: 0 additions & 3 deletions tests/Behat/Context/Ui/Shop/CaptchaContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ final class CaptchaContext implements Context
/** @var PageInterface */
private $page;

/**
* @param PageInterface $page
*/
public function __construct(PageInterface $page)
{
$this->page = $page;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 923349a

Please sign in to comment.