Skip to content

Commit

Permalink
[TASK] Update php CS
Browse files Browse the repository at this point in the history
  • Loading branch information
flossels committed Dec 1, 2020
1 parent 2d8bead commit 1595344
Show file tree
Hide file tree
Showing 19 changed files with 183 additions and 152 deletions.
46 changes: 36 additions & 10 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -1,24 +1,57 @@
<?php

declare(strict_types=1);

if (PHP_SAPI !== 'cli') {
die('This script supports command line usage only. Please check your command.');
}

$headerComment = <<<COMMENT
This file is part of the "Locate" extension for TYPO3 CMS.
For the full copyright and license information, please read the
LICENSE.txt file that was distributed with this source code.
Florian Wessels <[email protected]>, 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,
Expand Down Expand Up @@ -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);
16 changes: 8 additions & 8 deletions Classes/Action/AbstractAction.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php
declare(strict_types = 1);
namespace Bitmotion\Locate\Action;

/***
*
* This file is part of the "Locate" Extension for TYPO3 CMS.
declare(strict_types=1);

/*
* This file is part of the "Locate" extension for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* (c) 2019 Florian Wessels <[email protected]>, Leuchtfeuer Digital Marketing
*
***/
* Florian Wessels <[email protected]>, Leuchtfeuer Digital Marketing
*/

namespace Bitmotion\Locate\Action;

use Bitmotion\Locate\Exception;
use Bitmotion\Locate\Judge\Decision;
Expand Down
16 changes: 8 additions & 8 deletions Classes/Action/Dummy.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php
declare(strict_types = 1);
namespace Bitmotion\Locate\Action;

/***
*
* This file is part of the "Locate" Extension for TYPO3 CMS.
declare(strict_types=1);

/*
* This file is part of the "Locate" extension for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* (c) 2019 Florian Wessels <[email protected]>, Leuchtfeuer Digital Marketing
*
***/
* Florian Wessels <[email protected]>, Leuchtfeuer Digital Marketing
*/

namespace Bitmotion\Locate\Action;

use Bitmotion\Locate\Judge\Decision;

Expand Down
16 changes: 8 additions & 8 deletions Classes/Action/Redirect.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php
declare(strict_types = 1);
namespace Bitmotion\Locate\Action;

/***
*
* This file is part of the "Locate" Extension for TYPO3 CMS.
declare(strict_types=1);

/*
* This file is part of the "Locate" extension for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* (c) 2019 Florian Wessels <[email protected]>, Leuchtfeuer Digital Marketing
*
***/
* Florian Wessels <[email protected]>, Leuchtfeuer Digital Marketing
*/

namespace Bitmotion\Locate\Action;

use Bitmotion\Locate\Judge\Decision;
use TYPO3\CMS\Core\Context\Context;
Expand Down
14 changes: 7 additions & 7 deletions Classes/Command/UpdateIpDatabaseCommand.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php

namespace Bitmotion\Locate\Command;
declare(strict_types=1);

/***
*
* This file is part of the "Locate" Extension for TYPO3 CMS.
/*
* This file is part of the "Locate" extension for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* (c) 2020 Florian Wessels <[email protected]>, Leuchtfeuer Digital Marketing
*
***/
* Florian Wessels <[email protected]>, Leuchtfeuer Digital Marketing
*/

namespace Bitmotion\Locate\Command;

use Doctrine\DBAL\DBALException;
use Symfony\Component\Console\Command\Command;
Expand Down
16 changes: 12 additions & 4 deletions Classes/Exception.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
<?php
declare(strict_types = 1);
namespace Bitmotion\Locate;

/**
* Class Exception
declare(strict_types=1);

/*
* This file is part of the "Locate" extension for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* Florian Wessels <[email protected]>, Leuchtfeuer Digital Marketing
*/

namespace Bitmotion\Locate;

class Exception extends \Exception
{
}
16 changes: 8 additions & 8 deletions Classes/FactProvider/AbstractFactProvider.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php
declare(strict_types = 1);
namespace Bitmotion\Locate\FactProvider;

/***
*
* This file is part of the "Locate" Extension for TYPO3 CMS.
declare(strict_types=1);

/*
* This file is part of the "Locate" extension for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* (c) 2019 Florian Wessels <[email protected]>, Leuchtfeuer Digital Marketing
*
***/
* Florian Wessels <[email protected]>, Leuchtfeuer Digital Marketing
*/

