Skip to content

Commit 6376535

Browse files
authored
Merge pull request #6 from AngryBytes/feat/upgrade
Upgrade deps, PHP 7.4-8.1, additional checks
2 parents 6c40459 + 0ef6fb9 commit 6376535

15 files changed

Lines changed: 217 additions & 421 deletions

File tree

.github/workflows/check.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Check
2+
3+
on:
4+
push:
5+
branches: ['2.0']
6+
pull_request:
7+
branches: ['2.0']
8+
9+
jobs:
10+
11+
# Run PHP checks for all supported versions.
12+
check-php:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
php: ['7.4', '8.0', '8.1']
18+
steps:
19+
20+
- name: Checkout
21+
uses: actions/checkout@v2
22+
23+
- name: Setup PHP
24+
uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: ${{ matrix.php }}
27+
tools: cs2pr
28+
29+
- name: Get composer cache directory
30+
id: composer-cache
31+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
32+
33+
- name: Cache composer dependencies
34+
uses: actions/cache@v2
35+
with:
36+
path: ${{ steps.composer-cache.outputs.dir }}
37+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
38+
restore-keys: |
39+
${{ runner.os }}-composer-
40+
41+
- name: Install composer dependencies
42+
run: composer install --prefer-dist
43+
44+
- name: PHPStan
45+
run: vendor/bin/phpstan analyse -c phpstan.neon -l max --error-format=checkstyle src/ tests/ | cs2pr
46+
47+
- name: PHP CodeSniffer
48+
run: vendor/bin/phpcs --standard=PSR2 --extensions=php --report=checkstyle src/ tests/ | cs2pr
49+
50+
- name: PHPUnit
51+
run: vendor/bin/phpunit

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1-
/vendor/
2-
composer.lock
1+
/composer.lock
2+
/vendor
3+
4+
/.php-cs-fixer.cache
5+
/.phpunit.result.cache

.travis.yml

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

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changelog
2+
3+
## 2.0.0
4+
5+
### PHP support
6+
7+
- Dropped support for PHP `7.3` and lower.
8+
- Added support for PHP `8.1`.

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# DomainObject
22

3-
[![Build Status](https://travis-ci.org/AngryBytes/domainobject.svg?branch=master)](https://travis-ci.org/AngryBytes/domainobject)
4-
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/AngryBytes/domainobject/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/AngryBytes/domainobject/?branch=master)
5-
63
This is a simple class that signifies classes that extend it are a
74
[DomainObject](http://c2.com/cgi/wiki?DomainObject). In a more practical sense
85
it offers a [properties](http://en.wikipedia.org/wiki/Property_(programming))

composer.json

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,32 @@
11
{
2-
"name": "angrybytes/domainobject",
3-
"description": "A simple DomainObject implementation that provides simulated properties for PHP < 5.5",
4-
"license": "MIT",
5-
"authors": [
6-
{
7-
"name": "Angry Bytes BV",
8-
"email": "info@angrybytes.com",
9-
"role": "owner",
10-
"homepage": "http://angrybytes.com/"
11-
},
12-
{
13-
"name": "Maurice Fonk",
14-
"email": "maurice@naneau.net",
15-
"role": "developer"
16-
}
17-
],
18-
"autoload": {
19-
"psr-0": {
20-
"AngryBytes\\DomainObject": "src/"
21-
}
2+
"name": "angrybytes/domainobject",
3+
"description": "A simple DomainObject implementation that provides simulated properties",
4+
"license": "MIT",
5+
"authors": [
6+
{
7+
"name": "Angry Bytes BV",
8+
"email": "info@angrybytes.com",
9+
"role": "owner",
10+
"homepage": "http://angrybytes.com/"
2211
},
23-
"require": {},
24-
"require-dev": {
25-
"phpunit/phpunit": "3.7.*"
12+
{
13+
"name": "Maurice Fonk",
14+
"email": "maurice@naneau.net",
15+
"role": "developer"
2616
}
17+
],
18+
"autoload": {
19+
"psr-0": {
20+
"AngryBytes\\DomainObject": "src/",
21+
"AngryBytes\\DomainObject\\Test": "tests/"
22+
}
23+
},
24+
"require": {
25+
"php": "7.4.* || 8.0.* || 8.1.*"
26+
},
27+
"require-dev": {
28+
"phpstan/phpstan": "1.2.0",
29+
"phpunit/phpunit": "9.5.10",
30+
"squizlabs/php_codesniffer": "3.6.2"
31+
}
2732
}

phpstan.neon

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: "#^Access to private property AngryBytes\\\\DomainObject\\\\Test\\\\Bar\\:\\:\\$bar\\.$#"
5+
count: 1
6+
path: tests/AngryBytes/DomainObject/Test/ComposedTest.php
7+
8+
-
9+
message: "#^Access to private property AngryBytes\\\\DomainObject\\\\Test\\\\Bar\\:\\:\\$foo\\.$#"
10+
count: 1
11+
path: tests/AngryBytes/DomainObject/Test/ComposedTest.php
12+
13+
-
14+
message: "#^Access to private property AngryBytes\\\\DomainObject\\\\Test\\\\Foo\\:\\:\\$bar\\.$#"
15+
count: 1
16+
path: tests/AngryBytes/DomainObject/Test/ComposedTest.php
17+
18+
-
19+
message: "#^Cannot access offset 'bar' on mixed\\.$#"
20+
count: 1
21+
path: tests/AngryBytes/DomainObject/Test/ComposedTest.php
22+
23+
-
24+
message: "#^Parameter \\#2 \\$array of method PHPUnit\\\\Framework\\\\Assert\\:\\:assertArrayHasKey\\(\\) expects array\\|ArrayAccess, mixed given\\.$#"
25+
count: 2
26+
path: tests/AngryBytes/DomainObject/Test/ComposedTest.php
27+
28+
-
29+
message: "#^Access to private property AngryBytes\\\\DomainObject\\\\Test\\\\Foo\\:\\:\\$bar\\.$#"
30+
count: 1
31+
path: tests/AngryBytes/DomainObject/Test/PropertiesTest.php
32+
33+
-
34+
message: "#^Access to private property AngryBytes\\\\DomainObject\\\\Test\\\\Foo\\:\\:\\$foo\\.$#"
35+
count: 1
36+
path: tests/AngryBytes/DomainObject/Test/PropertiesTest.php

phpunit.xml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
1+
<?xml version="1.0"?>
12
<phpunit
2-
bootstrap="./tests/bootstrap.php"
3-
colors="true"
4-
>
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
5+
bootstrap="./vendor/autoload.php"
6+
colors="true"
7+
>
58

6-
<testsuite name="DomainObject">
7-
<directory>./tests/AngryBytes/DomainObject/Test</directory>
8-
</testsuite>
9+
<coverage>
10+
<include>
11+
<directory suffix=".php">src/</directory>
12+
</include>
13+
</coverage>
14+
15+
<testsuite name="DomainObject">
16+
<directory>./tests/AngryBytes/DomainObject/Test</directory>
17+
</testsuite>
918

1019
</phpunit>

0 commit comments

Comments
 (0)