Skip to content

Commit 7923c0a

Browse files
authored
Release/1.0.1 (#4)
1 parent c1da527 commit 7923c0a

11 files changed

+67
-49
lines changed

.github/workflows/auto-assign.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
name: Auto assign issues
1+
name: Auto assign issues and pull requests
22

33
on:
44
issues:
55
types:
66
- opened
7+
pull_request:
8+
types:
9+
- opened
710

811
jobs:
912
run:
@@ -12,11 +15,11 @@ jobs:
1215
issues: write
1316
pull-requests: write
1417
steps:
15-
- name: Assign issues
16-
uses: gustavofreze/auto-assign@1.0.0
18+
- name: Assign issues and pull requests
19+
uses: gustavofreze/auto-assign@1.1.4
1720
with:
1821
assignees: '${{ secrets.ASSIGNEES }}'
1922
github_token: '${{ secrets.GITHUB_TOKEN }}'
2023
allow_self_assign: 'true'
2124
allow_no_assignees: 'true'
22-
assignment_options: 'ISSUE'
25+
assignment_options: 'ISSUE,PULL_REQUEST'

.github/workflows/ci.yml

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,49 @@
11
name: CI
22

33
on:
4-
push:
54
pull_request:
65

76
permissions:
87
contents: read
98

9+
env:
10+
PHP_VERSION: '8.3'
11+
1012
jobs:
1113
auto-review:
1214
name: Auto review
1315
runs-on: ubuntu-latest
1416

1517
steps:
1618
- name: Checkout
17-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4
1820

19-
- name: Use PHP 8.2
21+
- name: Configure PHP
2022
uses: shivammathur/setup-php@v2
2123
with:
22-
php-version: '8.2'
24+
php-version: ${{ env.PHP_VERSION }}
2325

2426
- name: Install dependencies
2527
run: composer update --no-progress --optimize-autoloader
2628

27-
- name: Run phpcs
28-
run: composer phpcs
29-
30-
- name: Run phpmd
31-
run: composer phpmd
29+
- name: Run review
30+
run: composer review
3231

3332
tests:
3433
name: Tests
3534
runs-on: ubuntu-latest
3635

3736
steps:
3837
- name: Checkout
39-
uses: actions/checkout@v3
38+
uses: actions/checkout@v4
4039

41-
- name: Use PHP 8.2
40+
- name: Use PHP ${{ env.PHP_VERSION }}
4241
uses: shivammathur/setup-php@v2
4342
with:
44-
php-version: '8.2'
43+
php-version: ${{ env.PHP_VERSION }}
4544

4645
- name: Install dependencies
4746
run: composer update --no-progress --optimize-autoloader
4847

49-
- name: Run unit tests
50-
env:
51-
XDEBUG_MODE: coverage
52-
run: composer test
53-
54-
- name: Run mutation tests
55-
run: composer test-mutation
48+
- name: Run tests
49+
run: composer tests

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) 2022-2024 Tiny Blocks
3+
Copyright (c) 2022-2025 Tiny Blocks
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

Makefile

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
DOCKER_RUN = docker run --rm -it --net=host -v ${PWD}:/app -w /app gustavofreze/php:8.2
1+
ifeq ($(OS),Windows_NT)
2+
PWD := $(shell cd)
3+
else
4+
PWD := $(shell pwd -L)
5+
endif
6+
7+
ARCH := $(shell uname -m)
8+
PLATFORM :=
9+
10+
ifeq ($(ARCH),arm64)
11+
PLATFORM := --platform=linux/amd64
12+
endif
13+
14+
DOCKER_RUN = docker run ${PLATFORM} --rm -it --net=host -v ${PWD}:/app -w /app gustavofreze/php:8.3
215

316
.PHONY: configure test test-file test-no-coverage review show-reports clean
417

@@ -9,7 +22,7 @@ test:
922
@${DOCKER_RUN} composer tests
1023

1124
test-file:
12-
@${DOCKER_RUN} composer tests-file-no-coverage ${FILE}
25+
@${DOCKER_RUN} composer test-file ${FILE}
1326

1427
test-no-coverage:
1528
@${DOCKER_RUN} composer tests-no-coverage
@@ -22,4 +35,4 @@ show-reports:
2235

2336
clean:
2437
@sudo chown -R ${USER}:${USER} ${PWD}
25-
@rm -rf report vendor .phpunit.cache
38+
@rm -rf report vendor .phpunit.cache *.lock

