Skip to content

Commit

Permalink
Merge pull request #6 from AngryBytes/feat/upgrade
Browse files Browse the repository at this point in the history
Upgrade deps, PHP 7.4-8.1, additional checks
  • Loading branch information
t0mmie authored Dec 21, 2021
2 parents 6c40459 + 0ef6fb9 commit 6376535
Show file tree
Hide file tree
Showing 15 changed files with 217 additions and 421 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Check

on:
push:
branches: ['2.0']
pull_request:
branches: ['2.0']

jobs:

# Run PHP checks for all supported versions.
check-php:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['7.4', '8.0', '8.1']
steps:

- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: cs2pr

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install composer dependencies
run: composer install --prefer-dist

- name: PHPStan
run: vendor/bin/phpstan analyse -c phpstan.neon -l max --error-format=checkstyle src/ tests/ | cs2pr

- name: PHP CodeSniffer
run: vendor/bin/phpcs --standard=PSR2 --extensions=php --report=checkstyle src/ tests/ | cs2pr

- name: PHPUnit
run: vendor/bin/phpunit
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
/vendor/
composer.lock
/composer.lock
/vendor

/.php-cs-fixer.cache
/.phpunit.result.cache
10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changelog

## 2.0.0

### PHP support

- Dropped support for PHP `7.3` and lower.
- Added support for PHP `8.1`.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# DomainObject

[![Build Status](https://travis-ci.org/AngryBytes/domainobject.svg?branch=master)](https://travis-ci.org/AngryBytes/domainobject)
[![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)

This is a simple class that signifies classes that extend it are a
[DomainObject](http://c2.com/cgi/wiki?DomainObject). In a more practical sense
it offers a [properties](http://en.wikipedia.org/wiki/Property_(programming))
Expand Down
51 changes: 28 additions & 23 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
{
"name": "angrybytes/domainobject",
"description": "A simple DomainObject implementation that provides simulated properties for PHP < 5.5",
"license": "MIT",
"authors": [
{
"name": "Angry Bytes BV",
"email": "[email protected]",
"role": "owner",
"homepage": "http://angrybytes.com/"
},
{
"name": "Maurice Fonk",
"email": "[email protected]",
"role": "developer"
}
],
"autoload": {
"psr-0": {
"AngryBytes\\DomainObject": "src/"
}
"name": "angrybytes/domainobject",
"description": "A simple DomainObject implementation that provides simulated properties",
"license": "MIT",
"authors": [
{
"name": "Angry Bytes BV",
"email": "[email protected]",
"role": "owner",
"homepage": "http://angrybytes.com/"
},
"require": {},
"require-dev": {
"phpunit/phpunit": "3.7.*"
{
"name": "Maurice Fonk",
"email": "[email protected]",
"role": "developer"
}
],
"autoload": {
"psr-0": {
"AngryBytes\\DomainObject": "src/",
"AngryBytes\\DomainObject\\Test": "tests/"
}
},
"require": {
"php": "7.4.* || 8.0.* || 8.1.*"
},
"require-dev": {
"phpstan/phpstan": "1.2.0",
"phpunit/phpunit": "9.5.10",
"squizlabs/php_codesniffer": "3.6.2"
}
}
36 changes: 36 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
parameters:
ignoreErrors:
-
message: "#^Access to private property AngryBytes\\\\DomainObject\\\\Test\\\\Bar\\:\\:\\$bar\\.$#"
count: 1
path: tests/AngryBytes/DomainObject/Test/ComposedTest.php

-
message: "#^Access to private property AngryBytes\\\\DomainObject\\\\Test\\\\Bar\\:\\:\\$foo\\.$#"
count: 1
path: tests/AngryBytes/DomainObject/Test/ComposedTest.php

-
message: "#^Access to private property AngryBytes\\\\DomainObject\\\\Test\\\\Foo\\:\\:\\$bar\\.$#"
count: 1
path: tests/AngryBytes/DomainObject/Test/ComposedTest.php

-
message: "#^Cannot access offset 'bar' on mixed\\.$#"
count: 1
path: tests/AngryBytes/DomainObject/Test/ComposedTest.php

-
message: "#^Parameter \\#2 \\$array of method PHPUnit\\\\Framework\\\\Assert\\:\\:assertArrayHasKey\\(\\) expects array\\|ArrayAccess, mixed given\\.$#"
count: 2
path: tests/AngryBytes/DomainObject/Test/ComposedTest.php

-
message: "#^Access to private property AngryBytes\\\\DomainObject\\\\Test\\\\Foo\\:\\:\\$bar\\.$#"
count: 1
path: tests/AngryBytes/DomainObject/Test/PropertiesTest.php

-
message: "#^Access to private property AngryBytes\\\\DomainObject\\\\Test\\\\Foo\\:\\:\\$foo\\.$#"
count: 1
path: tests/AngryBytes/DomainObject/Test/PropertiesTest.php
21 changes: 15 additions & 6 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
<?xml version="1.0"?>
<phpunit
bootstrap="./tests/bootstrap.php"
colors="true"
>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
bootstrap="./vendor/autoload.php"
colors="true"
>

<testsuite name="DomainObject">
<directory>./tests/AngryBytes/DomainObject/Test</directory>
</testsuite>
<coverage>
<include>
<directory suffix=".php">src/</directory>
</include>
</coverage>

<testsuite name="DomainObject">
<directory>./tests/AngryBytes/DomainObject/Test</directory>
</testsuite>

</phpunit>
Loading

0 comments on commit 6376535

Please sign in to comment.