Skip to content

Commit a4a062f

Browse files
authored
Merge pull request #2 from cgauge/upgrade-php-packages
Upgrade PHP and Packages
2 parents e9cd716 + ae65551 commit a4a062f

20 files changed

+125
-129
lines changed

.github/workflows/phpunit.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Tests
2+
3+
env:
4+
PHP_VERSION: 8.2
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
12+
jobs:
13+
tests:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
- uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: ${{ env.PHP_VERSION }}
22+
23+
- name: Install dependencies
24+
run: composer install --prefer-dist --no-progress --no-suggest
25+
26+
- name: Test
27+
run: ./vendor/bin/phpunit

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ composer.phar
22
composer.lock
33
/vendor/
44
.phpunit.result.cache
5+
.phpunit.cache
6+
.phpcs-cache

.scrutinizer.yml

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

.travis.yml

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

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
[![Build Status](https://travis-ci.org/cgauge/task-manager-lib.svg?branch=master)](https://travis-ci.org/cgauge/task-manager-lib)
2-
[![Code Coverage](https://scrutinizer-ci.com/g/cgauge/task-manager-lib/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/cgauge/task-manager-lib/?branch=master)
3-
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/cgauge/task-manager-lib/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/cgauge/task-manager-lib/?branch=master)
4-
51
# Task Manager ⚙️
62

73
# Installation

composer.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
}
1414
],
1515
"require": {
16-
"php": ">=7.4"
16+
"php": ">=8.2"
1717
},
1818
"require-dev": {
19-
"phpunit/phpunit": "^9.5",
20-
"doctrine/coding-standard": "^8.0",
21-
"phpstan/phpstan": "^0.12.64"
19+
"phpunit/phpunit": "^10.0",
20+
"doctrine/coding-standard": "^12.0",
21+
"phpstan/phpstan": "^1.0"
2222
},
2323
"autoload": {
2424
"psr-4": {
@@ -29,5 +29,10 @@
2929
"psr-4": {
3030
"Test\\CustomerGauge\\TaskManager\\": "tests/"
3131
}
32+
},
33+
"config": {
34+
"allow-plugins": {
35+
"dealerdirect/phpcodesniffer-composer-installer": true
36+
}
3237
}
3338
}

phpcs.xml.dist

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0"?>
2+
<ruleset>
3+
<arg name="basepath" value="."/>
4+
<arg name="extensions" value="php"/>
5+
<arg name="parallel" value="80"/>
6+
<arg name="cache" value=".phpcs-cache"/>
7+
<arg name="colors"/>
8+
9+
<!-- Ignore warnings, show progress of the run and show sniff names -->
10+
<arg value="nps"/>
11+
12+
<!-- Directories to be checked -->
13+
<file>src</file>
14+
<file>tests</file>
15+
16+
<!-- Include full Doctrine Coding Standard -->
17+
<rule ref="Doctrine"/>
18+
</ruleset>

phpunit.xml.dist

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
backupGlobals="false"
4-
backupStaticAttributes="false"
5-
bootstrap="vendor/autoload.php"
6-
colors="true"
7-
convertErrorsToExceptions="true"
8-
convertNoticesToExceptions="true"
9-
convertWarningsToExceptions="true"
10-
processIsolation="false"
11-
stopOnFailure="false"
12-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
13-
<coverage processUncoveredFiles="true">
14-
<include>
15-
<directory suffix=".php">./src</directory>
16-
</include>
17-
</coverage>
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.2/phpunit.xsd"
4+
backupGlobals="false"
5+
bootstrap="vendor/autoload.php"
6+
colors="true"
7+
processIsolation="false"
8+
stopOnFailure="false"
9+
cacheDirectory=".phpunit.cache"
10+
backupStaticProperties="false">
11+
<coverage/>
1812
<testsuites>
1913
<testsuite name="Unit Tests">
2014
<directory suffix="Test.php">./tests</directory>
2115
</testsuite>
2216
</testsuites>
17+
<source>
18+
<include>
19+
<directory suffix=".php">./src</directory>
20+
</include>
21+
</source>
2322
</phpunit>

src/InvalidTaskAttribute.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,19 @@
2424
namespace CustomerGauge\TaskManager;
2525

2626
use InvalidArgumentException;
27-
use function get_class;
27+
2828
use function implode;
2929
use function sprintf;
3030

3131
class InvalidTaskAttribute extends InvalidArgumentException
3232
{
33-
/**
34-
* @param array<int, int|string> $keys
35-
*/
36-
public static function duplicatedKey(Task $task, array $keys) : self
33+
/** @param array<int, int|string> $keys */
34+
public static function duplicatedKey(Task $task, array $keys): self
3735
{
3836
$message = sprintf(
3937
'Duplicate task [%s] attribute keys [%s]. Use a different attribute key.',
40-
get_class($task),
41-
implode(', ', $keys)
38+
$task::class,
39+
implode(', ', $keys),
4240
);
4341

4442
return new static($message);

src/Reversible.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525

2626
interface Reversible
2727
{
28-
/**
29-
* @param mixed[] $attributes
30-
*/
31-
public function reverse(array $attributes) : void;
28+
/** @param mixed[] $attributes */
29+
public function reverse(array $attributes): void;
3230
}

0 commit comments

Comments
 (0)