Add php-cs-fixer as dev dependency

This commit is contained in:
PJ Dietz 2020-08-10 06:48:32 -04:00
parent d98789ebfd
commit a73ad17ddd
6 changed files with 1137 additions and 46 deletions

1
.gitattributes vendored
View File

@ -1,6 +1,7 @@
/.env export-ignore /.env export-ignore
/.gitattributes export-ignore /.gitattributes export-ignore
/.gitignore export-ignore /.gitignore export-ignore
/.php_cs* export-ignore
/.travis.yml export-ignore /.travis.yml export-ignore
/composer.lock export-ignore /composer.lock export-ignore
/docker export-ignore /docker export-ignore

3
.gitignore vendored
View File

@ -8,6 +8,9 @@ phpdoc/
coverage/ coverage/
report/ report/
# Cache
.php_cs.cache
# Sphinx Documentation # Sphinx Documentation
docs/build docs/build

15
.php_cs.dist Normal file
View File

@ -0,0 +1,15 @@
<?php
$finder = PhpCsFixer\Finder::create()
->files()
->in(__DIR__ . '/src')
->in(__DIR__ . '/test');
return PhpCsFixer\Config::create()
->setFinder($finder)
->setRiskyAllowed(true)
->setRules([
'@PSR2' => true,
'strict_param' => true,
'array_syntax' => ['syntax' => 'short'],
]);

View File

@ -18,6 +18,7 @@
"psr/http-server-middleware": "~1.0" "psr/http-server-middleware": "~1.0"
}, },
"require-dev": { "require-dev": {
"friendsofphp/php-cs-fixer": "^2",
"phpspec/prophecy-phpunit": "^2.0", "phpspec/prophecy-phpunit": "^2.0",
"phpunit/phpunit": "^9", "phpunit/phpunit": "^9",
"vimeo/psalm": "^3.4" "vimeo/psalm": "^3.4"

1160
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -32,7 +32,8 @@ COPY ./test /usr/local/src/wellrested/test
COPY ./composer.* /usr/local/src/wellrested/ COPY ./composer.* /usr/local/src/wellrested/
COPY ./phpunit.xml.dist /usr/local/src/wellrested/ COPY ./phpunit.xml.dist /usr/local/src/wellrested/
# Add symlinks for phpunit and psalm for easier running # Add symlinks for php-cs-fixer, phpunit, and psalm for easier running
RUN ln -s /usr/local/src/wellrested/vendor/bin/php-cs-fixer /usr/local/bin/php-cs-fixer
RUN ln -s /usr/local/src/wellrested/vendor/bin/phpunit /usr/local/bin/phpunit RUN ln -s /usr/local/src/wellrested/vendor/bin/phpunit /usr/local/bin/phpunit
RUN ln -s /usr/local/src/wellrested/vendor/bin/psalm /usr/local/bin/psalm RUN ln -s /usr/local/src/wellrested/vendor/bin/psalm /usr/local/bin/psalm