Skip to content

Commit 81741ed

Browse files
authored
New codestyle and PHP 8.1+ (#3)
1 parent c015050 commit 81741ed

18 files changed

+182
-338
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 - Markdown
2+
# JBZoo Toolbox - Markdown.
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 Markdown
98
# @license MIT
109
# @copyright Copyright (C) JBZoo.com, All rights reserved.
11-
# @link https://github.com/JBZoo/Markdown
10+
# @see https://github.com/JBZoo/Markdown
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 - Markdown
2+
# JBZoo Toolbox - Markdown.
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 Markdown
98
# @license MIT
109
# @copyright Copyright (C) JBZoo.com, All rights reserved.
11-
# @link https://github.com/JBZoo/Markdown
10+
# @see https://github.com/JBZoo/Markdown
1211
#
1312

1413
/.github export-ignore

.github/workflows/main.yml

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
#
2-
# JBZoo Toolbox - Markdown
2+
# JBZoo Toolbox - Markdown.
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 Markdown
98
# @license MIT
109
# @copyright Copyright (C) JBZoo.com, All rights reserved.
11-
# @link https://github.com/JBZoo/Markdown
10+
# @see https://github.com/JBZoo/Markdown
1211
#
1312

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

2625
env:
2726
COLUMNS: 120
@@ -35,20 +34,22 @@ jobs:
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
@@ -57,14 +58,17 @@ jobs:
5758
run: make test --no-print-directory
5859

5960
- name: Uploading coverage to coveralls
61+
if: "${{ matrix.coverage == 'xdebug' }}"
62+
continue-on-error: true
6063
env:
6164
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6265
run: make report-coveralls --no-print-directory || true
6366

6467
- name: Upload Artifacts
65-
uses: actions/upload-artifact@v2
68+
uses: actions/upload-artifact@v3
69+
continue-on-error: true
6670
with:
67-
name: PHPUnit - ${{ matrix.php-version }} ${{ matrix.composer_flags }}
71+
name: 'PHPUnit - ${{ matrix.php-version }} - ${{ matrix.coverage }}'
6872
path: build/
6973

7074

@@ -73,20 +77,20 @@ jobs:
7377
runs-on: ubuntu-latest
7478
strategy:
7579
matrix:
76-
php-version: [ 7.4, 8.0, 8.1 ]
80+
php-version: [ 8.1, 8.2 ]
7781
steps:
7882
- name: Checkout code
79-
uses: actions/checkout@v2
83+
uses: actions/checkout@v3
8084
with:
8185
fetch-depth: 0
8286

8387
- name: Setup PHP
8488
uses: shivammathur/setup-php@v2
8589
with:
8690
php-version: ${{ matrix.php-version }}
87-
coverage: xdebug
91+
coverage: none
8892
tools: composer
89-
extentions: ast
93+
extensions: ast
9094

9195
- name: Build the Project
9296
run: make update --no-print-directory
@@ -95,7 +99,8 @@ jobs:
9599
run: make codestyle --no-print-directory
96100

97101
- name: Upload Artifacts
98-
uses: actions/upload-artifact@v2
102+
uses: actions/upload-artifact@v3
103+
continue-on-error: true
99104
with:
100105
name: Linters - ${{ matrix.php-version }}
101106
path: build/
@@ -106,10 +111,10 @@ jobs:
106111
runs-on: ubuntu-latest
107112
strategy:
108113
matrix:
109-
php-version: [ 7.4, 8.0, 8.1 ]
114+
php-version: [ 8.1, 8.2 ]
110115
steps:
111116
- name: Checkout code
112-
uses: actions/checkout@v2
117+
uses: actions/checkout@v3
113118
with:
114119
fetch-depth: 0
115120

@@ -119,6 +124,7 @@ jobs:
119124
php-version: ${{ matrix.php-version }}
120125
coverage: xdebug
121126
tools: composer
127+
extensions: ast
122128

123129
- name: Build the Project
124130
run: make update --no-print-directory
@@ -127,7 +133,8 @@ jobs:
127133
run: make report-all --no-print-directory
128134

129135
- name: Upload Artifacts
130-
uses: actions/upload-artifact@v2
136+
uses: actions/upload-artifact@v3
137+
continue-on-error: true
131138
with:
132139
name: Reports - ${{ matrix.php-version }}
133140
path: build/

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
#
2-
# JBZoo Toolbox - Markdown
2+
# JBZoo Toolbox - Markdown.
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 Markdown
98
# @license MIT
109
# @copyright Copyright (C) JBZoo.com, All rights reserved.
11-
# @link https://github.com/JBZoo/Markdown
10+
# @see https://github.com/JBZoo/Markdown
1211
#
1312

1413
.idea

.phan.php

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

33
/**
4-
* JBZoo Toolbox - Markdown
4+
* JBZoo Toolbox - Markdown.
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 Markdown
1110
* @license MIT
1211
* @copyright Copyright (C) JBZoo.com, All rights reserved.
13-
* @link https://github.com/JBZoo/Markdown
12+
* @see https://github.com/JBZoo/Markdown
1413
*/
1514

1615
declare(strict_types=1);
1716

1817
$default = include __DIR__ . '/vendor/jbzoo/codestyle/src/phan/default.php';
1918

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

24-
'vendor/jbzoo/utils'
25-
]
23+
'vendor/jbzoo/utils',
24+
],
2625
]);

Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
#
2-
# JBZoo Toolbox - Markdown
2+
# JBZoo Toolbox - Markdown.
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 Markdown
98
# @license MIT
109
# @copyright Copyright (C) JBZoo.com, All rights reserved.
11-
# @link https://github.com/JBZoo/Markdown
10+
# @see https://github.com/JBZoo/Markdown
1211
#
1312

