Skip to content

Commit

Permalink
bug Sylius#122 Fix coding standard (loic425, lchrusciel)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.2-dev branch.

Discussion
----------



Commits
-------

691a8b2 Fix coding standard
d8faf58 Allow plugins
c913e3f [Composer] Turn off phpcodesniffer plugin by default
  • Loading branch information
lchrusciel authored Jul 7, 2022
2 parents 804da95 + c913e3f commit 88ab301
Show file tree
Hide file tree
Showing 61 changed files with 178 additions and 178 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
name: Restrict Symfony version
if: matrix.symfony != ''
run: |
composer global config --no-plugins allow-plugins.symfony/flex true
composer global require --no-progress --no-scripts --no-plugins "symfony/flex:^1.10"
composer config extra.symfony.require "${{ matrix.symfony }}"
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
},
"config": {
"allow-plugins": {
"symfony/flex": true
"symfony/flex": true,
"dealerdirect/phpcodesniffer-composer-installer": false
}
},
"extra": {
Expand Down
2 changes: 1 addition & 1 deletion spec/Asset/Installer/AssetsProviderSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function let(
ThemeHierarchyProviderInterface $themeHierarchyProvider,
BundleInterface $acmeBundle,
ThemeInterface $childTheme,
ThemeInterface $parentTheme
ThemeInterface $parentTheme,
) {
$kernel->getBundles()->willReturn([$acmeBundle]);

Expand Down
2 changes: 1 addition & 1 deletion spec/Asset/Installer/LegacyAssetsProviderSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function let(
ThemeHierarchyProviderInterface $themeHierarchyProvider,
BundleInterface $acmeBundle,
ThemeInterface $childTheme,
ThemeInterface $parentTheme
ThemeInterface $parentTheme,
) {
$kernel->getBundles()->willReturn([$acmeBundle]);

Expand Down
10 changes: 5 additions & 5 deletions spec/Asset/Package/PathPackageSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ final class PathPackageSpec extends ObjectBehavior
function let(
VersionStrategyInterface $versionStrategy,
ThemeContextInterface $themeContext,
PathResolverInterface $pathResolver
PathResolverInterface $pathResolver,
): void {
$this->beConstructedWith('/', $versionStrategy, $themeContext, $pathResolver);
}
Expand All @@ -37,7 +37,7 @@ function it_implements_package_interface_interface(): void

function it_returns_vanilla_path_if_there_are_no_active_themes(
ThemeContextInterface $themeContext,
VersionStrategyInterface $versionStrategy
VersionStrategyInterface $versionStrategy,
): void {
$path = 'bundles/sample/asset.js';
$versionedPath = 'bundles/sample/asset.js?v=42';
Expand All @@ -52,7 +52,7 @@ function it_returns_modified_path_if_there_is_active_theme(
ThemeContextInterface $themeContext,
VersionStrategyInterface $versionStrategy,
PathResolverInterface $pathResolver,
ThemeInterface $theme
ThemeInterface $theme,
): void {
$path = 'bundles/sample/asset.js';
$themedPath = 'bundles/theme/foo/bar/sample/asset.js';
Expand All @@ -75,7 +75,7 @@ function it_does_not_prepend_it_with_base_path_if_modified_path_is_an_absolute_o
ThemeContextInterface $themeContext,
VersionStrategyInterface $versionStrategy,
PathResolverInterface $pathResolver,
ThemeInterface $theme
ThemeInterface $theme,
): void {
$path = 'bundles/sample/asset.js';
$themedPath = 'bundles/theme/foo/bar/sample/asset.js';
Expand All @@ -92,7 +92,7 @@ function it_does_not_prepend_it_with_base_path_if_modified_path_is_an_absolute_u
ThemeContextInterface $themeContext,
VersionStrategyInterface $versionStrategy,
PathResolverInterface $pathResolver,
ThemeInterface $theme
ThemeInterface $theme,
): void {
$path = 'bundles/sample/asset.js';
$themedPath = 'bundles/theme/foo/bar/sample/asset.js';
Expand Down
8 changes: 4 additions & 4 deletions spec/Asset/PathResolverSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function it_implements_path_resolver_interface(): void
function it_returns_modified_path_if_its_referencing_bundle_asset(
AssetsProviderInterface $assetsProvider,
FilesystemInterface $filesystem,
ThemeInterface $theme
ThemeInterface $theme,
): void {
$theme->getName()->willReturn('theme/name');

Expand All @@ -60,7 +60,7 @@ function it_returns_modified_path_if_its_referencing_bundle_asset(
function it_returns_modified_path_if_its_referencing_root_asset(
AssetsProviderInterface $assetsProvider,
FilesystemInterface $filesystem,
ThemeInterface $theme
ThemeInterface $theme,
): void {
$theme->getName()->willReturn('theme/name');

Expand All @@ -78,7 +78,7 @@ function it_returns_modified_path_if_its_referencing_root_asset(
function it_prepends_theme_path_if_the_base_path_is_not_found(
AssetsProviderInterface $assetsProvider,
FilesystemInterface $filesystem,
ThemeInterface $theme
ThemeInterface $theme,
): void {
$theme->getName()->willReturn('theme/name');

Expand Down Expand Up @@ -110,7 +110,7 @@ function it_prepends_theme_path_if_the_base_path_is_not_found(
function it_fallbacks_to_default_path_if_could_not_find_themed_asset(
AssetsProviderInterface $assetsProvider,
FilesystemInterface $filesystem,
ThemeInterface $theme
ThemeInterface $theme,
): void {
$theme->getName()->willReturn('theme/name');

Expand Down
2 changes: 1 addition & 1 deletion spec/Configuration/CompositeConfigurationProviderSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function it_returns_empty_array_if_no_configurations_are_loaded(): void

function it_returns_sum_of_configurations_returned_by_nested_configuration_providers(
ConfigurationProviderInterface $firstConfigurationProvider,
ConfigurationProviderInterface $secondConfigurationProvider
ConfigurationProviderInterface $secondConfigurationProvider,
): void {
$this->beConstructedWith([
$firstConfigurationProvider,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function it_implements_loader_interface(): void

function it_processes_the_configuration(
ConfigurationLoaderInterface $decoratedLoader,
ConfigurationProcessorInterface $configurationProcessor
ConfigurationProcessorInterface $configurationProcessor,
): void {
$basicConfiguration = ['name' => 'example/sylius-theme'];

Expand All @@ -48,7 +48,7 @@ function it_processes_the_configuration(

function it_processes_the_configuration_and_extracts_extra_sylius_theme_key_as_another_configuration(
ConfigurationLoaderInterface $decoratedLoader,
ConfigurationProcessorInterface $configurationProcessor
ConfigurationProcessorInterface $configurationProcessor,
): void {
$basicConfiguration = [
'name' => 'example/sylius-theme',
Expand Down
4 changes: 2 additions & 2 deletions spec/Configuration/SymfonyConfigurationProcessorSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function it_implements_configuration_processor_interface(): void

function it_proxies_configuration_processing_to_symfony_configuration_processor(
ConfigurationInterface $configuration,
Processor $processor
Processor $processor,
): void {
$processor
->processConfiguration($configuration, [['name' => 'example/theme']])
Expand All @@ -44,7 +44,7 @@ function it_proxies_configuration_processing_to_symfony_configuration_processor(

function it_does_not_catch_any_exception_thrown_by_symfony_configuration_processor(
ConfigurationInterface $configuration,
Processor $processor
Processor $processor,
): void {
$processor
->processConfiguration($configuration, [])
Expand Down
6 changes: 3 additions & 3 deletions spec/Controller/ThemeScreenshotControllerSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function it_streams_screenshot_as_a_response(ThemeRepositoryInterface $themeRepo

function it_throws_not_found_http_exception_if_screenshot_cannot_be_found(
ThemeRepositoryInterface $themeRepository,
ThemeInterface $theme
ThemeInterface $theme,
): void {
$themeRepository->findOneByName('theme/name')->willReturn($theme);

Expand All @@ -63,15 +63,15 @@ function it_throws_not_found_http_exception_if_screenshot_cannot_be_found(
$this
->shouldThrow(new NotFoundHttpException(sprintf(
'Screenshot "%s/screenshot/1-awesome.jpg" does not exist',
$this->fixturesPath
$this->fixturesPath,
)))
->during('streamScreenshotAction', ['theme/name', 1])
;
}

function it_throws_not_found_http_exception_if_screenshot_number_exceeds_the_number_of_theme_screenshots(
ThemeRepositoryInterface $themeRepository,
ThemeInterface $theme
ThemeInterface $theme,
): void {
$themeRepository->findOneByName('theme/name')->willReturn($theme);

Expand Down
6 changes: 3 additions & 3 deletions spec/Loader/CircularDependencyCheckerSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function it_implements_circular_dependency_checker_interface(): void
}

function it_does_not_find_circular_dependency_if_checking_a_theme_without_any_parents(
ThemeInterface $theme
ThemeInterface $theme,
): void {
$theme->getParents()->willReturn([]);

Expand All @@ -37,7 +37,7 @@ function it_does_not_find_circular_dependency_if_theme_parents_are_not_cycled(
ThemeInterface $firstTheme,
ThemeInterface $secondTheme,
ThemeInterface $thirdTheme,
ThemeInterface $fourthTheme
ThemeInterface $fourthTheme,
): void {
$firstTheme->getParents()->willReturn([$secondTheme, $thirdTheme]);
$secondTheme->getParents()->willReturn([$thirdTheme, $fourthTheme]);
Expand All @@ -51,7 +51,7 @@ function it_finds_circular_dependency_if_theme_parents_are_cycled(
ThemeInterface $firstTheme,
ThemeInterface $secondTheme,
ThemeInterface $thirdTheme,
ThemeInterface $fourthTheme
ThemeInterface $fourthTheme,
): void {
$firstTheme->getParents()->willReturn([$secondTheme, $thirdTheme]);
$secondTheme->getParents()->willReturn([$thirdTheme]);
Expand Down
4 changes: 2 additions & 2 deletions spec/Loader/CircularDependencyFoundExceptionSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function it_transforms_a_cycle_to_user_friendly_message(
ThemeInterface $firstTheme,
ThemeInterface $secondTheme,
ThemeInterface $thirdTheme,
ThemeInterface $fourthTheme
ThemeInterface $fourthTheme,
): void {
$this->beConstructedWith([$firstTheme, $secondTheme, $thirdTheme, $fourthTheme, $thirdTheme]);

Expand All @@ -53,7 +53,7 @@ function it_throws_another_exception_if_there_is_no_cycle_in_given_elements(
ThemeInterface $firstTheme,
ThemeInterface $secondTheme,
ThemeInterface $thirdTheme,
ThemeInterface $fourthTheme
ThemeInterface $fourthTheme,
): void {
$this->beConstructedWith([$firstTheme, $secondTheme, $thirdTheme, $fourthTheme]);

Expand Down
16 changes: 8 additions & 8 deletions spec/Loader/ThemeLoaderSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ function let(
ThemeFactoryInterface $themeFactory,
ThemeAuthorFactoryInterface $themeAuthorFactory,
ThemeScreenshotFactoryInterface $themeScreenshotFactory,
CircularDependencyCheckerInterface $circularDependencyChecker
CircularDependencyCheckerInterface $circularDependencyChecker,
): void {
$this->beConstructedWith(
$configurationProvider,
$themeFactory,
$themeAuthorFactory,
$themeScreenshotFactory,
$circularDependencyChecker
$circularDependencyChecker,
);
}

Expand All @@ -53,7 +53,7 @@ function it_implements_theme_loader_interface(): void
function it_loads_a_single_theme(
ConfigurationProviderInterface $configurationProvider,
ThemeFactoryInterface $themeFactory,
CircularDependencyCheckerInterface $circularDependencyChecker
CircularDependencyCheckerInterface $circularDependencyChecker,
): void {
$theme = new Theme('first/theme', '/theme/path');

Expand All @@ -79,7 +79,7 @@ function it_loads_a_theme_with_author(
ConfigurationProviderInterface $configurationProvider,
ThemeFactoryInterface $themeFactory,
ThemeAuthorFactoryInterface $themeAuthorFactory,
CircularDependencyCheckerInterface $circularDependencyChecker
CircularDependencyCheckerInterface $circularDependencyChecker,
): void {
$theme = new Theme('first/theme', '/theme/path');

Expand Down Expand Up @@ -111,7 +111,7 @@ function it_loads_a_theme_with_screenshot(
ConfigurationProviderInterface $configurationProvider,
ThemeFactoryInterface $themeFactory,
ThemeScreenshotFactoryInterface $themeScreenshotFactory,
CircularDependencyCheckerInterface $circularDependencyChecker
CircularDependencyCheckerInterface $circularDependencyChecker,
): void {
$theme = new Theme('first/theme', '/theme/path');

Expand Down Expand Up @@ -144,7 +144,7 @@ function it_loads_a_theme_with_screenshot(
function it_loads_a_theme_with_its_dependency(
ConfigurationProviderInterface $configurationProvider,
ThemeFactoryInterface $themeFactory,
CircularDependencyCheckerInterface $circularDependencyChecker
CircularDependencyCheckerInterface $circularDependencyChecker,
): void {
$firstTheme = new Theme('first/theme', '/first/theme/path');
$secondTheme = new Theme('second/theme', '/second/theme/path');
Expand Down Expand Up @@ -182,7 +182,7 @@ function it_loads_a_theme_with_its_dependency(

function it_throws_an_exception_if_requires_not_existing_dependency(
ConfigurationProviderInterface $configurationProvider,
ThemeFactoryInterface $themeFactory
ThemeFactoryInterface $themeFactory,
): void {
$firstTheme = new Theme('first/theme', '/theme/path');

Expand All @@ -207,7 +207,7 @@ function it_throws_an_exception_if_requires_not_existing_dependency(
function it_throws_an_exception_if_there_is_a_circular_dependency_found(
ConfigurationProviderInterface $configurationProvider,
ThemeFactoryInterface $themeFactory,
CircularDependencyCheckerInterface $circularDependencyChecker
CircularDependencyCheckerInterface $circularDependencyChecker,
): void {
$firstTheme = new Theme('first/theme', '/first/theme/path');
$secondTheme = new Theme('second/theme', '/second/theme/path');
Expand Down
12 changes: 6 additions & 6 deletions spec/Locator/RecursiveFileLocatorSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function it_searches_for_files(
FinderFactoryInterface $finderFactory,
Finder $finder,
SplFileInfo $firstSplFileInfo,
SplFileInfo $secondSplFileInfo
SplFileInfo $secondSplFileInfo,
): void {
$finderFactory->create()->willReturn($finder);

Expand Down Expand Up @@ -82,7 +82,7 @@ function it_searches_for_files_at_a_maximum_depth(
FinderFactoryInterface $finderFactory,
Finder $finder,
SplFileInfo $firstSplFileInfo,
SplFileInfo $secondSplFileInfo
SplFileInfo $secondSplFileInfo,
): void {
$this->beConstructedWith($finderFactory, ['/search/path/'], 1);
$finderFactory->create()->willReturn($finder);
Expand Down Expand Up @@ -118,7 +118,7 @@ function it_throws_an_exception_if_searching_for_files_with_empty_name(): void

function it_throws_an_exception_if_there_is_no_file_that_matches_the_given_name(
FinderFactoryInterface $finderFactory,
Finder $finder
Finder $finder,
): void {
$finderFactory->create()->willReturn($finder);

Expand All @@ -135,7 +135,7 @@ function it_throws_an_exception_if_there_is_no_file_that_matches_the_given_name(

function it_throws_an_exception_if_there_is_there_are_not_any_files_that_matches_the_given_name(
FinderFactoryInterface $finderFactory,
Finder $finder
Finder $finder,
): void {
$finderFactory->create()->willReturn($finder);

Expand All @@ -154,7 +154,7 @@ function it_isolates_finding_paths_from_multiple_sources(
FinderFactoryInterface $finderFactory,
Finder $firstFinder,
Finder $secondFinder,
SplFileInfo $splFileInfo
SplFileInfo $splFileInfo,
): void {
$this->beConstructedWith($finderFactory, ['/search/path/first/', '/search/path/second/']);

Expand Down Expand Up @@ -186,7 +186,7 @@ function it_silences_finder_exceptions_even_if_searching_in_multiple_sources(
FinderFactoryInterface $finderFactory,
Finder $firstFinder,
Finder $secondFinder,
SplFileInfo $splFileInfo
SplFileInfo $splFileInfo,
): void {
$this->beConstructedWith($finderFactory, ['/search/path/first/', '/search/path/second/']);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function it_implements_translation_resource_finder_interface(): void

function it_returns_an_array_of_translation_resources_paths(
FinderFactoryInterface $finderFactory,
Finder $finder
Finder $finder,
): void {
$finderFactory->create()->willReturn($finder);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function it_is_a_translation_files_finder(): void
}

function it_puts_application_translations_files_before_bundle_translations_files(
TranslationFilesFinderInterface $translationFilesFinder
TranslationFilesFinderInterface $translationFilesFinder,
): void {
$translationFilesFinder->findTranslationFiles('/some/path/to/theme')->willReturn([
'/some/path/to/theme/AcmeBundle/translations/messages.en.yml',
Expand Down
4 changes: 2 additions & 2 deletions spec/Translation/Finder/TranslationFilesFinderSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function it_implements_translation_resource_finder_interface(): void

function it_returns_an_array_of_translation_resources_paths(
FinderFactoryInterface $finderFactory,
Finder $finder
Finder $finder,
): void {
$finderFactory->create()->willReturn($finder);

Expand All @@ -53,7 +53,7 @@ function it_returns_an_array_of_translation_resources_paths(

function it_does_not_provide_any_translation_resources_paths_if_translation_directory_does_not_exist(
FinderFactoryInterface $finderFactory,
Finder $finder
Finder $finder,
): void {
$finderFactory->create()->willReturn($finder);

Expand Down
Loading

0 comments on commit 88ab301

Please sign in to comment.