Skip to content

Commit

Permalink
Merge pull request #104: maintenance
Browse files Browse the repository at this point in the history
- Resolve PHP 8.4 deprecations
- Apply Spiral Code Style
- Reuse github workflows
  • Loading branch information
roxblnfk authored Dec 13, 2024
2 parents d882fe4 + 1140d9c commit 3f6dec2
Show file tree
Hide file tree
Showing 122 changed files with 876 additions and 734 deletions.
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.{yml, yaml, sh, conf, neon*}]
indent_size = 2

[*.http]
end_of_line = crlf

[*.md]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab
11 changes: 6 additions & 5 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/.github export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/tests export-ignore
/.* export-ignore
/tests export-ignore
/*.xml export-ignore
/*.yml export-ignore
/*.lock export-ignore
/*.dist export-ignore
16 changes: 16 additions & 0 deletions .github/workflows/cs-fix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---

on: # yamllint disable-line rule:truthy
push:
branches:
- '*'

name: Fix Code Style

jobs:
cs-fix:
permissions:
contents: write
uses: spiral/gh-actions/.github/workflows/cs-fix.yml@master

...
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: ['8.1', '8.2', '8.3']
php-version: ['8.1', '8.2', '8.3', '8.4']
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -29,7 +29,7 @@ jobs:
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Restore Composer Cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/psalm.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
on:
pull_request:
pull_request: null
push:
branches:
- master
- '*.*'

name: static analysis
Expand Down
12 changes: 4 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
.idea/
.env
/.*/
!/.github/
/runtime/
/vendor/
composer.lock
vendor/
*.db
clover.xml
.php_cs.cache
.phpunit.cache
build
13 changes: 13 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

declare(strict_types=1);

require_once 'vendor/autoload.php';

return \Spiral\CodeStyle\Builder::create()
->include(__DIR__ . '/src')
->include(__DIR__ . '/tests')
->include(__FILE__)
->cache('./runtime/php-cs-fixer.cache')
->allowRisky(false)
->build();
81 changes: 0 additions & 81 deletions .styleci.yml

This file was deleted.

15 changes: 12 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,18 @@
],
"require": {
"php": ">=8.1",
"cycle/orm": "^2.7",
"cycle/schema-builder": "^2.8",
"cycle/orm": "^2.9.1",
"cycle/schema-builder": "^2.11.1",
"spiral/attributes": "^2.8|^3.0",
"spiral/tokenizer": "^2.8|^3.0",
"doctrine/inflector": "^2.0"
},
"require-dev": {
"doctrine/annotations": "^1.14.3 || ^2.0.1",
"phpunit/phpunit": "^10.1",
"vimeo/psalm": "^5.11"
"vimeo/psalm": "^5.26",
"spiral/code-style": "^2.2",
"spiral/dumper": "^3.3"
},
"autoload": {
"psr-4": {
Expand All @@ -58,5 +60,12 @@
"psr-4": {
"Cycle\\Annotated\\Tests\\": "tests/Annotated/"
}
},
"scripts": {
"cs:diff": "php-cs-fixer fix --dry-run -v --diff",
"cs:fix": "php-cs-fixer fix -v",
"psalm": "psalm",
"psalm:baseline": "psalm --set-baseline=psalm-baseline.xml",
"test": "phpunit --color=always"
}
}
34 changes: 12 additions & 22 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,33 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
cacheResultFile="runtime/phpunit/result.cache"
bootstrap="tests/bootstrap.php"
backupGlobals="false"
colors="true"
processIsolation="false"
stopOnFailure="false"
stopOnError="false"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
>
<coverage>
<report>
<html outputDirectory="build/coverage"/>
<text outputFile="build/coverage.txt"/>
<clover outputFile="build/logs/clover.xml"/>
</report>
</coverage>
<logging>
<junit outputFile="build/report.junit.xml"/>
</logging>
<testsuites>
<testsuite name="Cycle ORM Annotated Entities">
<directory>./tests/</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory>src</directory>
</include>
</source>
<coverage>
<include>
<directory>src/</directory>
</include>
</coverage>
<testsuites>
<testsuite name="Cycle ORM Annotated Entities">
<directory>./tests/</directory>
</testsuite>
</testsuites>
</phpunit>
Loading

0 comments on commit 3f6dec2

Please sign in to comment.