Skip to content

Commit 3f6dec2

Browse files
authored
Merge pull request #104: maintenance
- Resolve PHP 8.4 deprecations - Apply Spiral Code Style - Reuse github workflows
2 parents d882fe4 + 1140d9c commit 3f6dec2

File tree

122 files changed

+876
-734
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+876
-734
lines changed

.editorconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
indent_style = space
8+
indent_size = 4
9+
trim_trailing_whitespace = true
10+
11+
[*.{yml, yaml, sh, conf, neon*}]
12+
indent_size = 2
13+
14+
[*.http]
15+
end_of_line = crlf
16+
17+
[*.md]
18+
trim_trailing_whitespace = false
19+
20+
[Makefile]
21+
indent_style = tab

.gitattributes

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
/.github export-ignore
2-
/.editorconfig export-ignore
3-
/.gitattributes export-ignore
4-
/.gitignore export-ignore
5-
/tests export-ignore
1+
/.* export-ignore
2+
/tests export-ignore
3+
/*.xml export-ignore
4+
/*.yml export-ignore
5+
/*.lock export-ignore
6+
/*.dist export-ignore

.github/workflows/cs-fix.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
3+
on: # yamllint disable-line rule:truthy
4+
push:
5+
branches:
6+
- '*'
7+
8+
name: Fix Code Style
9+
10+
jobs:
11+
cs-fix:
12+
permissions:
13+
contents: write
14+
uses: spiral/gh-actions/.github/workflows/cs-fix.yml@master
15+
16+
...

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
fail-fast: false
1111
matrix:
12-
php-version: ['8.1', '8.2', '8.3']
12+
php-version: ['8.1', '8.2', '8.3', '8.4']
1313
steps:
1414
- name: Checkout
1515
uses: actions/checkout@v2
@@ -29,7 +29,7 @@ jobs:
2929
id: composer-cache
3030
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
3131
- name: Restore Composer Cache
32-
uses: actions/cache@v2
32+
uses: actions/cache@v4
3333
with:
3434
path: ${{ steps.composer-cache.outputs.dir }}
3535
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}

.github/workflows/psalm.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
on:
2-
pull_request:
2+
pull_request: null
33
push:
44
branches:
5+
- master
56
- '*.*'
67

78
name: static analysis

.gitignore

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
.idea/
2-
.env
1+
/.*/
2+
!/.github/
3+
/runtime/
4+
/vendor/
35
composer.lock
4-
vendor/
5-
*.db
6-
clover.xml
7-
.php_cs.cache
8-
.phpunit.cache
9-
build

.php-cs-fixer.dist.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+
require_once 'vendor/autoload.php';
6+
7+
return \Spiral\CodeStyle\Builder::create()
8+
->include(__DIR__ . '/src')
9+
->include(__DIR__ . '/tests')
10+
->include(__FILE__)
11+
->cache('./runtime/php-cs-fixer.cache')
12+
->allowRisky(false)
13+
->build();

.styleci.yml

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

composer.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,18 @@
3838
],
3939
"require": {
4040
"php": ">=8.1",
41-
"cycle/orm": "^2.7",
42-
"cycle/schema-builder": "^2.8",
41+
"cycle/orm": "^2.9.1",
42+
"cycle/schema-builder": "^2.11.1",
4343
"spiral/attributes": "^2.8|^3.0",
4444
"spiral/tokenizer": "^2.8|^3.0",
4545
"doctrine/inflector": "^2.0"
4646
},
4747
"require-dev": {
4848
"doctrine/annotations": "^1.14.3 || ^2.0.1",
4949
"phpunit/phpunit": "^10.1",
50-
"vimeo/psalm": "^5.11"
50+
"vimeo/psalm": "^5.26",
51+
"spiral/code-style": "^2.2",
52+
"spiral/dumper": "^3.3"
5153
},
5254
"autoload": {
5355
"psr-4": {
@@ -58,5 +60,12 @@
5860
"psr-4": {
5961
"Cycle\\Annotated\\Tests\\": "tests/Annotated/"
6062
}
63+
},
64+
"scripts": {
65+
"cs:diff": "php-cs-fixer fix --dry-run -v --diff",
66+
"cs:fix": "php-cs-fixer fix -v",
67+
"psalm": "psalm",
68+
"psalm:baseline": "psalm --set-baseline=psalm-baseline.xml",
69+
"test": "phpunit --color=always"
6170
}
6271
}

phpunit.xml

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,23 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
4+
cacheResultFile="runtime/phpunit/result.cache"
35
bootstrap="tests/bootstrap.php"
46
backupGlobals="false"
57
colors="true"
68
processIsolation="false"
79
stopOnFailure="false"
810
stopOnError="false"
9-
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
10-
cacheDirectory=".phpunit.cache"
1111
backupStaticProperties="false"
1212
>
13-
<coverage>
14-
<report>
15-
<html outputDirectory="build/coverage"/>
16-
<text outputFile="build/coverage.txt"/>
17-
<clover outputFile="build/logs/clover.xml"/>
18-
</report>
19-
</coverage>
20-
<logging>
21-
<junit outputFile="build/report.junit.xml"/>
22-
</logging>
23-
<testsuites>
24-
<testsuite name="Cycle ORM Annotated Entities">
25-
<directory>./tests/</directory>
26-
</testsuite>
27-
</testsuites>
28-
<source>
29-
<include>
30-
<directory>src</directory>
31-
</include>
32-
</source>
13+
<coverage>
14+
<include>
15+
<directory>src/</directory>
16+
</include>
17+
</coverage>
18+
<testsuites>
19+
<testsuite name="Cycle ORM Annotated Entities">
20+
<directory>./tests/</directory>
21+
</testsuite>
22+
</testsuites>
3323
</phpunit>

0 commit comments

Comments
 (0)