diff --git a/.php_cs b/.php_cs index ece9fe6..f05ae46 100644 --- a/.php_cs +++ b/.php_cs @@ -1,24 +1,57 @@ , Leuchtfeuer Digital Marketing +COMMENT; + + +$finder = PhpCsFixer\Finder::create() + ->name('*.php') + ->in(__DIR__) + ->exclude('Configuration') + ->exclude('Libraries') + ->exclude('Resources') + ->notName('ext_emconf.php') + ->notName('ext_tables.php') + ->notName('ext_localconf.php'); + return PhpCsFixer\Config::create() ->setRiskyAllowed(true) ->setRules([ '@DoctrineAnnotation' => true, '@PSR2' => true, 'array_syntax' => ['syntax' => 'short'], + 'blank_line_after_opening_tag' => true, + 'braces' => ['allow_single_line_closure' => true], 'cast_spaces' => ['space' => 'none'], + 'compact_nullable_typehint' => true, 'concat_space' => ['spacing' => 'one'], - 'declare_equal_normalize' => ['space' => 'single'], + 'declare_equal_normalize' => ['space' => 'none'], 'dir_constant' => true, 'function_typehint_space' => true, 'hash_to_slash_comment' => true, + 'header_comment' => [ + 'header' => $headerComment, + 'comment_type' => 'comment', + 'separate' => 'both', + 'location' => 'after_declare_strict' + ], 'lowercase_cast' => true, + 'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'], 'modernize_types_casting' => true, 'native_function_casing' => true, + 'new_with_braces' => true, 'no_alias_functions' => true, 'no_blank_lines_after_phpdoc' => true, 'no_empty_phpdoc' => true, @@ -48,14 +81,7 @@ return PhpCsFixer\Config::create() 'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'], 'return_type_declaration' => ['space_before' => 'none'], 'single_quote' => true, + 'single_trait_insert_per_statement' => true, 'whitespace_after_comma_in_array' => true, ]) - ->setFinder( - PhpCsFixer\Finder::create() - ->in(__DIR__) - ->exclude('Resources') - ->exclude('Libraries') - ->notName('ext_emconf.php') - ->notName('ext_tables.php') - ->notName('ext_localconf.php') - ); + ->setFinder($finder); diff --git a/Classes/Action/AbstractAction.php b/Classes/Action/AbstractAction.php index 615b863..e9126d0 100644 --- a/Classes/Action/AbstractAction.php +++ b/Classes/Action/AbstractAction.php @@ -1,17 +1,17 @@ , Leuchtfeuer Digital Marketing - * - ***/ + * Florian Wessels , Leuchtfeuer Digital Marketing + */ + +namespace Bitmotion\Locate\Action; use Bitmotion\Locate\Exception; use Bitmotion\Locate\Judge\Decision; diff --git a/Classes/Action/Dummy.php b/Classes/Action/Dummy.php index 5238e13..02ba732 100644 --- a/Classes/Action/Dummy.php +++ b/Classes/Action/Dummy.php @@ -1,17 +1,17 @@ , Leuchtfeuer Digital Marketing - * - ***/ + * Florian Wessels , Leuchtfeuer Digital Marketing + */ + +namespace Bitmotion\Locate\Action; use Bitmotion\Locate\Judge\Decision; diff --git a/Classes/Action/Redirect.php b/Classes/Action/Redirect.php index bcb4cc2..9632509 100644 --- a/Classes/Action/Redirect.php +++ b/Classes/Action/Redirect.php @@ -1,17 +1,17 @@ , Leuchtfeuer Digital Marketing - * - ***/ + * Florian Wessels , Leuchtfeuer Digital Marketing + */ + +namespace Bitmotion\Locate\Action; use Bitmotion\Locate\Judge\Decision; use TYPO3\CMS\Core\Context\Context; diff --git a/Classes/Command/UpdateIpDatabaseCommand.php b/Classes/Command/UpdateIpDatabaseCommand.php index 1c5fae0..b5631d0 100644 --- a/Classes/Command/UpdateIpDatabaseCommand.php +++ b/Classes/Command/UpdateIpDatabaseCommand.php @@ -1,17 +1,17 @@ , Leuchtfeuer Digital Marketing - * - ***/ + * Florian Wessels , Leuchtfeuer Digital Marketing + */ + +namespace Bitmotion\Locate\Command; use Doctrine\DBAL\DBALException; use Symfony\Component\Console\Command\Command; diff --git a/Classes/Exception.php b/Classes/Exception.php index c965345..a4e0cf2 100644 --- a/Classes/Exception.php +++ b/Classes/Exception.php @@ -1,10 +1,18 @@ , Leuchtfeuer Digital Marketing */ + +namespace Bitmotion\Locate; + class Exception extends \Exception { } diff --git a/Classes/FactProvider/AbstractFactProvider.php b/Classes/FactProvider/AbstractFactProvider.php index 586c699..ca19ab5 100644 --- a/Classes/FactProvider/AbstractFactProvider.php +++ b/Classes/FactProvider/AbstractFactProvider.php @@ -1,17 +1,17 @@ , Leuchtfeuer Digital Marketing - * - ***/ + * Florian Wessels , Leuchtfeuer Digital Marketing + */ + +namespace Bitmotion\Locate\FactProvider; use Bitmotion\Locate\Exception; diff --git a/Classes/FactProvider/BrowserAcceptedLanguage.php b/Classes/FactProvider/BrowserAcceptedLanguage.php index b2f9a1e..c55eac4 100644 --- a/Classes/FactProvider/BrowserAcceptedLanguage.php +++ b/Classes/FactProvider/BrowserAcceptedLanguage.php @@ -1,17 +1,17 @@ , Leuchtfeuer Digital Marketing - * - ***/ + * Florian Wessels , Leuchtfeuer Digital Marketing + */ + +namespace Bitmotion\Locate\FactProvider; class BrowserAcceptedLanguage extends AbstractFactProvider { diff --git a/Classes/FactProvider/Environment.php b/Classes/FactProvider/Environment.php index 46436b6..a6c5775 100644 --- a/Classes/FactProvider/Environment.php +++ b/Classes/FactProvider/Environment.php @@ -1,17 +1,17 @@ , Leuchtfeuer Digital Marketing - * - ***/ + * Florian Wessels , Leuchtfeuer Digital Marketing + */ + +namespace Bitmotion\Locate\FactProvider; use TYPO3\CMS\Core\Utility\GeneralUtility; diff --git a/Classes/FactProvider/IP2Country.php b/Classes/FactProvider/IP2Country.php index 2a259be..bad6d40 100644 --- a/Classes/FactProvider/IP2Country.php +++ b/Classes/FactProvider/IP2Country.php @@ -1,17 +1,17 @@ , Leuchtfeuer Digital Marketing - * - ***/ + * Florian Wessels , Leuchtfeuer Digital Marketing + */ + +namespace Bitmotion\Locate\FactProvider; use Bitmotion\Locate\Utility\LocateUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; diff --git a/Classes/Judge/AbstractJudge.php b/Classes/Judge/AbstractJudge.php index 6af0dd4..389f65b 100644 --- a/Classes/Judge/AbstractJudge.php +++ b/Classes/Judge/AbstractJudge.php @@ -1,17 +1,17 @@ , Leuchtfeuer Digital Marketing - * - ***/ + * Florian Wessels , Leuchtfeuer Digital Marketing + */ + +namespace Bitmotion\Locate\Judge; use Bitmotion\Locate\Exception; use Psr\Log\LoggerAwareInterface; diff --git a/Classes/Judge/AndCondition.php b/Classes/Judge/AndCondition.php index b30a83b..0b1f495 100644 --- a/Classes/Judge/AndCondition.php +++ b/Classes/Judge/AndCondition.php @@ -1,17 +1,17 @@ , Leuchtfeuer Digital Marketing - * - ***/ + * Florian Wessels , Leuchtfeuer Digital Marketing + */ + +namespace Bitmotion\Locate\Judge; /** * @deprecated diff --git a/Classes/Judge/Condition.php b/Classes/Judge/Condition.php index c3c21aa..5071309 100644 --- a/Classes/Judge/Condition.php +++ b/Classes/Judge/Condition.php @@ -1,17 +1,17 @@ , Leuchtfeuer Digital Marketing - * - ***/ + * Florian Wessels , Leuchtfeuer Digital Marketing + */ + +namespace Bitmotion\Locate\Judge; class Condition extends AbstractJudge { diff --git a/Classes/Judge/Decision.php b/Classes/Judge/Decision.php index 0d6e037..e632dfd 100644 --- a/Classes/Judge/Decision.php +++ b/Classes/Judge/Decision.php @@ -1,17 +1,17 @@ , Leuchtfeuer Digital Marketing - * - ***/ + * Florian Wessels , Leuchtfeuer Digital Marketing + */ + +namespace Bitmotion\Locate\Judge; class Decision { diff --git a/Classes/Judge/Fixed.php b/Classes/Judge/Fixed.php index cd49f8f..d74fcd4 100644 --- a/Classes/Judge/Fixed.php +++ b/Classes/Judge/Fixed.php @@ -1,17 +1,17 @@ , Leuchtfeuer Digital Marketing - * - ***/ + * Florian Wessels , Leuchtfeuer Digital Marketing + */ + +namespace Bitmotion\Locate\Judge; class Fixed extends AbstractJudge { diff --git a/Classes/Middleware/LanguageRedirectMiddleware.php b/Classes/Middleware/LanguageRedirectMiddleware.php index 35c76c8..c35401e 100644 --- a/Classes/Middleware/LanguageRedirectMiddleware.php +++ b/Classes/Middleware/LanguageRedirectMiddleware.php @@ -1,17 +1,17 @@ , Leuchtfeuer Digital Marketing - * - ***/ + * Florian Wessels , Leuchtfeuer Digital Marketing + */ + +namespace Bitmotion\Locate\Middleware; use Bitmotion\Locate\Action\Redirect; use Bitmotion\Locate\Processor\Court; diff --git a/Classes/Processor/Court.php b/Classes/Processor/Court.php index 84c86c9..8f3b1e0 100644 --- a/Classes/Processor/Court.php +++ b/Classes/Processor/Court.php @@ -1,17 +1,17 @@ , Leuchtfeuer Digital Marketing - * - ***/ + * Florian Wessels , Leuchtfeuer Digital Marketing + */ + +namespace Bitmotion\Locate\Processor; use Bitmotion\Locate\Action\AbstractAction; use Bitmotion\Locate\Exception; diff --git a/Classes/Processor/ProcessorInterface.php b/Classes/Processor/ProcessorInterface.php index 6231c14..449cfbd 100644 --- a/Classes/Processor/ProcessorInterface.php +++ b/Classes/Processor/ProcessorInterface.php @@ -1,21 +1,18 @@ , Leuchtfeuer Digital Marketing - * - ***/ - -/** - * Interface ProcessorInterface + * Florian Wessels , Leuchtfeuer Digital Marketing */ + +namespace Bitmotion\Locate\Processor; + interface ProcessorInterface { /** diff --git a/Classes/Utility/LocateUtility.php b/Classes/Utility/LocateUtility.php index a8a824b..4203246 100644 --- a/Classes/Utility/LocateUtility.php +++ b/Classes/Utility/LocateUtility.php @@ -1,17 +1,17 @@ , Leuchtfeuer Digital Marketing - * - ***/ + * Florian Wessels , Leuchtfeuer Digital Marketing + */ + +namespace Bitmotion\Locate\Utility; use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Utility\GeneralUtility;