yharahuts / space-inside-array-braces-fixer
Custom rule for php-cs-fixer to add spaces inside array braces
Installs: 1 023
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=8.0.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ~3.13
- phpunit/phpunit: ^9.5.10
- tareq1988/wp-php-cs-fixer: dev-master
- vimeo/psalm: 5.x-dev
This package is auto-updated.
Last update: 2024-10-24 02:18:22 UTC
README
What is this?
A fixer class for the php-cs-fixer to add spaces inside array (square) braces, like:
// before $array['foo'] = ['bar']; // after $array[ 'foo' ] = [ 'bar' ];
Usage
Require it via composer:
composer require --dev yharahuts/space-inside-array-braces-fixer
Then enable it in your .php-cs-fixer
config file:
// ... $config = new PhpCsFixer\Config(); return $config ->registerCustomFixers( [ new \Codestyle\Fixer\SpaceInsideArrayBracesFixer(), ] ) ->setRules( [ // ... 'Yharahuts/space_inside_array_braces' => true ] );