namespace Bitmotion\Locate\FactProvider;

use Bitmotion\Locate\Exception;

Expand Down
16 changes: 8 additions & 8 deletions Classes/FactProvider/BrowserAcceptedLanguage.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php
declare(strict_types = 1);
namespace Bitmotion\Locate\FactProvider;

/***
*
* This file is part of the "Locate" Extension for TYPO3 CMS.
declare(strict_types=1);

/*
* This file is part of the "Locate" extension for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* (c) 2019 Florian Wessels <[email protected]>, Leuchtfeuer Digital Marketing
*
***/
* Florian Wessels <[email protected]>, Leuchtfeuer Digital Marketing
*/

namespace Bitmotion\Locate\FactProvider;

class BrowserAcceptedLanguage extends AbstractFactProvider
{
Expand Down
16 changes: 8 additions & 8 deletions Classes/FactProvider/Environment.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php
declare(strict_types = 1);
namespace Bitmotion\Locate\FactProvider;

/***
*
* This file is part of the "Locate" Extension for TYPO3 CMS.
declare(strict_types=1);

/*
* This file is part of the "Locate" extension for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* (c) 2019 Florian Wessels <[email protected]>, Leuchtfeuer Digital Marketing
*
***/
* Florian Wessels <[email protected]>, Leuchtfeuer Digital Marketing
*/

namespace Bitmotion\Locate\FactProvider;

use TYPO3\CMS\Core\Utility\GeneralUtility;

Expand Down
16 changes: 8 additions & 8 deletions Classes/FactProvider/IP2Country.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php
declare(strict_types = 1);
namespace Bitmotion\Locate\FactProvider;

/***
*
* This file is part of the "Locate" Extension for TYPO3 CMS.
declare(strict_types=1);

/*
* This file is part of the "Locate" extension for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* (c) 2019 Florian Wessels <[email protected]>, Leuchtfeuer Digital Marketing
*
***/
* Florian Wessels <[email protected]>, Leuchtfeuer Digital Marketing
*/

namespace Bitmotion\Locate\FactProvider;

use Bitmotion\Locate\Utility\LocateUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
Expand Down
16 changes: 8 additions & 8 deletions Classes/Judge/AbstractJudge.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php
declare(strict_types = 1);
namespace Bitmotion\Locate\Judge;

/***
*
* This file is part of the "Locate" Extension for TYPO3 CMS.
declare(strict_types=1);

/*
* This file is part of the "Locate" extension for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* (c) 2019 Florian Wessels <[email protected]>, Leuchtfeuer Digital Marketing
*
***/
* Florian Wessels <[email protected]>, Leuchtfeuer Digital Marketing
*/

namespace Bitmotion\Locate\Judge;

use Bitmotion\Locate\Exception;
use Psr\Log\LoggerAwareInterface;
Expand Down
16 changes: 8 additions & 8 deletions Classes/Judge/AndCondition.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php
declare(strict_types = 1);
namespace Bitmotion\Locate\Judge;

/***
*
* This file is part of the "Locate" Extension for TYPO3 CMS.
declare(strict_types=1);

/*
* This file is part of the "Locate" extension for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* (c) 2019 Florian Wessels <[email protected]>, Leuchtfeuer Digital Marketing
*
***/
* Florian Wessels <[email protected]>, Leuchtfeuer Digital Marketing
*/

namespace Bitmotion\Locate\Judge;

/**
* @deprecated
Expand Down
16 changes: 8 additions & 8 deletions Classes/Judge/Condition.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php
declare(strict_types = 1);
namespace Bitmotion\Locate\Judge;

/***
*
* This file is part of the "Locate" Extension for TYPO3 CMS.
declare(strict_types=1);

/*
* This file is part of the "Locate" extension for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* (c) 2019 Florian Wessels <[email protected]>, Leuchtfeuer Digital Marketing
*
***/
* Florian Wessels <[email protected]>, Leuchtfeuer Digital Marketing
*/

namespace Bitmotion\Locate\Judge;

class Condition extends AbstractJudge
{
Expand Down
Loading

0 comments on commit 1595344

Please sign in to comment.