1413

README.md

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

3-
[![Coverage Status](https://coveralls.io/repos/JBZoo/Markdown/badge.svg)](https://coveralls.io/github/JBZoo/Markdown) [![Psalm Coverage](https://shepherd.dev/github/JBZoo/Markdown/coverage.svg)](https://shepherd.dev/github/JBZoo/Markdown)
4-
[![Stable Version](https://poser.pugx.org/jbzoo/markdown/version)](https://packagist.org/packages/jbzoo/markdown) [![Latest Unstable Version](https://poser.pugx.org/jbzoo/markdown/v/unstable)](https://packagist.org/packages/jbzoo/markdown) [![Dependents](https://poser.pugx.org/jbzoo/markdown/dependents)](https://packagist.org/packages/jbzoo/markdown/dependents?order_by=downloads) [![GitHub Issues](https://img.shields.io/github/issues/jbzoo/markdown)](https://github.com/JBZoo/Markdown/issues) [![Total Downloads](https://poser.pugx.org/jbzoo/markdown/downloads)](https://packagist.org/packages/jbzoo/markdown/stats) [![GitHub License](https://img.shields.io/github/license/jbzoo/markdown)](https://github.com/JBZoo/Markdown/blob/master/LICENSE)
3+
[![CI](https://github.com/JBZoo/Markdown/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/JBZoo/Markdown/actions/workflows/main.yml?query=branch%3Amaster) [![Coverage Status](https://coveralls.io/repos/github/JBZoo/Markdown/badge.svg?branch=master)](https://coveralls.io/github/JBZoo/Markdown?branch=master) [![Psalm Coverage](https://shepherd.dev/github/JBZoo/Markdown/coverage.svg)](https://shepherd.dev/github/JBZoo/Markdown) [![Psalm Level](https://shepherd.dev/github/JBZoo/Markdown/level.svg)](https://shepherd.dev/github/JBZoo/Markdown) [![CodeFactor](https://www.codefactor.io/repository/github/jbzoo/markdown/badge)](https://www.codefactor.io/repository/github/jbzoo/markdown/issues)
4+
[![Stable Version](https://poser.pugx.org/jbzoo/markdown/version)](https://packagist.org/packages/jbzoo/markdown/) [![Total Downloads](https://poser.pugx.org/jbzoo/markdown/downloads)](https://packagist.org/packages/jbzoo/markdown/stats) [![Dependents](https://poser.pugx.org/jbzoo/markdown/dependents)](https://packagist.org/packages/jbzoo/markdown/dependents?order_by=downloads) [![Visitors](https://visitor-badge.glitch.me/badge?page_id=jbzoo.markdown)]() [![GitHub License](https://img.shields.io/github/license/jbzoo/markdown)](https://github.com/JBZoo/Markdown/blob/master/LICENSE)
5+
56

67

78

composer.json

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,50 @@
11
{
2-
"name" : "jbzoo/markdown",
3-
"type" : "library",
4-
"description" : "Tools to render markdown text from PHP code",
5-
"keywords" : ["jbzoo", "markdown", "text", "readme", "rendering"],
6-
"license" : "MIT",
2+
"name" : "jbzoo/markdown",
3+
"type" : "library",
4+
"license" : "MIT",
5+
"description" : "Tools to render markdown text from PHP code",
6+
"keywords" : [
7+
"jbzoo",
8+
"markdown",
9+
"text",
10+
"readme",
11+
"rendering"
12+
],
713

8-
"authors" : [
14+
"authors" : [
915
{
1016
"name" : "Denis Smetannikov",
1117
"email" : "[email protected]",
1218
"role" : "lead"
1319
}
1420
],
1521

16-
"require" : {
17-
"php" : ">=7.4",
18-
"jbzoo/utils" : "^4.5|^5.0|dev-master|7.x-dev"
22+
"minimum-stability" : "dev",
23+
"prefer-stable" : true,
24+
25+
"require" : {
26+
"php" : "^8.1",
27+
"jbzoo/utils" : "7.x-dev"
1928
},
2029

21-
"require-dev" : {
22-
"jbzoo/toolbox-dev" : "^4.0.1"
30+
"require-dev" : {
31+
"jbzoo/toolbox-dev" : "7.x-dev"
2332
},
2433

25-
"autoload" : {
26-
"psr-4" : {
27-
"JBZoo\\Markdown\\" : "src"
28-
}
34+
"autoload" : {
35+
"psr-4" : {"JBZoo\\Markdown\\" : "src"}
2936
},
3037

31-
"autoload-dev" : {
32-
"classmap" : ["tests"]
38+
"autoload-dev" : {
39+
"psr-4" : {"JBZoo\\PHPUnit\\" : "tests"}
3340
},
3441

35-
"config" : {
42+
"config" : {
3643
"optimize-autoloader" : true,
37-
"allow-plugins" : {
38-
"composer/package-versions-deprecated" : true
39-
}
44+
"allow-plugins" : {"composer/package-versions-deprecated" : true}
4045
},
4146

42-
"extra" : {
47+
"extra" : {
4348
"branch-alias" : {
4449
"dev-master" : "7.x-dev"
4550
}

src/Exception.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,21 @@
11
<?php
22

33
/**
4-
* JBZoo Toolbox - Markdown
4+
* JBZoo Toolbox - Markdown.
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 Markdown
1110
* @license MIT
1211
* @copyright Copyright (C) JBZoo.com, All rights reserved.
13-
* @link https://github.com/JBZoo/Markdown
12+
* @see https://github.com/JBZoo/Markdown
1413
*/
1514

1615
declare(strict_types=1);
1716

1817
namespace JBZoo\Markdown;
1918

20-
/**
21-
* Class Exception
22-
* @package JBZoo\Markdown
23-
*/
2419
class Exception extends \RuntimeException
2520
{
2621
}

0 commit comments

Comments
 (0)