Skip to content

feat: refactor to native enums #106

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
7 changes: 2 additions & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@ root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

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

[docker-compose.yml]
indent_size = 4
29 changes: 18 additions & 11 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
* text=auto

# Path-based git attributes
# https://git-scm.com/docs/gitattributes
* text=auto

# Ignore all test and documentation with "export-ignore".
/.editorconfig export-ignore
/.gitattributes export-ignore
/.github export-ignore
/.gitignore export-ignore
/docs export-ignore
/phpcs.xml export-ignore
/phpunit.xml.dist export-ignore
/renovate.json export-ignore
/tests export-ignore
/.github export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/phpunit.xml.dist export-ignore
/art export-ignore
/docs export-ignore
/tests export-ignore
/.editorconfig export-ignore
/.php_cs.dist.php export-ignore
/psalm.xml export-ignore
/psalm.xml.dist export-ignore
/testbench.yaml export-ignore
/UPGRADING.md export-ignore
/phpstan.neon.dist export-ignore
/phpstan-baseline.neon export-ignore
/docker export-ignore
/docker-compose.yml export-ignore
32 changes: 0 additions & 32 deletions .github/workflows/code-analysis.yml

This file was deleted.

41 changes: 0 additions & 41 deletions .github/workflows/main.yml

This file was deleted.

47 changes: 47 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Static Analysis

on:
push:
paths:
- '**.php'
- 'phpstan.neon.dist'

jobs:
phpstan:
name: PHPStan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
coverage: none

- name: Install composer dependencies
uses: ramsey/composer-install@v3

- name: Run PHPStan
run: composer test:types

ecs:
name: ECS

runs-on: ubuntu-latest

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
coverage: none

- name: Install Dependencies
run: composer update --prefer-dist --no-interaction --no-progress --ansi

- name: Run ECS
run: composer test:style
48 changes: 48 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Tests

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
php: [8.4, 8.3]
laravel: [12.*, 11.*]
stability: [prefer-lowest, prefer-stable]
include:
- laravel: 12.*
testbench: 10.*
- laravel: 11.*
testbench: 9.*

name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none

- name: Setup problem matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update --ansi
composer update --${{ matrix.stability }} --prefer-dist --no-interaction --ansi

- name: Execute tests
run: composer test:unit
20 changes: 15 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
vendor
.phpunit.result.cache
.idea
.DS_Store
composer.lock
/.idea
/build
/vendor
/.php_cs.cache
/composer.lock
/phpunit.xml
/phpstan.neon
.php_cs
.php_cs.cache
.phpunit.cache
.php-cs-fixer.cache
coverage
docs
node_modules
testbench.yaml
16 changes: 10 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,23 @@
"license": "MIT",
"require": {
"php": "^8.2",
"bensampo/laravel-enum": "^6.11",
"guzzlehttp/guzzle": "^7.8",
"illuminate/container": "^10.0 || ^11.0",
"illuminate/contracts": "^10.0 || ^11.0",
"illuminate/database": "^10.0 || ^11.0",
"illuminate/support": "^10.0 || ^11.0",
"nesbot/carbon": "^2.72 || ^3.0",
"nuwave/lighthouse": "^6.36",
"phpoffice/phpspreadsheet": "^1.29.1 || ^2.2.2",
"nuwave/lighthouse": "^6.49",
"phpoffice/phpspreadsheet": "^1.29.10 || ^2.3.8",
"symfony/dependency-injection": "^6.4 || ^7.0"
},
"require-dev": {
"orchestra/testbench": "^8.0 || ^9.0",
"pestphp/pest": "^2.34",
"worksome/coding-style": "^2.10"
"larastan/larastan": "^3.1",
"nunomaduro/collision": "^7.10 || ^8.1.1",
"orchestra/testbench": "^9.12 || ^10.1",
"pestphp/pest": "^3.7",
"pestphp/pest-plugin-laravel": "^3.1",
"worksome/coding-style": "^3.2"
},
"autoload": {
"psr-4": {
Expand All @@ -44,10 +46,12 @@
"scripts": {
"lint": "vendor/bin/ecs --fix",
"test:unit": "vendor/bin/pest",
"test:types": "vendor/bin/phpstan analyse",
"test:coverage": "vendor/bin/pest --coverage --min=95",
"test:style": "vendor/bin/ecs",
"test": [
"@test:style",
"@test:types",
"@test:unit"
]
},
Expand Down
13 changes: 13 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
services:
php:
build: ./docker
volumes:
- .:/var/www/html
environment:
- XDEBUG_MODE=${XDEBUG_MODE:-off}
- XDEBUG_CONFIG=${XDEBUG_CONFIG:-client_host=host.docker.internal}
composer:
build: ./docker
entrypoint: ["composer"]
volumes:
- .:/var/www/html
11 changes: 11 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM php:8.3-cli-alpine

RUN apk add --no-cache $PHPIZE_DEPS linux-headers
RUN pecl install xdebug
RUN docker-php-ext-enable xdebug

COPY --from=composer:2 /usr/bin/composer /usr/bin/composer

WORKDIR /var/www/html

ENTRYPOINT ["php"]
Loading