Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .codecov.yml

This file was deleted.

73 changes: 73 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: CI

on:
push:
branches: [master, v3]
pull_request:
branches: [master]

jobs:
tests:
name: PHP ${{ matrix.php }}
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php: ['8.2', '8.3']

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: gd, imagick
coverage: xdebug

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run tests
run: composer test

static-analysis:
name: Static Analysis
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: gd

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: PHPStan
run: composer analyze

code-style:
name: Code Style
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: PHP CS Fixer
run: composer cs
24 changes: 23 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
examples/
# Dependencies
vendor/
composer.lock
composer.phar

# IDE
.idea/
.vscode/
*.sublime-*
.claude

# Testing
phpunit.xml
.phpunit.cache/
coverage/
coverage.xml

# Tools
php-cs-fixer.phar
.php-cs-fixer.cache

# Build
build/
dist/

# OS
.DS_Store
Thumbs.db
63 changes: 63 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?php

declare(strict_types=1);

$finder = PhpCsFixer\Finder::create()
->in([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->name('*.php');

return (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setRules([
'@PSR12' => true,
'@PHP81Migration' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => true,
'blank_line_after_opening_tag' => true,
'blank_line_before_statement' => [
'statements' => ['return', 'throw', 'try'],
],
'cast_spaces' => ['space' => 'single'],
'class_attributes_separation' => [
'elements' => ['method' => 'one'],
],
'concat_space' => ['spacing' => 'one'],
'declare_strict_types' => true,
'function_typehint_space' => true,
'global_namespace_import' => [
'import_classes' => true,
'import_constants' => false,
'import_functions' => false,
],
'method_argument_space' => [
'on_multiline' => 'ensure_fully_multiline',
],
'native_function_invocation' => [
'include' => ['@compiler_optimized'],
'scope' => 'namespaced',
],
'no_empty_statement' => true,
'no_extra_blank_lines' => true,
'no_unused_imports' => true,
'ordered_imports' => [
'sort_algorithm' => 'alpha',
],
'phpdoc_align' => ['align' => 'left'],
'phpdoc_order' => true,
'phpdoc_scalar' => true,
'phpdoc_separation' => true,
'phpdoc_trim' => true,
'return_type_declaration' => ['space_before' => 'none'],
'single_blank_line_at_eof' => true,
'single_quote' => true,
'trailing_comma_in_multiline' => [
'elements' => ['arrays', 'arguments', 'parameters'],
],
'trim_array_spaces' => true,
'void_return' => true,
'yoda_style' => false,
])
->setFinder($finder);
8 changes: 0 additions & 8 deletions .styleci.yml

This file was deleted.

21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

Loading