Skip to content

Commit

Permalink
Merge pull request #8 from patinthehat/refactor-2
Browse files Browse the repository at this point in the history
Add Laravel Pint
  • Loading branch information
Thavarshan authored Oct 11, 2024
2 parents 79e8634 + 158d625 commit 2515e76
Show file tree
Hide file tree
Showing 16 changed files with 161 additions and 412 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/laravel-pint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Check & fix styling

on: [push]

jobs:
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [8.3]

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: json, dom, curl, libxml, mbstring
coverage: none

- name: Install Pint
run: composer global require laravel/pint

- name: Run Pint
run: pint

- name: Commit linted files
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Fix coding style"

23 changes: 0 additions & 23 deletions .github/workflows/php-cs-fixer.yml

This file was deleted.

67 changes: 0 additions & 67 deletions .php-cs-fixer.dist.php

This file was deleted.

45 changes: 45 additions & 0 deletions pint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"preset": "laravel",
"rules": {
"no_unused_imports": true,
"array_indentation": true,
"declare_strict_types": true,
"array_syntax": {
"syntax": "short"
},
"blank_line_before_statement": {
"statements": [
"break",
"declare",
"return",
"throw",
"try",
"while",
"for",
"if",
"continue",
"foreach"
]
},
"braces": {
"allow_single_line_anonymous_class_with_empty_body": false,
"allow_single_line_closure": false,
"position_after_anonymous_constructs": "same",
"position_after_control_structures": "same",
"position_after_functions_and_oop_constructs": "next"
},
"cast_spaces": false,
"concat_space": {
"spacing": "one"
},
"binary_operator_spaces": {
"operators": {
"=>": "align_single_space_minimal"
}
},
"ordered_imports": {
"sort_algorithm": "length"
},
"nullable_type_declaration_for_default_null_value": false
}
}
2 changes: 2 additions & 0 deletions src/Fetch/Enum/Status.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Fetch\Enum;

enum Status: int
Expand Down
Loading

0 comments on commit 2515e76

Please sign in to comment.