Skip to content
Snippets Groups Projects
Select Git revision
  • cc22deb2f43986f62aa86a6dbc0db5a40430f06c
  • main default protected
  • register-logging-channel
  • expr-lang
  • ci-82
  • attr-events
  • locale-wip
  • custom-routes
  • v0.1.85
  • v0.1.84
  • v0.1.83
  • v0.1.82
  • v0.1.81
  • v0.1.80
  • v0.1.79
  • v0.1.78
  • v0.1.77
  • v0.1.76
  • v0.1.75
  • v0.1.74
  • v0.1.73
  • v0.1.72
  • v0.1.71
  • v0.1.70
  • v0.1.69
  • v0.1.68
  • v0.1.67
  • v0.1.65
28 results

.php-cs-fixer.dist.php

    • Reiter, Christoph's avatar
      00cef2a7
      Add a locale service for working with the the active locale · 00cef2a7
      Reiter, Christoph authored
      We currently configure symfony to apply the "Accept-Language"
      header to all requests, so there remain only two cases where
      we need to manually adjust things:
      
      * In case an endpoint renders HTML that is displayed in an iframe
      or popup we still need to provide an option to pass a language via
      a query parameter. This then takes precedence over the header.
      
      * In case we need a language identifier for another service, where
      we need to request an external resource for a specific language.
      In this case we either need to take the request language or in case
      we are in a CLI context the default locale configured in symfony.
      00cef2a7
      History
      Add a locale service for working with the the active locale
      Reiter, Christoph authored
      We currently configure symfony to apply the "Accept-Language"
      header to all requests, so there remain only two cases where
      we need to manually adjust things:
      
      * In case an endpoint renders HTML that is displayed in an iframe
      or popup we still need to provide an option to pass a language via
      a query parameter. This then takes precedence over the header.
      
      * In case we need a language identifier for another service, where
      we need to request an external resource for a specific language.
      In this case we either need to take the request language or in case
      we are in a CLI context the default locale configured in symfony.
    .php-cs-fixer.dist.php 645 B
    <?php
    
    $finder = PhpCsFixer\Finder::create()
        ->in(__DIR__)
        ->exclude('var')
    ;
    
    $config = new PhpCsFixer\Config();
    $config->setRules([
        '@Symfony' => true,
        '@PHP70Migration' => true,
        '@PHP71Migration' => true,
        '@PHP73Migration' => true,
        '@DoctrineAnnotation' => true,
        'doctrine_annotation_array_assignment' => ['operator' => '='],
        'yoda_style' => false,
        'strict_comparison' => true,
        'strict_param' => true,
        'declare_strict_types' => true,
        'method_argument_space' => ['on_multiline' => 'ignore'],
        'phpdoc_to_comment' => false,
    ])
    ->setRiskyAllowed(true)
    ->setFinder($finder);
    
    return $config;