Skip to content

Commit

Permalink
Replace PHP CS fixer with Pint
Browse files Browse the repository at this point in the history
  • Loading branch information
tjardoo committed Feb 24, 2024
1 parent 7eecee7 commit 4efba63
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 60 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: PHPStan
name: Run PHPStan

on:
push:
paths:
- '**.php'
- 'phpstan.neon.dist'
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
phpstan:
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/php-cs-fixer.yml → .github/workflows/pint.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
name: Check & fix styling
name: Run Pint

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

jobs:
php-cs-fixer:
pint:
runs-on: ubuntu-latest

steps:
Expand All @@ -12,12 +16,10 @@ jobs:
with:
ref: ${{ github.head_ref }}

- name: Run PHP CS Fixer
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --config=.php_cs.dist.php --allow-risky=yes
- name: Run Pint
uses: aglipanci/[email protected]

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Fix styling
8 changes: 6 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: run-tests
name: Run tests

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

jobs:
test:
Expand Down
40 changes: 0 additions & 40 deletions .php_cs.dist.php

This file was deleted.

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

[![Latest Stable Version](https://poser.pugx.org/label84/laravel-auth-log/v/stable?style=flat-square)](https://packagist.org/packages/label84/laravel-auth-log)
[![MIT Licensed](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)
[![Quality Score](https://img.shields.io/scrutinizer/g/label84/laravel-auth-log.svg?style=flat-square)](https://scrutinizer-ci.com/g/label84/laravel-auth-log)
[![Total Downloads](https://img.shields.io/packagist/dt/label84/laravel-auth-log.svg?style=flat-square)](https://packagist.org/packages/label84/laravel-auth-log)
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/label84/laravel-auth-log/run-tests.yml?branch=master&style=flat-square)

Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
},
"require-dev": {
"orchestra/testbench": "^8.0|^9.0",
"larastan/larastan": "^2.0"
"larastan/larastan": "^2.0",
"laravel/pint": "^1.14"
},
"extra": {
"laravel": {
Expand Down
2 changes: 1 addition & 1 deletion src/AuthLogServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function boot(): void
{
if ($this->app->runningInConsole()) {
$this->publishes([
__DIR__.'/../config/config.php' => config_path('authlog.php'),
__DIR__.'/../config/config.php' => config_path('authlog.php'),
], 'config');
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Listeners/LogAuthAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
class LogAuthAction
{
/** @param mixed $event */
public function handle($event, array $context = null): void
public function handle($event, ?array $context = null): void
{
if (config('authlog.enabled') == false) {
return;
}

if (!in_array(get_class($event), config('authlog.events'))) {
if (! in_array(get_class($event), config('authlog.events'))) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Label84\AuthLog\Tests;

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Label84\AuthLog\AuthLogServiceProvider;
use Orchestra\Testbench\Factories\UserFactory;

Expand Down

0 comments on commit 4efba63

Please sign in to comment.