Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Poyigi <[email protected]>
  • Loading branch information
sampoyigi committed Jan 19, 2024
1 parent ee23221 commit 9ae3e42
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 26 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/pint.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: PHP Linting (Pint)

on: [push, pull_request]
on: [ push, pull_request, workflow_dispatch ]

jobs:
phplint:
Expand All @@ -9,6 +9,13 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

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

- name: Composer Install
run: composer install --no-interaction

Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
name: Pest Tests

on: [push, pull_request]
on: [ push, pull_request, workflow_dispatch ]

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
php: [8.1, 8.2]
os: [ ubuntu-latest ]
php: [ 8.2, 8.3 ]

name: PHP ${{ matrix.php }} - ${{ matrix.os }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: "Static Analysis"

on: [push, pull_request]
on: [ push, pull_request, workflow_dispatch ]

jobs:
types:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: ["8.1", "8.2"]
php: [ 8.2, 8.3 ]
name: PHP ${{ matrix.php }} - Static Analysis
steps:
- name: Checkout code
Expand Down
18 changes: 4 additions & 14 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,6 @@ parameters:
count: 1
path: src/AutomationRules/Actions/SendMailTemplate.php

-
message: "#^Call to method mailGetData\\(\\) on an unknown class Igniter\\\\Reservation\\\\Models\\\\Reservation\\.$#"
count: 1
path: src/AutomationRules/Events/ReservationSchedule.php

-
message: "#^Class Igniter\\\\Reservation\\\\Models\\\\Reservation not found\\.$#"
count: 1
path: src/AutomationRules/Events/ReservationSchedule.php

-
message: "#^PHPDoc tag @param has invalid value \\(mixed Class name or object\\)\\: Unexpected token \"Class\", expected variable at offset 108$#"
count: 1
Expand All @@ -91,13 +81,13 @@ parameters:
path: src/Classes/EventManager.php

-
message: "#^Call to an undefined static method Illuminate\\\\Support\\\\Facades\\\\Event\\:\\:fire\\(\\)\\.$#"
count: 2
message: "#^Call to an undefined static method Igniter\\\\Reservation\\\\Models\\\\Reservation\\:\\:where\\(\\)\\.$#"
count: 1
path: src/Classes/EventManager.php

-
message: "#^Call to static method where\\(\\) on an unknown class Igniter\\\\Reservation\\\\Models\\\\Reservation\\.$#"
count: 1
message: "#^Call to an undefined static method Illuminate\\\\Support\\\\Facades\\\\Event\\:\\:fire\\(\\)\\.$#"
count: 2
path: src/Classes/EventManager.php

-
Expand Down
2 changes: 1 addition & 1 deletion pint.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"braces": false,
"self_accessor": false,
"phpdoc_separation": false,
"Laravel/laravel_phpdoc_alignment": false,
"phpdoc_align": false,
"no_trailing_comma_in_singleline": false,
"phpdoc_trim_consecutive_blank_line_separation": true,
"blank_line_before_statement": {
Expand Down
6 changes: 2 additions & 4 deletions src/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Igniter\Admin\Widgets\Form;
use Igniter\Automation\Classes\EventManager;
use Igniter\System\Classes\BaseExtension;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Support\Facades\Event;

/**
Expand Down Expand Up @@ -70,11 +71,8 @@ public function registerAutomationRules()

/**
* Registers scheduled tasks that are executed on a regular basis.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
public function registerSchedule(string $schedule)
public function registerSchedule(Schedule $schedule)
{
$schedule->call(function () {
// Pull orders created within the last 30days
Expand Down

0 comments on commit 9ae3e42

Please sign in to comment.