Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2 Release #11

Merged
merged 4 commits into from
Dec 16, 2024
Merged
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
3 changes: 0 additions & 3 deletions .env.example

This file was deleted.

7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Ensure all text files use LF line endings
* text eol=lf

# Specific file types
*.php text eol=lf
*.json text eol=lf
*.md text eol=lf
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [Douglasokolaa]
27 changes: 27 additions & 0 deletions .github/workflows/php-cs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: php-cs

on:
push:
paths:
- '**.php'
pull_request:
branches: [ "master", "develop" ]

jobs:
php-cs-lint:
name: analyze
runs-on: ubuntu-latest
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: none

- uses: actions/checkout@v4

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

- name: Lint
run: ./vendor/bin/php-cs-fixer check --allow-risky=yes
29 changes: 29 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: PHPStan

on:
push:
paths:
- '**.php'
- 'phpstan.neon.dist'
- '.github/workflows/phpstan.yml'
pull_request:
branches: [ "master", "develop" ]

jobs:
phpstan:
name: analyze
runs-on: ubuntu-latest
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: none

- uses: actions/checkout@v4

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

- name: Run PHPStan
run: ./vendor/bin/phpstan analyze --error-format=github
36 changes: 36 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Run Tests

on:
push:
paths:
- '**.php'
- 'composer.json'
- 'composer.lock'
- 'phpunit.xml'
pull_request:
branches: [ "master", "develop" ]

jobs:
pest:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ 'ubuntu-latest', 'windows-latest', 'macos-latest' ]
php-versions: [ '8.2', '8.3', '8.4' ]
phpunit-versions: [ 'latest' ]
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl
ini-values: post_max_size=256M, max_execution_time=180
coverage: xdebug
tools: php-cs-fixer, phpunit:${{ matrix.phpunit-versions }}

- uses: actions/checkout@v3
- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist

- name: run tests
run: ./vendor/bin/pest
57 changes: 57 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php

use PhpCsFixer\Config;
use PhpCsFixer\Finder;

$finder = Finder::create()
->in(__DIR__ . '/src')
->in(__DIR__ . '/tests');

return (new Config())
->setRules([
'@PSR12' => true,
'strict_param' => true,
'array_syntax' => ['syntax' => 'short'],
'no_trailing_comma_in_singleline_array' => true,
'trim_array_spaces' => true,
'single_quote' => true,
'blank_line_after_namespace' => true,
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'no_unused_imports' => true,
'class_attributes_separation' => [
'elements' => [
'method' => 'one',
'property' => 'one',
],
],
'function_declaration' => ['closure_function_spacing' => 'none'],
'method_argument_space' => [
'on_multiline' => 'ensure_fully_multiline',
],
'visibility_required' => ['elements' => ['property', 'method', 'const']],

'binary_operator_spaces' => ['default' => 'align_single_space_minimal'],
'cast_spaces' => ['space' => 'single'],
'concat_space' => ['spacing' => 'one'],

'control_structure_continuation_position' => ['position' => 'same_line'],
'curly_braces_position' => [
'control_structures_opening_brace' => 'same_line',
'functions_opening_brace' => 'next_line_unless_newline_at_signature_end',
'classes_opening_brace' => 'next_line_unless_newline_at_signature_end',
],

'phpdoc_align' => ['align' => 'vertical'],
'phpdoc_order' => true,
'phpdoc_scalar' => true,
'return_type_declaration' => ['space_before' => 'none'],
'declare_strict_types' => false,
'no_blank_lines_after_phpdoc' => true,
'no_extra_blank_lines' => ['tokens' => ['curly_brace_block', 'extra']],
'no_trailing_whitespace' => true,
'no_whitespace_in_blank_line' => true,
'semicolon_after_instruction' => true,
])
->setFinder($finder)
->setIndent(" ")
->setLineEnding("\n");
Loading
Loading