Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAD-14978 Apply PSR12 coding standard #31

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?php

ini_set('memory_limit', -1);

use PhpCsFixer\Config;
use PhpCsFixer\Finder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
use Symplify\CodingStandard\Fixer\ArrayNotation\StandaloneLineInMultilineArrayFixer;

$container = new ContainerBuilder();
$phpLoader = new PhpFileLoader($container, new FileLocator());
$instanceof = [];
$configurator = new ContainerConfigurator($container, $phpLoader, $instanceof, __DIR__, __FILE__);
$services = $configurator->services();
$services
->defaults()
->autowire()
->autowire()
->autoconfigure()
->load('Symplify\CodingStandard\\', __DIR__ . '/vendor/symplify/coding-standard/src/*')
->load('PhpCsFixer\\', __DIR__ . '/vendor/friendsofphp/php-cs-fixer/src/*')
->set(StandaloneLineInMultilineArrayFixer::class)
->public(true)
;
$container->compile();

$finder = (new Finder())
->in(__DIR__)
;

return (new Config())
->setRiskyAllowed(true)
->registerCustomFixers([
$container->get(StandaloneLineInMultilineArrayFixer::class),
])
->setRules(
[
'@PSR12' => true,
'@PhpCsFixer' => true,
'blank_line_after_opening_tag' => true,
'linebreak_after_opening_tag' => true,
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'no_unused_imports' => true,
'unary_operator_spaces' => true,
'binary_operator_spaces' => true,
'no_superfluous_phpdoc_tags' => false,
'phpdoc_no_package' => false,
'phpdoc_no_empty_return' => false,
'phpdoc_no_useless_inheritdoc' => false,
'concat_space' => ['spacing' => 'one'],
'method_argument_space' => [
'on_multiline' => 'ensure_fully_multiline',
],
'control_structure_braces' => true,
'clean_namespace' => true,
'single_import_per_statement' => true,
'single_line_after_imports' => true,
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'backtick_to_shell_exec' => true,
'no_extra_blank_lines' => true,
'single_space_around_construct' => true,
'indentation_type' => true,
'no_trailing_whitespace' => true,
'method_chaining_indentation' => true,
'Nocworx/codingstandard' => true,
'phpdoc_to_param_type' => false,
'phpdoc_to_property_type' => false,
'phpdoc_to_return_type' => false,
]
)
->setFinder($finder);
69 changes: 0 additions & 69 deletions NocWorx/Helpers/Annotation.php

This file was deleted.

109 changes: 0 additions & 109 deletions NocWorx/Helpers/AnnotationHelper.php

This file was deleted.

50 changes: 0 additions & 50 deletions NocWorx/Helpers/CatchHelper.php

This file was deleted.

56 changes: 0 additions & 56 deletions NocWorx/Helpers/ClassHelper.php

This file was deleted.

Loading