Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Coding Standards

on:
push:
pull_request:
workflow_dispatch:

jobs:
cs:
uses: ray-di/.github/.github/workflows/coding-standards.yml@v1
with:
php_version: 8.3
13 changes: 13 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Continuous Integration

on:
push:
pull_request:
workflow_dispatch:

jobs:
ci:
uses: ray-di/.github/.github/workflows/continuous-integration.yml@v1
with:
old_stable: '["8.2", "8.3", "8.4"]'
current_stable: 8.5
43 changes: 43 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Static Analysis

on:
push:
pull_request:
workflow_dispatch:

jobs:
phpstan:
name: PHPStan
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
Comment thread
coderabbitai[bot] marked this conversation as resolved.
persist-credentials: false

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
coverage: none
tools: cs2pr

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: composer install --no-interaction --no-progress --prefer-dist

- name: Run PHPStan
run: ./vendor/bin/phpstan analyse -c phpstan.neon --no-progress --no-interaction --error-format=checkstyle | cs2pr
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
/composer.lock
/phpunit.xml
/.php_cs.cache
/.phpcs-cache
.phpunit.result.cache
/.phpunit.cache/
185 changes: 0 additions & 185 deletions .php_cs.dist

This file was deleted.

40 changes: 26 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ray/object-visual-grapher",
"description": "",
"description": "A visual graph generator for Ray.Di object dependency graphs",
"license": "MIT",
"authors": [
{
Expand All @@ -12,14 +12,21 @@
"php": "^8.2"
},
"require-dev": {
"phpunit/phpunit": "^10.5",
"squizlabs/php_codesniffer": "^3.2",
"friendsofphp/php-cs-fixer": "^2.11",
"bear/package": "^1.9.6",
"bear/query-repository": "^1.13",
"doctrine/coding-standard": "^14.0",
"phpmd/phpmd": "^2.6",
"phpstan/phpstan": "^2.0",
"phpunit/phpunit": "^10.5",
"ray/di": "^2.10|2.x-dev",
"bear/package": "^1.9.6",
"doctrine/annotations": "^1.8",
"phpstan/phpstan": "^0.12.5"
"slevomat/coding-standard": "^8.15",
"squizlabs/php_codesniffer": "^4.0"
},
"config": {
"sort-packages": true,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": false
}
},
"autoload": {
"psr-4": {
Expand All @@ -39,23 +46,28 @@
"php ./tests/bin/package.php && dot -T png ./tests/bin/package.dot -o ./tests/bin/package.png && open ./tests/bin/package.png"
],
"test": [
"vendor/bin/phpunit"
"phpunit"
],
"tests": [
"@cs",
"@test",
"vendor/bin/phpstan analyse -l max src -c phpstan.neon --no-progress"
"phpstan analyse -c phpstan.neon --no-progress"
],
"coverage": [
"php -dzend_extension=xdebug.so ./vendor/bin/phpunit --coverage-text --coverage-html=build/coverage"
"php -dzend_extension=xdebug.so -dxdebug.mode=coverage ./vendor/bin/phpunit --coverage-text --coverage-html=build/coverage"
],
"cs": [
"vendor/bin/php-cs-fixer fix -v --dry-run",
"vendor/bin/phpcs --standard=phpcs.xml src;"
"phpcs --standard=./phpcs.xml src tests"
],
"cs-fix": [
"vendor/bin/php-cs-fixer fix -v",
"vendor/bin/phpcbf src tests"
"phpcbf src tests"
]
},
"scripts-descriptions": {
"test": "Run unit tests",
"tests": "Run coding standards, tests, and static analysis",
"coverage": "Generate test coverage report with Xdebug",
"cs": "Check coding standards",
"cs-fix": "Fix coding standards violations"
}
}
Loading
Loading