Skip to content

Commit

Permalink
Merge pull request #3 from shyim/modernize
Browse files Browse the repository at this point in the history
  • Loading branch information
digilist authored Apr 28, 2024
2 parents dd77f1a + 21e89bb commit a8a1ae4
Show file tree
Hide file tree
Showing 14 changed files with 3,125 additions and 592 deletions.
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/vendor export-ignore
/.github export-ignore
/tests export-ignore
/.* export-ignore
/composer.lock export-ignore
/phpstan.neon.dist export-ignore
/phpunit.xml.dist export-ignore
/README.md export-ignore
56 changes: 56 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: PHP
on:
push:
pull_request:

jobs:
unit:
runs-on: ubuntu-latest
strategy:
matrix:
php: [8.2, 8.3]
steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '${{ matrix.php }}'

- name: Install dependencies
run: composer install

- name: Run tests
run: vendor/bin/phpunit

phpstan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2

- name: Install dependencies
run: composer install

- name: Run PHPStan
run: vendor/bin/phpstan analyse

cs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2

- name: Install dependencies
run: composer install

- name: Run PHP CS Fixer
run: vendor/bin/php-cs-fixer fix --dry-run --diff
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
/vendor/
.phpunit.cache/
.php-cs-fixer.cache
22 changes: 22 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php declare(strict_types=1);

return (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setRules([
'@PHP80Migration:risky' => true,
'@PHP82Migration' => true,
'@PhpCsFixer' => true,
'@PER-CS2.0' => true,
'@PER-CS2.0:risky' => true,
// Ensure there is no code on the same line as the PHP open tag and it is followed by a blank line.
'blank_line_after_opening_tag' => false,
// Ensure there is no code on the same line as the PHP open tag.
'linebreak_after_opening_tag' => false,
// We use the attribute CoversClass which is not recognized by php-cs-fixer
'php_unit_test_class_requires_covers' => false,
])
->setFinder(PhpCsFixer\Finder::create()
->exclude('vendor')
->in(__DIR__),
)
;
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/digilist/dependency-graph/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/digilist/dependency-graph/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/digilist/dependency-graph/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/digilist/dependency-graph/?branch=master)
[![Build Status](https://scrutinizer-ci.com/g/digilist/dependency-graph/badges/build.png?b=master)](https://scrutinizer-ci.com/g/digilist/dependency-graph/build-status/master)
[![PHP](https://github.com/digilist/dependency-graph/actions/workflows/php.yml/badge.svg)](https://github.com/digilist/dependency-graph/actions/workflows/php.yml)

# PHP DependencyGraph
This library provides a simple [Dependency Graph](http://en.wikipedia.org/wiki/Dependency_graph) resolver. It supports multiple root nodes which are detected automatically.
Expand Down
11 changes: 9 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,21 @@
}
],
"require": {
"php": ">=5.3"
"php": ">=8.2"
},
"require-dev": {
"phpunit/phpunit": "4.5.*"
"phpunit/phpunit": "~11.0",
"phpstan/phpstan": "^1.10",
"friendsofphp/php-cs-fixer": "^3.0"
},
"autoload": {
"psr-4": {
"Digilist\\DependencyGraph\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Digilist\\DependencyGraph\\Tests\\": "tests/"
}
}
}
Loading

0 comments on commit a8a1ae4

Please sign in to comment.