Skip to content

Commit 31e98d9

Browse files
authored
Merge pull request #9 from Setono/upgrade
Upgrade to PHP 7.4 among other things
2 parents 2998f2a + b8a592e commit 31e98d9

29 files changed

+302
-250
lines changed

.gitattributes

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
/spec export-ignore
21
/tests export-ignore
32
/.editorconfig export-ignore
43
/.gitattributes export-ignore
54
/.gitignore export-ignore
6-
/.scrutinizer.yml export-ignore
7-
/.travis.yml export-ignore
85
/easy-coding-standard.yaml export-ignore
9-
/phpspec.yml.dist export-ignore
10-
/phpstan.neon export-ignore
116
/phpunit.xml.dist export-ignore
7+
/psalm.xml export-ignore
128
/README.md export-ignore

.github/dependabot.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates
2+
3+
version: 2
4+
5+
updates:
6+
- commit-message:
7+
include: "scope"
8+
prefix: "composer"
9+
directory: "/"
10+
package-ecosystem: "composer"
11+
schedule:
12+
interval: "daily"
13+
versioning-strategy: "widen"
14+
15+
- commit-message:
16+
include: "scope"
17+
prefix: "github-actions"
18+
directory: "/"
19+
package-ecosystem: "github-actions"
20+
schedule:
21+
interval: "daily"

.github/workflows/build.yaml

