Skip to content

Commit 2c3bb2c

Browse files
authored
New code style and PHP 8.1+ (#14)
1 parent 3bc3c01 commit 2c3bb2c

28 files changed

+2377
-2428
lines changed

.editorconfig

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
#
2-
# JBZoo Toolbox - Composer-Graph
2+
# JBZoo Toolbox - Composer-Graph.
33
#
44
# This file is part of the JBZoo Toolbox project.
55
# For the full copyright and license information, please view the LICENSE
66
# file that was distributed with this source code.
77
#
8-
# @package Composer-Graph
98
# @license MIT
109
# @copyright Copyright (C) JBZoo.com, All rights reserved.
11-
# @link https://github.com/JBZoo/Composer-Graph
10+
# @see https://github.com/JBZoo/Composer-Graph
1211
#
1312

1413
# EditorConfig is awesome: http://EditorConfig.org

.gitattributes

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
#
2-
# JBZoo Toolbox - Composer-Graph
2+
# JBZoo Toolbox - Composer-Graph.
33
#
44
# This file is part of the JBZoo Toolbox project.
55
# For the full copyright and license information, please view the LICENSE
66
# file that was distributed with this source code.
77
#
8-
# @package Composer-Graph
98
# @license MIT
109
# @copyright Copyright (C) JBZoo.com, All rights reserved.
11-
# @link https://github.com/JBZoo/Composer-Graph
10+
# @see https://github.com/JBZoo/Composer-Graph
1211
#
1312

1413
/.github export-ignore

.github/workflows/main.yml

Lines changed: 27 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
#
2-
# JBZoo Toolbox - Composer-Graph
2+
# JBZoo Toolbox - Composer-Graph.
33
#
44
# This file is part of the JBZoo Toolbox project.
55
# For the full copyright and license information, please view the LICENSE
66
# file that was distributed with this source code.
77
#
8-
# @package Composer-Graph
98
# @license MIT
109
# @copyright Copyright (C) JBZoo.com, All rights reserved.
11-
# @link https://github.com/JBZoo/Composer-Graph
10+
# @see https://github.com/JBZoo/Composer-Graph
1211
#
1312

1413
name: CI
@@ -21,103 +20,75 @@ on:
2120
branches:
2221
- 'master'
2322
schedule:
24-
- cron: '15 */8 * * *'
23+
- cron: '39 */8 * * *'
2524

2625
env:
2726
COLUMNS: 120
2827
TERM_PROGRAM: Hyper
2928

3029
jobs:
31-
phpunit-update:
32-
name: PHPUnit (update)
30+
phpunit:
31+
name: PHPUnit
3332
runs-on: ubuntu-latest
3433
env:
3534
JBZOO_COMPOSER_UPDATE_FLAGS: ${{ matrix.composer_flags }}
3635
strategy:
3736
matrix:
38-
php-version: [ 7.4, 8.0, 8.1 ]
37+
php-version: [ 8.1, 8.2 ]
38+
coverage: [ xdebug, none ]
3939
composer_flags: [ "--prefer-lowest", "" ]
4040
steps:
4141
- name: Checkout code
42-
uses: actions/checkout@v2
42+
uses: actions/checkout@v3
4343
with:
4444
fetch-depth: 0
4545

4646
- name: Setup PHP
4747
uses: shivammathur/setup-php@v2
4848
with:
4949
php-version: ${{ matrix.php-version }}
50-
coverage: xdebug
50+
coverage: ${{ matrix.coverage }}
5151
tools: composer
52+
extensions: ast
5253

5354
- name: Build the Project
5455
run: make update --no-print-directory
5556

5657
- name: 🧪 PHPUnit Tests
5758
run: make test --no-print-directory
5859

60+
- name: Uploading coverage to coveralls
61+
if: ${{ matrix.coverage == 'xdebug' }}
62+
continue-on-error: true
63+
env:
64+
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65+
run: make report-coveralls --no-print-directory || true
66+
5967
- name: Upload Artifacts
60-
uses: actions/upload-artifact@v2
68+
uses: actions/upload-artifact@v3
6169
continue-on-error: true
6270
with:
63-
name: PHPUnit (update) - ${{ matrix.php-version }} - ${{ matrix.coverage }} - ${{ matrix.build-way }}
71+
name: PHPUnit - ${{ matrix.php-version }} - ${{ matrix.coverage }}
6472
path: build/
6573

6674

67-
# phpunit-build:
68-
# name: PHPUnit (build)
69-
# runs-on: ubuntu-latest
70-
# strategy:
71-
# matrix:
72-
# php-version: [ 7.2, 7.3, 7.4, 8.0 ]
73-
# steps:
74-
# - name: Checkout code
75-
# uses: actions/checkout@v2
76-
# with:
77-
# fetch-depth: 0
78-
#
79-
# - name: Setup PHP
80-
# uses: shivammathur/setup-php@v2
81-
# with:
82-
# php-version: ${{ matrix.php-version }}
83-
# coverage: xdebug
84-
# tools: composer
85-
#
86-
# - name: Build the Project
87-
# run: make build --no-print-directory
88-
#
89-
# - name: 🧪 PHPUnit Tests
90-
# run: make test --no-print-directory
91-
#
92-
# - name: Uploading coverage to coveralls
93-
# env:
94-
# COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
95-
# run: make report-coveralls --no-print-directory
96-
#
97-
# - name: Upload Artifacts
98-
# uses: actions/upload-artifact@v2
99-
# continue-on-error: true
100-
# with:
101-
# name: PHPUnit (build) - ${{ matrix.php-version }} - ${{ matrix.coverage }} - ${{ matrix.build-way }}
102-
# path: build/
103-
104-
10575
linters:
10676
name: Linters
10777
runs-on: ubuntu-latest
10878
strategy:
10979
matrix:
110-
php-version: [ 7.4, 8.0, 8.1 ]
80+
php-version: [ 8.1, 8.2 ]
11181
steps:
11282
- name: Checkout code
113-
uses: actions/checkout@v2
83+
uses: actions/checkout@v3
11484
with:
11585
fetch-depth: 0
11686

11787
- name: Setup PHP
11888
uses: shivammathur/setup-php@v2
11989
with:
12090
php-version: ${{ matrix.php-version }}
91+
coverage: none
12192
tools: composer
12293
extensions: ast
12394

@@ -128,7 +99,7 @@ jobs:
12899
run: make codestyle --no-print-directory
129100

130101
- name: Upload Artifacts
131-
uses: actions/upload-artifact@v2
102+
uses: actions/upload-artifact@v3
132103
continue-on-error: true
133104
with:
134105
name: Linters - ${{ matrix.php-version }}
@@ -140,10 +111,10 @@ jobs:
140111
runs-on: ubuntu-latest
141112
strategy:
142113
matrix:
143-
php-version: [ 7.4, 8.0, 8.1 ]
114+
php-version: [ 8.1, 8.2 ]
144115
steps:
145116
- name: Checkout code
146-
uses: actions/checkout@v2
117+
uses: actions/checkout@v3
147118
with:
148119
fetch-depth: 0
149120

@@ -153,6 +124,7 @@ jobs:
153124
php-version: ${{ matrix.php-version }}
154125
coverage: xdebug
155126
tools: composer
127+
extensions: ast
156128

157129
- name: Build the Project
158130
run: make update --no-print-directory
@@ -161,7 +133,7 @@ jobs:
161133
run: make report-all --no-print-directory
162134

163135
- name: Upload Artifacts
164-
uses: actions/upload-artifact@v2
136+
uses: actions/upload-artifact@v3
165137
continue-on-error: true
166138
with:
167139
name: Reports - ${{ matrix.php-version }}

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
#
2-
# JBZoo Toolbox - Composer-Graph
2+
# JBZoo Toolbox - Composer-Graph.
33
#
44
# This file is part of the JBZoo Toolbox project.
55
# For the full copyright and license information, please view the LICENSE
66
# file that was distributed with this source code.
77
#
8-
# @package Composer-Graph
98
# @license MIT
109
# @copyright Copyright (C) JBZoo.com, All rights reserved.
11-
# @link https://github.com/JBZoo/Composer-Graph
10+
# @see https://github.com/JBZoo/Composer-Graph
1211
#
1312

1413
.idea

.phan.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
<?php
22

33
/**
4-
* JBZoo Toolbox - Composer-Graph
4+
* JBZoo Toolbox - Composer-Graph.
55
*
66
* This file is part of the JBZoo Toolbox project.
77
* For the full copyright and license information, please view the LICENSE
88
* file that was distributed with this source code.
99
*
10-
* @package Composer-Graph
1110
* @license MIT
1211
* @copyright Copyright (C) JBZoo.com, All rights reserved.
13-
* @link https://github.com/JBZoo/Composer-Graph
12+
* @see https://github.com/JBZoo/Composer-Graph
1413
*/
1514

1615
declare(strict_types=1);
1716

18-
$default = include __DIR__ . '/vendor/jbzoo/codestyle/src/phan/default.php';
17+
$default = include __DIR__ . '/vendor/jbzoo/codestyle/src/phan.php';
1918

20-
return array_merge($default, [
19+
return \array_merge($default, [
2120
'directory_list' => [
2221
'src',
2322

@@ -26,5 +25,5 @@
2625
'vendor/jbzoo/utils/src',
2726
'vendor/jbzoo/mermaid-php/src',
2827
'vendor/symfony/console',
29-
]
28+
],
3029
]);

Makefile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
#
2-
# JBZoo Toolbox - Composer-Graph
2+
# JBZoo Toolbox - Composer-Graph.
33
#
44
# This file is part of the JBZoo Toolbox project.
55
# For the full copyright and license information, please view the LICENSE
66
# file that was distributed with this source code.
77
#
8-
# @package Composer-Graph
98
# @license MIT
109
# @copyright Copyright (C) JBZoo.com, All rights reserved.
11-
# @link https://github.com/JBZoo/Composer-Graph
10+
# @see https://github.com/JBZoo/Composer-Graph
1211
#
1312

1413
.PHONY: build
@@ -28,7 +27,6 @@ update: ##@Project Install/Update all 3rd party dependencies
2827
$(call title,"Install/Update all 3rd party dependencies")
2928
@echo "Composer flags: $(JBZOO_COMPOSER_UPDATE_FLAGS)"
3029
@composer update $(JBZOO_COMPOSER_UPDATE_FLAGS)
31-
@make build-phar
3230

3331

3432
test-all: ##@Project Run all project tests at once

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# JBZoo / Composer-Graph
22

3-
[![Coverage Status](https://coveralls.io/repos/JBZoo/Composer-Graph/badge.svg)](https://coveralls.io/github/JBZoo/Composer-Graph) [![Psalm Coverage](https://shepherd.dev/github/JBZoo/Composer-Graph/coverage.svg)](https://shepherd.dev/github/JBZoo/Composer-Graph) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/jbzoo/composer-graph/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/jbzoo/composer-graph/?branch=master) [![CodeFactor](https://www.codefactor.io/repository/github/jbzoo/composer-graph/badge)](https://www.codefactor.io/repository/github/jbzoo/composer-graph/issues) [![PHP Strict Types](https://img.shields.io/badge/strict__types-%3D1-brightgreen)](https://www.php.net/manual/en/language.types.declarations.php#language.types.declarations.strict)
4-
[![Stable Version](https://poser.pugx.org/jbzoo/composer-graph/version)](https://packagist.org/packages/jbzoo/composer-graph) [![Latest Unstable Version](https://poser.pugx.org/jbzoo/composer-graph/v/unstable)](https://packagist.org/packages/jbzoo/composer-graph) [![Dependents](https://poser.pugx.org/jbzoo/composer-graph/dependents)](https://packagist.org/packages/jbzoo/composer-graph/dependents?order_by=downloads) [![GitHub Issues](https://img.shields.io/github/issues/jbzoo/composer-graph)](https://github.com/JBZoo/Composer-Graph/issues) [![Total Downloads](https://poser.pugx.org/jbzoo/composer-graph/downloads)](https://packagist.org/packages/jbzoo/composer-graph/stats) [![GitHub License](https://img.shields.io/github/license/jbzoo/composer-graph)](https://github.com/JBZoo/Composer-Graph/blob/master/LICENSE)
3+
[![CI](https://github.com/JBZoo/Composer-Graph/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/JBZoo/Composer-Graph/actions/workflows/main.yml?query=branch%3Amaster) [![Coverage Status](https://coveralls.io/repos/github/JBZoo/Composer-Graph/badge.svg?branch=master)](https://coveralls.io/github/JBZoo/Composer-Graph?branch=master) [![Psalm Coverage](https://shepherd.dev/github/JBZoo/Composer-Graph/coverage.svg)](https://shepherd.dev/github/JBZoo/Composer-Graph) [![Psalm Level](https://shepherd.dev/github/JBZoo/Composer-Graph/level.svg)](https://shepherd.dev/github/JBZoo/Composer-Graph) [![CodeFactor](https://www.codefactor.io/repository/github/jbzoo/composer-graph/badge)](https://www.codefactor.io/repository/github/jbzoo/composer-graph/issues)
4+
[![Stable Version](https://poser.pugx.org/jbzoo/composer-graph/version)](https://packagist.org/packages/jbzoo/composer-graph/) [![Total Downloads](https://poser.pugx.org/jbzoo/composer-graph/downloads)](https://packagist.org/packages/jbzoo/composer-graph/stats) [![Dependents](https://poser.pugx.org/jbzoo/composer-graph/dependents)](https://packagist.org/packages/jbzoo/composer-graph/dependents?order_by=downloads) [![Visitors](https://visitor-badge.glitch.me/badge?page_id=jbzoo.composer-graph)]() [![GitHub License](https://img.shields.io/github/license/jbzoo/composer-graph)](https://github.com/JBZoo/Composer-Graph/blob/master/LICENSE)
55

66

77
## Installation
@@ -42,6 +42,7 @@ Options:
4242
--non-zero-on-error None-zero exit code on any StdErr message
4343
--timestamp Show timestamp at the beginning of each message
4444
--profile Display timing and memory usage information
45+
--cron Shortcut for crontab. It's basically focused on logs output. It's combination of --timestamp --profile --stdout-only --no-progress -vv
4546
-h, --help Display help for the given command. When no command is given display help for the build command
4647
-q, --quiet Do not output any message
4748
-V, --version Display this application version

composer-graph

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@
22
<?php
33

44
/**
5-
* JBZoo Toolbox - Composer-Graph
5+
* JBZoo Toolbox - Composer-Graph.
66
*
77
* This file is part of the JBZoo Toolbox project.
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.
1010
*
11-
* @package Composer-Graph
1211
* @license MIT
1312
* @copyright Copyright (C) JBZoo.com, All rights reserved.
14-
* @link https://github.com/JBZoo/Composer-Graph
13+
* @see https://github.com/JBZoo/Composer-Graph
1514
*/
1615

1716
declare(strict_types=1);

composer-graph.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
<?php
22

33
/**
4-
* JBZoo Toolbox - Composer-Graph
4+
* JBZoo Toolbox - Composer-Graph.
55
*
66
* This file is part of the JBZoo Toolbox project.
77
* For the full copyright and license information, please view the LICENSE
88
* file that was distributed with this source code.
99
*
10-
* @package Composer-Graph
1110
* @license MIT
1211
* @copyright Copyright (C) JBZoo.com, All rights reserved.
13-
* @link https://github.com/JBZoo/Composer-Graph
12+
* @see https://github.com/JBZoo/Composer-Graph
1413
*/
1514

1615
declare(strict_types=1);
@@ -19,12 +18,12 @@
1918

2019
use JBZoo\Cli\CliApplication;
2120

22-
const PATH_ROOT = __DIR__;
21+
\define('PATH_ROOT', __DIR__);
2322

2423
$vendorPaths = [
2524
__DIR__ . '/../../autoload.php',
2625
__DIR__ . '/../vendor/autoload.php',
27-
__DIR__ . '/vendor/autoload.php'
26+
__DIR__ . '/vendor/autoload.php',
2827
];
2928

3029
foreach ($vendorPaths as $file) {

0 commit comments

Comments
 (0)