composer.json

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,35 +40,34 @@
4040
}
4141
},
4242
"require": {
43-
"php": "^8.2"
43+
"php": "^8.3"
4444
},
4545
"require-dev": {
4646
"phpmd/phpmd": "^2.15",
4747
"phpunit/phpunit": "^11",
4848
"phpstan/phpstan": "^1",
49-
"infection/infection": "^0.29",
50-
"squizlabs/php_codesniffer": "^3.10"
49+
"infection/infection": "^0",
50+
"squizlabs/php_codesniffer": "^3.11"
5151
},
5252
"scripts": {
53+
"test": "phpunit --configuration phpunit.xml tests",
5354
"phpcs": "phpcs --standard=PSR12 --extensions=php ./src",
5455
"phpmd": "phpmd ./src text phpmd.xml --suffixes php --ignore-violations-on-exit",
5556
"phpstan": "phpstan analyse -c phpstan.neon.dist --quiet --no-progress",
56-
"test": "phpunit --log-junit=report/coverage/junit.xml --coverage-xml=report/coverage/coverage-xml --coverage-html=report/coverage/coverage-html tests",
57-
"test-mutation": "infection --only-covered --logger-html=report/coverage/mutation-report.html --coverage=report/coverage --min-msi=100 --min-covered-msi=100 --threads=4",
58-
"test-no-coverage": "phpunit --no-coverage",
59-
"test-mutation-no-coverage": "infection --only-covered --min-msi=100 --threads=4",
57+
"test-file": "phpunit --configuration phpunit.xml --no-coverage --filter",
58+
"mutation-test": "infection --only-covered --threads=max --logger-html=report/coverage/mutation-report.html --coverage=report/coverage",
59+
"test-no-coverage": "phpunit --configuration phpunit.xml --no-coverage tests",
6060
"review": [
6161
"@phpcs",
6262
"@phpmd",
6363
"@phpstan"
6464
],
6565
"tests": [
6666
"@test",
67-
"@test-mutation"
67+
"@mutation-test"
6868
],
6969
"tests-no-coverage": [
70-
"@test-no-coverage",
71-
"@test-mutation-no-coverage"
70+
"@test-no-coverage"
7271
]
7372
}
7473
}

infection.json.dist

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
{
2-
"timeout": 10,
3-
"testFramework": "phpunit",
2+
"logs": {
3+
"text": "report/infection/logs/infection-text.log",
4+
"summary": "report/infection/logs/infection-summary.log"
5+
},
46
"tmpDir": "report/infection/",
7+
"minMsi": 100,
8+
"timeout": 30,
59
"source": {
610
"directories": [
711
"src"
812
]
913
},
10-
"logs": {
11-
"text": "report/infection/logs/infection-text.log",
12-
"summary": "report/infection/logs/infection-summary.log"
13-
},
14-
"mutators": {
15-
"@default": true
16-
},
1714
"phpUnit": {
1815
"configDir": "",
1916
"customPath": "./vendor/bin/phpunit"
20-
}
17+
},
18+
"mutators": {
19+
"@default": true,
20+
"PublicVisibility": false
21+
},
22+
"minCoveredMsi": 100,
23+
"testFramework": "phpunit"
2124
}

phpunit.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
failOnRisky="true"
77
failOnWarning="true"
88
cacheDirectory=".phpunit.cache"
9+
executionOrder="random"
910
beStrictAboutOutputDuringTests="true">
1011

1112
<source>
@@ -22,14 +23,15 @@
2223

2324
<coverage>
2425
<report>
26+
<xml outputDirectory="report/coverage/coverage-xml"/>
27+
<html outputDirectory="report/coverage/coverage-html"/>
2528
<text outputFile="report/coverage.txt"/>
26-
<html outputDirectory="report/html/"/>
2729
<clover outputFile="report/coverage-clover.xml"/>
2830
</report>
2931
</coverage>
3032

3133
<logging>
32-
<junit outputFile="report/execution-result.xml"/>
34+
<junit outputFile="report/coverage/junit.xml"/>
3335
</logging>
3436

3537
</phpunit>

src/Internal/Exceptions/CollectionCannotBeChanged.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ final class CollectionCannotBeChanged extends ImmutableException
99
public function __construct(mixed $offset, mixed $value, string $class)
1010
{
1111
$template = 'Cannot modify collection element at offset <%s> with value <%s> in class <%s>.';
12+
1213
parent::__construct(message: $this->withMessage($template, $offset, $value, $class));
1314
}
1415
}

src/Internal/Exceptions/CollectionCannotBeDeactivated.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ final class CollectionCannotBeDeactivated extends ImmutableException
99
public function __construct(mixed $offset, string $class)
1010
{
1111
$template = 'Cannot unset collection element at offset <%s> in class <%s>.';
12+
1213
parent::__construct(message: $this->withMessage($template, $offset, $class));
1314
}
1415
}

src/Internal/Exceptions/PropertyCannotBeChanged.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ final class PropertyCannotBeChanged extends ImmutableException
99
public function __construct(string $key, mixed $value, string $class)
1010
{
1111
$template = 'Property <%s> with value <%s> cannot be changed in class <%s>.';
12+
1213
parent::__construct(message: $this->withMessage($template, $key, $value, $class));
1314
}
1415
}

0 commit comments

Comments
 (0)