Lines changed: 181 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,188 @@
1-
name: build
1+
name: "build"
22
on:
3-
push: ~
3+
push:
4+
branches:
5+
- "master"
46
pull_request: ~
57
schedule:
6-
- cron: 5 8 * * 3
8+
- cron: "5 8 * * 1"
9+
710
jobs:
8-
checks:
9-
name: PHP ${{ matrix.php-versions }}
10-
runs-on: ${{ matrix.operating-system }}
11+
coding-standards:
12+
name: "Coding Standards"
13+
14+
runs-on: "ubuntu-latest"
15+
1116
strategy:
12-
fail-fast: false
1317
matrix:
14-
operating-system: [ubuntu-latest]
15-
php-versions: ['7.2', '7.3', '7.4']
18+
php-version:
19+
- "7.4"
20+
21+
dependencies:
22+
- "highest"
23+
1624
steps:
17-
- name: Checkout
18-
uses: actions/checkout@v1
19-
- name: Setup PHP, with composer and extensions
20-
uses: shivammathur/setup-php@master
21-
with:
22-
php-version: ${{ matrix.php-versions }}
23-
extensions: intl, mbstring, sqlite
24-
- name: Install Composer dependencies
25-
run: composer update --no-progress --no-suggest --prefer-dist --no-interaction
26-
- name: Validate composer
27-
run: composer validate --strict
28-
- name: Check composer normalized
29-
run: composer normalize --dry-run
30-
- name: Check style
31-
run: composer check-style
32-
- name: Static analysis
33-
run: composer analyse
34-
- name: Run phpunit
35-
run: composer phpunit
25+
- name: "Checkout"
26+
uses: "actions/checkout@v2"
27+
28+
- name: "Setup PHP, with composer and extensions"
29+
uses: "shivammathur/setup-php@v2"
30+
with:
31+
php-version: "${{ matrix.php-version }}"
32+
extensions: "${{ env.PHP_EXTENSIONS }}"
33+
coverage: "none"
34+
35+
- name: "Install composer dependencies"
36+
uses: "ramsey/composer-install@v1"
37+
with:
38+
dependency-versions: "${{ matrix.dependencies }}"
39+
40+
- name: "Validate composer"
41+
run: "composer validate --strict || true"
42+
43+
- name: "Check composer normalized"
44+
run: "composer normalize --dry-run"
45+
46+
- name: "Check style"
47+
run: "composer check-style"
48+
49+
dependency-analysis:
50+
name: "Dependency Analysis"
51+
52+
runs-on: "ubuntu-latest"
53+
54+
strategy:
55+
matrix:
56+
php-version:
57+
- "7.4"
58+
59+
dependencies:
60+
- "highest"
61+
62+
steps:
63+
- name: "Checkout"
64+
uses: "actions/checkout@v2"
65+
66+
- name: "Setup PHP, with composer and extensions"
67+
uses: "shivammathur/setup-php@v2"
68+
with:
69+
coverage: "none"
70+
extensions: "${{ env.PHP_EXTENSIONS }}"
71+
php-version: "${{ matrix.php-version }}"
72+
tools: "composer-require-checker, composer-unused"
73+
74+
- name: "Install composer dependencies"
75+
uses: "ramsey/composer-install@v1"
76+
with:
77+
dependency-versions: "${{ matrix.dependencies }}"
78+
79+
- name: "Run maglnet/composer-require-checker"
80+
run: "composer-require-checker check"
81+
82+
- name: "Run composer-unused/composer-unused"
83+
run: "composer-unused"
84+
85+
static-code-analysis:
86+
name: "Static Code Analysis"
87+
88+
runs-on: "ubuntu-latest"
89+
90+
strategy:
91+
matrix:
92+
php-version:
93+
- "7.4"
94+
95+
dependencies:
96+
- "highest"
97+
98+
steps:
99+
- name: "Checkout"
100+
uses: "actions/checkout@v2"
101+
102+
- name: "Setup PHP, with composer and extensions"
103+
uses: "shivammathur/setup-php@v2"
104+
with:
105+
php-version: "${{ matrix.php-version }}"
106+
extensions: "${{ env.PHP_EXTENSIONS }}"
107+
coverage: "none"
108+
109+
- name: "Install composer dependencies"
110+
uses: "ramsey/composer-install@v1"
111+
with:
112+
dependency-versions: "${{ matrix.dependencies }}"
113+
114+
- name: "Static analysis"
115+
run: "composer analyse"
116+
117+
unit-tests:
118+
name: "Unit tests"
119+
120+
runs-on: "ubuntu-latest"
121+
122+
strategy:
123+
matrix:
124+
php-version:
125+
- "7.4"
126+
127+
dependencies:
128+
- "lowest"
129+
- "highest"
130+
131+
steps:
132+
- name: "Checkout"
133+
uses: "actions/checkout@v2"
134+
135+
- name: "Setup PHP, with composer and extensions"
136+
uses: "shivammathur/setup-php@v2"
137+
with:
138+
php-version: "${{ matrix.php-version }}"
139+
extensions: "${{ env.PHP_EXTENSIONS }}"
140+
coverage: "none"
141+
142+
- name: "Install composer dependencies"
143+
uses: "ramsey/composer-install@v1"
144+
with:
145+
dependency-versions: "${{ matrix.dependencies }}"
146+
147+
- name: "Run phpunit"
148+
run: "composer phpunit"
149+
150+
code-coverage:
151+
name: "Code Coverage"
152+
153+
runs-on: "ubuntu-latest"
154+
155+
strategy:
156+
matrix:
157+
php-version:
158+
- "7.4"
159+
160+
dependencies:
161+
- "highest"
162+
163+
steps:
164+
- name: "Checkout"
165+
uses: "actions/checkout@v2"
166+
167+
- name: "Setup PHP, with composer and extensions"
168+
uses: "shivammathur/setup-php@v2"
169+
with:
170+
coverage: "pcov"
171+
extensions: "${{ env.PHP_EXTENSIONS }}"
172+
php-version: "${{ matrix.php-version }}"
173+
174+
- name: "Set up problem matchers for phpunit/phpunit"
175+
run: "echo \"::add-matcher::${{ runner.tool_cache }}/phpunit.json\""
176+
177+
- name: "Install composer dependencies"
178+
uses: "ramsey/composer-install@v1"
179+
with:
180+
dependency-versions: "${{ matrix.dependencies }}"
181+
182+
- name: "Collect code coverage with pcov and phpunit/phpunit"
183+
run: "vendor/bin/phpunit --coverage-clover=.build/logs/clover.xml"
184+
185+
- name: "Send code coverage report to Codecov.io"
186+
env:
187+
CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}"
188+
run: "bash <(curl -s https://codecov.io/bash)"

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/vendor/
22
/composer.lock
33

