-
Notifications
You must be signed in to change notification settings - Fork 28
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 #146 from bearsunday/update-cs
Update CS
- Loading branch information
Showing
16 changed files
with
130 additions
and
84 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 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,58 +1,67 @@ | ||
language: php | ||
|
||
dist: bionic | ||
|
||
php: | ||
- 7.2 | ||
- 7.3 | ||
- 7.4 | ||
|
||
cache: | ||
directories: | ||
- vendor | ||
- ./vendor | ||
- $HOME/.composer/cache | ||
|
||
before_install: | ||
- mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{,.disabled} || echo "xdebug not available" | ||
- phpenv config-rm xdebug.ini || true | ||
- composer validate | ||
- composer self-update | ||
|
||
install: | ||
- composer update | ||
|
||
script: | ||
- ./vendor/bin/phpunit; | ||
- php ./demo/bin/index.php | ||
|
||
jobs: | ||
fast_finish: true | ||
include: | ||
- stage: Test | ||
name: Lowest dependencies | ||
php: 7.2 | ||
php: 7.4 | ||
install: composer update --prefer-dist --prefer-lowest | ||
|
||
- stage: Test | ||
name: PHP 8 | ||
php: nightly | ||
install: composer update --ignore-platform-reqs | ||
|
||
- stage: Code Quality | ||
name: Code coverage | ||
php: 7.2 | ||
php: 7.4 | ||
before_script: | ||
- mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{.disabled,} | ||
- if [[ ! $(php -m | grep -si xdebug) ]]; then echo "xdebug required for coverage"; exit 1; fi | ||
- pecl install pcov | ||
script: | ||
- ./vendor/bin/phpunit -v --coverage-clover ./build/logs/clover.xml | ||
after_script: | ||
- wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover coverage.clover; | ||
- ./vendor/bin/phpunit -v --coverage-clover ./build/logs/clover.xml --coverage-text | ||
after_success: | ||
- bash <(curl -s https://codecov.io/bash) -cF php | ||
|
||
- stage: Code Quality | ||
name: Static analysis | ||
php: 7.2 | ||
install: | ||
- composer global require --dev phpstan/phpstan ^0.12 vimeo/psalm ^3.11 psalm/plugin-phpunit ^0.10 phpmetrics/phpmetrics ^2.6; | ||
- ~/.composer/vendor/bin/psalm-plugin enable psalm/plugin-phpunit | ||
php: 7.4 | ||
install: composer global require --dev phpstan/phpstan ^0.12 vimeo/psalm ^3.11 phpmetrics/phpmetrics ^2.6 | ||
script: | ||
- ~/.composer/vendor/bin/phpstan analyse -c phpstan.neon --no-progress --no-interaction; | ||
- ~/.composer/vendor/bin/psalm --show-info=false | ||
- ~/.composer/vendor/bin/phpstan analyse -c phpstan.neon --no-progress --no-interaction | ||
- ~/.composer/vendor/bin/psalm --show-info=true --shepherd | ||
- ~/.composer/vendor/bin/phpmetrics --exclude=Exception src | ||
|
||
- stage: Code Quality | ||
name: Coding standards | ||
php: 7.2 | ||
install: composer global require --dev squizlabs/php_codesniffer ^3.5 doctrine/coding-standard ^8.1 | ||
php: 7.4 | ||
install: composer global require --dev doctrine/coding-standard ^8.1 maglnet/composer-require-checker ^2.0 | ||
script: | ||
- ~/.composer/vendor/bin/phpcs | ||
- ~/.composer/vendor/bin/phpcs --standard=./phpcs.xml src tests | ||
- ~/.composer/vendor/bin/composer-require-checker check ./composer.json | ||
allow_failures: | ||
- php: nightly |
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,14 @@ | ||
codecov: | ||
notify: | ||
require_ci_to_pass: yes | ||
|
||
coverage: | ||
status: | ||
project: | ||
default: | ||
target: 95% | ||
patch: | ||
default: | ||
target: 95% | ||
|
||
comment: false |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Composer\Autoload\ClassLoader; | ||
|
||
$autoload = require dirname(__DIR__) . '/vendor/autoload.php'; | ||
assert($autoload instanceof ClassLoader); | ||
$autoload->addPsr4('MyVendor\HelloWorld\\', __DIR__ . '/src'); |
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,21 +1,21 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
use BEAR\Resource\ResourceObject; | ||
|
||
use BEAR\Sunday\Extension\Application\AppInterface; | ||
use MyVendor\HelloWorld\App; | ||
use MyVendor\HelloWorld\AppModule; | ||
use Ray\Di\Injector; | ||
|
||
require dirname(__DIR__) . '/vendor/autoload.php'; | ||
require dirname(__DIR__) . '/autoload.php'; | ||
|
||
$app = (new Injector(new AppModule))->getInstance(AppInterface::class); | ||
$app = (new Injector(new AppModule()))->getInstance(AppInterface::class); | ||
assert($app instanceof App); | ||
try { | ||
$response = $app->resource->get('page://self/index', ['name' => 'BEAR.Sunday']); | ||
assert($response instanceof ResourceObject); | ||
/** @var array<string, string> $_SERVER */ | ||
$response->transfer($app->responder, $_SERVER); | ||
} catch (\Exception $e) { | ||
} catch (Throwable $e) { | ||
error_log((string) $e); | ||
exit(1); | ||
} |
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
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.