Skip to content

Commit e86c849

Browse files
authored
Merge pull request #4 from jakubboucek/update
Update
2 parents 8e100fb + cc6f0ad commit e86c849

File tree

4 files changed

+65
-67
lines changed

4 files changed

+65
-67
lines changed

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.gitattributes export-ignore
2+
.gitignore export-ignore
3+
.github export-ignore
4+
phpstan.neon export-ignore
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Code analysis
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
# Cancels all previous workflow runs for the same branch that have not yet completed.
8+
concurrency:
9+
# The concurrency group contains the workflow name and the branch name.
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
static-analysis:
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
php:
19+
- "7.2"
20+
- "7.3"
21+
- "7.4"
22+
- "8.0"
23+
- "8.1"
24+
- "8.2"
25+
- "8.3"
26+
name: PHPStan at PHP ${{ matrix.php }}
27+
runs-on: ubuntu-latest
28+
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@v3
32+
33+
- name: Install PHP
34+
uses: shivammathur/setup-php@v2
35+
with:
36+
php-version: ${{ matrix.php }}
37+
coverage: none
38+
39+
- name: Get Composer cache directory
40+
id: composer-cache
41+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
42+
43+
- name: Cache dependencies
44+
uses: actions/cache@v3
45+
with:
46+
path: ${{ steps.composer-cache.outputs.dir }}
47+
key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }}
48+
restore-keys: ${{ runner.os }}-composer-
49+
50+
- name: Install Composer dependencies
51+
run: composer update --no-progress
52+
53+
- name: Statically analyze code (PHPStan)
54+
run: composer run phpstan -- --ansi

.github/workflows/code_analysis.yaml

Lines changed: 0 additions & 62 deletions
This file was deleted.

composer.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "jakubboucek/esc-pos",
33
"description": "Native ESC-POS drivers",
4-
"type": "library",
54
"license": "MIT",
5+
"type": "library",
66
"authors": [
77
{
88
"name": "Jakub Bouček",
@@ -11,18 +11,20 @@
1111
],
1212
"require": {
1313
"php": ">=7.2",
14-
"composer-runtime-api": "^2.0",
15-
"ext-sockets": "*",
16-
"ext-iconv": "*"
14+
"ext-iconv": "*",
15+
"ext-sockets": "*"
1716
},
1817
"require-dev": {
19-
"phpstan/phpstan": "^0.12.89"
18+
"phpstan/phpstan": "^1.10"
2019
},
2120
"autoload": {
2221
"psr-4": {
2322
"JakubBoucek\\EscPos\\": "src/"
2423
}
2524
},
25+
"config": {
26+
"sort-packages": true
27+
},
2628
"scripts": {
2729
"phpstan": "phpstan analyze src -c phpstan.neon --level 6"
2830
}

0 commit comments

Comments
 (0)