4-
/phpspec.yml
54
/.phpunit.result.cache
65
/tests/db.sqlite
7-
/build/
6+
/.build/

.scrutinizer.yml

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

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019 Joachim Løvgaard
3+
Copyright (c) 2021 Setono
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
[![Latest Version on Packagist][ico-version]][link-packagist]
44
[![Software License][ico-license]](LICENSE)
55
[![Build Status][ico-github-actions]][link-github-actions]
6-
[![Quality Score][ico-code-quality]][link-code-quality]
76

87
Use this library when you need to process large amounts of entities and maybe in an asynchronous way.
98

@@ -238,8 +237,6 @@ foreach ($batches as $batch) {
238237
[ico-version]: https://img.shields.io/packagist/v/setono/doctrine-orm-batcher.svg
239238
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg
240239
[ico-github-actions]: https://github.com/Setono/doctrine-orm-batcher/workflows/build/badge.svg
241-
[ico-code-quality]: https://img.shields.io/scrutinizer/g/Setono/doctrine-orm-batcher.svg
242240

243241
[link-packagist]: https://packagist.org/packages/setono/doctrine-orm-batcher
244242
[link-github-actions]: https://github.com/Setono/doctrine-orm-batcher/actions
245-
[link-code-quality]: https://scrutinizer-ci.com/g/Setono/doctrine-orm-batcher

composer.json

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "setono/doctrine-orm-batcher",
33
"type": "library",
4-
"description": "A library for processing large collections",
4+
"description": "A library for processing large collections in Doctrine",
55
"license": "MIT",
66
"authors": [
77
{
@@ -10,19 +10,20 @@
1010
}
1111
],
1212
"require": {
13-
"php": "^7.2",
13+
"php": "^7.4",
14+
"doctrine/collections": "^1.6",
1415
"doctrine/orm": "^2.6",
15-
"symfony/property-access": "^4.3 || ^5.0",
16-
"thecodingmachine/safe": "^1.0"
16+
"doctrine/persistence": "^1.3 || ^2.1",
17+
"symfony/property-access": "^4.4 || ^5.2",
18+
"webmozart/assert": "^1.10"
1719
},
1820
"require-dev": {
19-
"doctrine/data-fixtures": "^1.3",
20-
"ergebnis/composer-normalize": "^2.1.1",
21-
"phpstan/phpstan": "^0.12",
22-
"phpstan/phpstan-strict-rules": "^0.12",
23-
"phpunit/phpunit": "^8.2",
24-
"symplify/easy-coding-standard": "^7.0",
25-
"thecodingmachine/phpstan-safe-rule": "^1.0@beta"
21+
"doctrine/data-fixtures": "^1.5",
22+
"doctrine/orm": "^2.8",
23+
"phpunit/phpunit": "^9.5.2",
24+
"psalm/plugin-phpunit": "^0.15.1",
25+
"setono/code-quality-pack": "^2.0",
26+
"weirdan/doctrine-psalm-plugin": "^1.0"
2627
},
2728
"config": {
2829
"sort-packages": true
@@ -43,12 +44,9 @@
4344
}
4445
},
4546
"scripts": {
46-
"analyse": "vendor/bin/phpstan analyse -c phpstan.neon -l max src/",
47-
"check-style": "vendor/bin/ecs check --ansi src/ tests/",
48-
"fix-style": "vendor/bin/ecs check --ansi src/ tests/ --fix",
49-
"phpunit": "vendor/bin/phpunit",
50-
"test": [
51-
"@phpunit"
52-
]
47+
"analyse": "psalm",
48+
"check-style": "ecs check",
49+
"fix-style": "ecs check --fix",
50+
"phpunit": "phpunit"
5351
}
5452
}

easy-coding-standard.yml

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

ecs.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
6+
use Symplify\EasyCodingStandard\ValueObject\Option;
7+
8+
return static function (ContainerConfigurator $containerConfigurator): void {
9+
$containerConfigurator->import(__DIR__ . '/vendor/setono/coding-standard/easy-coding-standard.php');
10+
$containerConfigurator->parameters()->set(Option::PATHS, [
11+
'src', 'tests'
12+
]);
13+
};

0 commit comments

Comments
 (0)