Skip to content

Commit

Permalink
Update php-cs-fixer configuration from api-platform/core
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentchalamon committed Dec 29, 2021
1 parent 9be3d1d commit 6201bc2
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 25 deletions.
50 changes: 39 additions & 11 deletions .php-cs-fixer.dist.php
Expand Up @@ -11,9 +11,9 @@
file that was distributed with this source code.
HEADER;

$finder = (new PhpCsFixer\Finder())
$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude(['features', 'flex'])
->exclude(['features/var', 'flex'])
;

return (new PhpCsFixer\Config())
Expand All @@ -26,7 +26,7 @@
'@Symfony' => true,
'@Symfony:risky' => true,
'align_multiline_comment' => [
'comment_type' => 'phpdocs_only',
'comment_type' => 'phpdocs_like',
],
'array_indentation' => true,
'array_syntax' => [
Expand All @@ -43,6 +43,18 @@
'after_array_assignments_equals' => false,
'before_array_assignments_equals' => false,
],
'explicit_indirect_variable' => true,
'fully_qualified_strict_types' => true,
'header_comment' => [
'header' => $header,
'location' => 'after_open',
],
'logical_operators' => true,
'multiline_comment_opening_closing' => true,
'multiline_whitespace_before_semicolons' => [
'strategy' => 'no_multi_line',
],
'no_alternative_syntax' => true,
'no_extra_blank_lines' => [
'tokens' => [
'break',
Expand All @@ -56,7 +68,12 @@
'use',
],
],
'no_superfluous_phpdoc_tags' => true,
'no_superfluous_elseif' => true,
'no_superfluous_phpdoc_tags' => [
'allow_mixed' => false,
],
'no_unset_cast' => true,
'no_unset_on_property' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_imports' => [
Expand All @@ -70,16 +87,27 @@
'php_unit_method_casing' => [
'case' => 'camel_case',
],
'php_unit_set_up_tear_down_visibility' => true,
'php_unit_test_annotation' => [
'style' => 'prefix',
],
'phpdoc_add_missing_param_annotation' => [
'only_untyped' => true,
],
'phpdoc_no_alias_tag' => true,
'phpdoc_order' => true,
'phpdoc_trim_consecutive_blank_line_separation' => true,
'phpdoc_var_annotation_correct_order' => true,
'return_assignment' => true,
'strict_comparison' => true,
'strict_param' => true,
'void_return' => true,
'header_comment' => [
'header' => $header,
'location' => 'after_open',
'visibility_required' => [
'elements' => [
'const',
'method',
'property',
],
],
'void_return' => true,
])
->setFinder($finder)
->setCacheFile('.php-cs-fixer.cache') // forward compatibility with 3.x line
;
->setFinder($finder);
4 changes: 2 additions & 2 deletions features/bootstrap.php
Expand Up @@ -17,7 +17,7 @@

// PHPUnit's autoloader
if (!file_exists($phpUnitAutoloaderPath = __DIR__.'/../vendor/bin/.phpunit/phpunit/vendor/autoload.php')) {
die('PHPUnit is not installed. Please run vendor/bin/simple-phpunit --version to install it');
exit('PHPUnit is not installed. Please run vendor/bin/simple-phpunit --version to install it');
}

$phpunitLoader = require $phpUnitAutoloaderPath;
Expand Down Expand Up @@ -45,4 +45,4 @@
$_SERVER += $_ENV;
$_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';
4 changes: 2 additions & 2 deletions features/src/Kernel.php
Expand Up @@ -26,13 +26,13 @@
use Symfony\Bundle\WebProfilerBundle\WebProfilerBundle;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Kernel as HttpKernel;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
use Symfony\Component\HttpKernel\Kernel as HttpKernel;
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
use Symfony\Component\Routing\RouteCollectionBuilder;
use Symfony\Component\Security\Core\User\User;
use Symfony\Component\Security\Core\User\InMemoryUser;
use Symfony\Component\Security\Core\User\User;

/**
* @author Vincent Chalamon <vincentchalamon@gmail.com>
Expand Down
15 changes: 5 additions & 10 deletions src/DependencyInjection/DocusignExtension.php
Expand Up @@ -377,35 +377,30 @@ private function setActionsTraceable(ContainerBuilder $container, string $name):
->setAutowired(true)
->setDecoratedService("docusign.create_document.$name")
->addArgument(new Reference("docusign.decorated_create_document.$name.inner"))
->setPublic(false)
;
->setPublic(false);

$container->register("docusign.decorated_create_signature.$name", TraceableEnvelopeBuilderCallable::class)
->setAutowired(true)
->setDecoratedService("docusign.create_signature.$name")
->addArgument(new Reference("docusign.decorated_create_signature.$name.inner"))
->setPublic(false)
;
->setPublic(false);

$container->register("docusign.decorated_define_envelope.$name", TraceableEnvelopeBuilderCallable::class)
->setAutowired(true)
->setDecoratedService("docusign.define_envelope.$name")
->addArgument(new Reference("docusign.decorated_define_envelope.$name.inner"))
->setPublic(false)
;
->setPublic(false);

$container->register("docusign.decorated_send_envelope.$name", TraceableEnvelopeBuilderCallable::class)
->setAutowired(true)
->setDecoratedService("docusign.send_envelope.$name")
->addArgument(new Reference("docusign.decorated_send_envelope.$name.inner"))
->setPublic(false)
;
->setPublic(false);

$container->register("docusign.decorated_create_recipient.$name", TraceableEnvelopeBuilderCallable::class)
->setAutowired(true)
->setDecoratedService("docusign.get_view_url.$name")
->addArgument(new Reference("docusign.decorated_create_recipient.$name.inner"))
->setPublic(false)
;
->setPublic(false);
}
}

0 comments on commit 6201bc2

Please sign in to comment.