-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from bolt/fix/ex-json-and-code-style
Fix `ext-json` and run CS fixer
- Loading branch information
Showing
25 changed files
with
290 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Symfony\Component\DependencyInjection\Loader\Configurator; | ||
|
||
use PhpCsFixer\Fixer\Alias\MbStrFunctionsFixer; | ||
use PhpCsFixer\Fixer\ArrayNotation\NoWhitespaceBeforeCommaInArrayFixer; | ||
use PhpCsFixer\Fixer\ArrayNotation\WhitespaceAfterCommaInArrayFixer; | ||
use PhpCsFixer\Fixer\Basic\BracesFixer; | ||
use PhpCsFixer\Fixer\Basic\Psr0Fixer; | ||
use PhpCsFixer\Fixer\Basic\Psr4Fixer; | ||
use PhpCsFixer\Fixer\CastNotation\LowercaseCastFixer; | ||
use PhpCsFixer\Fixer\CastNotation\ShortScalarCastFixer; | ||
use PhpCsFixer\Fixer\ClassNotation\FinalInternalClassFixer; | ||
use PhpCsFixer\Fixer\ClassNotation\NoBlankLinesAfterClassOpeningFixer; | ||
use PhpCsFixer\Fixer\ClassNotation\OrderedClassElementsFixer; | ||
use PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer; | ||
use PhpCsFixer\Fixer\ConstantNotation\NativeConstantInvocationFixer; | ||
use PhpCsFixer\Fixer\ControlStructure\YodaStyleFixer; | ||
use PhpCsFixer\Fixer\FunctionNotation\NativeFunctionInvocationFixer; | ||
use PhpCsFixer\Fixer\FunctionNotation\PhpdocToReturnTypeFixer; | ||
use PhpCsFixer\Fixer\FunctionNotation\ReturnTypeDeclarationFixer; | ||
use PhpCsFixer\Fixer\Import\FullyQualifiedStrictTypesFixer; | ||
use PhpCsFixer\Fixer\Import\NoLeadingImportSlashFixer; | ||
use PhpCsFixer\Fixer\Import\OrderedImportsFixer; | ||
use PhpCsFixer\Fixer\LanguageConstruct\DeclareEqualNormalizeFixer; | ||
use PhpCsFixer\Fixer\Operator\ConcatSpaceFixer; | ||
use PhpCsFixer\Fixer\Operator\IncrementStyleFixer; | ||
use PhpCsFixer\Fixer\Operator\NewWithBracesFixer; | ||
use PhpCsFixer\Fixer\Operator\TernaryOperatorSpacesFixer; | ||
use PhpCsFixer\Fixer\Operator\UnaryOperatorSpacesFixer; | ||
use PhpCsFixer\Fixer\Phpdoc\NoSuperfluousPhpdocTagsFixer; | ||
use PhpCsFixer\Fixer\Phpdoc\PhpdocAlignFixer; | ||
use PhpCsFixer\Fixer\Phpdoc\PhpdocAnnotationWithoutDotFixer; | ||
use PhpCsFixer\Fixer\Phpdoc\PhpdocLineSpanFixer; | ||
use PhpCsFixer\Fixer\Phpdoc\PhpdocSummaryFixer; | ||
use PhpCsFixer\Fixer\PhpTag\BlankLineAfterOpeningTagFixer; | ||
use PhpCsFixer\Fixer\PhpUnit\PhpUnitMethodCasingFixer; | ||
use PhpCsFixer\Fixer\Semicolon\NoSinglelineWhitespaceBeforeSemicolonsFixer; | ||
use PhpCsFixer\Fixer\Whitespace\NoTrailingWhitespaceFixer; | ||
use SlevomatCodingStandard\Sniffs\ControlStructures\DisallowYodaComparisonSniff; | ||
use Symplify\CodingStandard\Fixer\ArrayNotation\ArrayListItemNewlineFixer; | ||
use Symplify\CodingStandard\Fixer\ArrayNotation\ArrayOpenerAndCloserNewlineFixer; | ||
use Symplify\CodingStandard\Fixer\ArrayNotation\StandaloneLineInMultilineArrayFixer; | ||
use Symplify\CodingStandard\Fixer\Commenting\RemoveSuperfluousDocBlockWhitespaceFixer; | ||
use Symplify\CodingStandard\Fixer\Strict\BlankLineAfterStrictTypesFixer; | ||
|
||
return static function (ContainerConfigurator $containerConfigurator): void { | ||
$parameters = $containerConfigurator->parameters(); | ||
|
||
$parameters->set('sets', ['clean-code', 'common', 'php70', 'php71', 'psr12', 'symfony', 'symfony-risky']); | ||
|
||
$parameters->set('paths', [ | ||
__DIR__ . '/src', | ||
__DIR__ . '/ecs.php', | ||
]); | ||
|
||
$parameters->set('cache_directory', 'var/cache/ecs'); | ||
|
||
$parameters->set('skip', [ | ||
OrderedClassElementsFixer::class => null, | ||
YodaStyleFixer::class => null, | ||
IncrementStyleFixer::class => null, | ||
PhpdocAnnotationWithoutDotFixer::class => null, | ||
PhpdocSummaryFixer::class => null, | ||
PhpdocAlignFixer::class => null, | ||
NativeConstantInvocationFixer::class => null, | ||
NativeFunctionInvocationFixer::class => null, | ||
UnaryOperatorSpacesFixer::class => null, | ||
ArrayOpenerAndCloserNewlineFixer::class => null, | ||
ArrayListItemNewlineFixer::class => null, | ||
]); | ||
|
||
$services = $containerConfigurator->services(); | ||
|
||
$services->set(StandaloneLineInMultilineArrayFixer::class); | ||
|
||
$services->set(BlankLineAfterStrictTypesFixer::class); | ||
|
||
$services->set(ConcatSpaceFixer::class) | ||
->call('configure', [['spacing' => 'one']]); | ||
|
||
$services->set(RemoveSuperfluousDocBlockWhitespaceFixer::class); | ||
|
||
$services->set(PhpUnitMethodCasingFixer::class); | ||
|
||
$services->set(FinalInternalClassFixer::class); | ||
|
||
$services->set(MbStrFunctionsFixer::class); | ||
|
||
$services->set(Psr0Fixer::class); | ||
|
||
$services->set(Psr4Fixer::class); | ||
|
||
$services->set(LowercaseCastFixer::class); | ||
|
||
$services->set(ShortScalarCastFixer::class); | ||
|
||
$services->set(BlankLineAfterOpeningTagFixer::class); | ||
|
||
$services->set(NoLeadingImportSlashFixer::class); | ||
|
||
$services->set(OrderedImportsFixer::class) | ||
->call('configure', [[ | ||
'importsOrder' => ['class', 'const', 'function'], | ||
]]); | ||
|
||
$services->set(DeclareEqualNormalizeFixer::class) | ||
->call('configure', [['space' => 'none']]); | ||
|
||
$services->set(NewWithBracesFixer::class); | ||
|
||
$services->set(BracesFixer::class) | ||
->call('configure', [[ | ||
'allow_single_line_closure' => false, | ||
'position_after_functions_and_oop_constructs' => 'next', | ||
'position_after_control_structures' => 'same', | ||
'position_after_anonymous_constructs' => 'same', | ||
]]); | ||
|
||
$services->set(NoBlankLinesAfterClassOpeningFixer::class); | ||
|
||
$services->set(VisibilityRequiredFixer::class) | ||
->call('configure', [[ | ||
'elements' => ['const', 'method', 'property'], | ||
]]); | ||
|
||
$services->set(TernaryOperatorSpacesFixer::class); | ||
|
||
$services->set(ReturnTypeDeclarationFixer::class); | ||
|
||
$services->set(NoTrailingWhitespaceFixer::class); | ||
|
||
$services->set(NoSinglelineWhitespaceBeforeSemicolonsFixer::class); | ||
|
||
$services->set(NoWhitespaceBeforeCommaInArrayFixer::class); | ||
|
||
$services->set(WhitespaceAfterCommaInArrayFixer::class); | ||
|
||
$services->set(PhpdocToReturnTypeFixer::class); | ||
|
||
$services->set(FullyQualifiedStrictTypesFixer::class); | ||
|
||
$services->set(NoSuperfluousPhpdocTagsFixer::class); | ||
|
||
$services->set(PhpdocLineSpanFixer::class) | ||
->call('configure', [['property' => 'single']]); | ||
|
||
$services->set(DisallowYodaComparisonSniff::class); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Bolt\BoltForms; | ||
|
||
class CaptchaException extends \Exception | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,16 +20,16 @@ | |
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* @author Gawain Lynch <[email protected]> | ||
* @author Gawain Lynch <[email protected]> | ||
* @copyright Copyright (c) 2014-2016, Gawain Lynch | ||
* @license http://opensource.org/licenses/GPL-3.0 GNU Public License 3.0 | ||
* @license http://opensource.org/licenses/LGPL-3.0 GNU Lesser General Public License 3.0 | ||
* @license http://opensource.org/licenses/GPL-3.0 GNU Public License 3.0 | ||
* @license http://opensource.org/licenses/LGPL-3.0 GNU Lesser General Public License 3.0 | ||
*/ | ||
class BoltFormsEvent extends FormEvent | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,16 +16,16 @@ | |
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* @author Gawain Lynch <[email protected]> | ||
* @author Gawain Lynch <[email protected]> | ||
* @copyright Copyright (c) 2014-2016, Gawain Lynch | ||
* @license http://opensource.org/licenses/GPL-3.0 GNU Public License 3.0 | ||
* @license http://opensource.org/licenses/LGPL-3.0 GNU Lesser General Public License 3.0 | ||
* @license http://opensource.org/licenses/GPL-3.0 GNU Public License 3.0 | ||
* @license http://opensource.org/licenses/LGPL-3.0 GNU Lesser General Public License 3.0 | ||
*/ | ||
final class BoltFormsEvents | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.