From 256005bbef6ffce4c1366be6a35531e4e5e5c675 Mon Sep 17 00:00:00 2001 From: Sam Poyigi <6567634+sampoyigi@users.noreply.github.com> Date: Fri, 19 Jan 2024 22:31:38 +0000 Subject: [PATCH] Drop support for php 8.1 Signed-off-by: Sam Poyigi <6567634+sampoyigi@users.noreply.github.com> --- .github/workflows/pint.yml | 9 +- .github/workflows/run-tests.yml | 7 +- .github/workflows/static-analysis.yml | 4 +- composer.json | 129 +++++++++++++------------- phpstan-baseline.neon | 10 +- pint.json | 2 +- src/Actions/OrderAction.php | 3 +- 7 files changed, 86 insertions(+), 78 deletions(-) diff --git a/.github/workflows/pint.yml b/.github/workflows/pint.yml index 5d7108b..3f535ed 100644 --- a/.github/workflows/pint.yml +++ b/.github/workflows/pint.yml @@ -1,6 +1,6 @@ name: PHP Linting (Pint) -on: [push, pull_request] +on: [ push, pull_request, workflow_dispatch ] jobs: phplint: @@ -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 diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 5de4d51..7eb2704 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -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 }} diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 73bbb48..53e32fd 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -1,6 +1,6 @@ name: "Static Analysis" -on: [push, pull_request] +on: [ push, pull_request, workflow_dispatch ] jobs: types: @@ -8,7 +8,7 @@ jobs: 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 diff --git a/composer.json b/composer.json index 74352c7..8e21738 100644 --- a/composer.json +++ b/composer.json @@ -1,67 +1,68 @@ { - "name": "tastyigniter/ti-ext-cart", - "type": "tastyigniter-package", - "description": "Easily add a shopping cart to your site. The most powerful way to sell your menu items.", - "license": "MIT", - "authors": [ - { - "name": "Sam Poyigi", - "email": "sam@sampoyigi.com" - } - ], - "keywords": [ - "tastyigniter", - "cart", - "online-food-ordering", - "ordering" - ], - "require": { - "tastyigniter/ti-ext-automation": "v4.x-dev as 4.0", - "tastyigniter/ti-ext-local": "v4.x-dev as 4.0", - "tastyigniter/ti-ext-payregister": "v4.x-dev as 4.0", - "tastyigniter/ti-ext-user": "v4.x-dev as 4.0" - }, - "require-dev": { - "laravel/pint": "^1.2", - "nunomaduro/larastan": "^2.4.0", - "orchestra/testbench": "^8.5", - "pestphp/pest-plugin-laravel": "^2.0", - "igniterlabs/ti-ext-importexport": "v4.x-dev as 4.0", - "tastyigniter/core": "dev-master" - }, - "autoload": { - "psr-4": { - "Igniter\\Cart\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Igniter\\Cart\\Tests\\": "tests/" - } - }, - "extra": { - "tastyigniter-extension": { - "name": "Cart", - "icon": { - "class": "fa fa-shopping-cart", - "color": "#FFF", - "backgroundColor": "#ED561A" - }, - "homepage": "https://tastyigniter.com/marketplace/item/igniter-cart" - } - }, - "scripts": { - "test": "vendor/bin/pest", - "test-coverage": "vendor/bin/pest --coverage", - "format": "vendor/bin/pint", - "static": "vendor/bin/phpstan analyse --ansi --memory-limit 1056M" - }, - "config": { - "allow-plugins": { - "pestphp/pest-plugin": true, - "php-http/discovery": true, - "composer/installers": true - }, - "sort-packages": true + "name": "tastyigniter/ti-ext-cart", + "type": "tastyigniter-package", + "description": "Easily add a shopping cart to your site. The most powerful way to sell your menu items.", + "license": "MIT", + "authors": [ + { + "name": "Sam Poyigi", + "email": "sam@sampoyigi.com" + } + ], + "keywords": [ + "tastyigniter", + "cart", + "online-food-ordering", + "ordering" + ], + "require": { + "tastyigniter/ti-ext-automation": "v4.x-dev as 4.0", + "tastyigniter/ti-ext-local": "v4.x-dev as 4.0", + "tastyigniter/ti-ext-payregister": "v4.x-dev as 4.0", + "tastyigniter/ti-ext-user": "v4.x-dev as 4.0" + }, + "require-dev": { + "laravel/pint": "^1.2", + "nunomaduro/larastan": "^2.4.0", + "orchestra/testbench": "^8.5", + "pestphp/pest-plugin-laravel": "^2.0", + "igniterlabs/ti-ext-importexport": "v4.x-dev as 4.0", + "tastyigniter/core": "dev-master" + }, + "autoload": { + "psr-4": { + "Igniter\\Cart\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Igniter\\Cart\\Tests\\": "tests/" } + }, + "extra": { + "tastyigniter-extension": { + "name": "Cart", + "icon": { + "class": "fa fa-shopping-cart", + "color": "#FFF", + "backgroundColor": "#ED561A" + }, + "homepage": "https://tastyigniter.com/marketplace/item/igniter-cart" + } + }, + "scripts": { + "test": "vendor/bin/pest", + "test-coverage": "vendor/bin/pest --coverage", + "format": "vendor/bin/pint", + "static": "vendor/bin/phpstan analyse --ansi --memory-limit 1056M" + }, + "config": { + "allow-plugins": { + "pestphp/pest-plugin": true, + "php-http/discovery": true, + "composer/installers": true + }, + "sort-packages": true + }, + "minimum-stability": "dev" } diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 221184c..9302be3 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -396,7 +396,7 @@ parameters: path: src/FormWidgets/StockEditor.php - - message: "#^Access to an undefined property Igniter\\\\Flame\\\\Database\\\\Model\\:\\:\\$stocks\\.$#" + message: "#^Access to an undefined property Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:\\$stocks\\.$#" count: 1 path: src/FormWidgets/StockEditor.php @@ -406,17 +406,17 @@ parameters: path: src/FormWidgets/StockEditor.php - - message: "#^Call to an undefined method Igniter\\\\Flame\\\\Database\\\\Model\\:\\:getStockByLocation\\(\\)\\.$#" + message: "#^Call to an undefined method Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:getStockByLocation\\(\\)\\.$#" count: 1 path: src/FormWidgets/StockEditor.php - - message: "#^Call to an undefined method Igniter\\\\Flame\\\\Database\\\\Model\\:\\:getStockableLocations\\(\\)\\.$#" + message: "#^Call to an undefined method Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:getStockableLocations\\(\\)\\.$#" count: 1 path: src/FormWidgets/StockEditor.php - - message: "#^Call to an undefined method Igniter\\\\Flame\\\\Database\\\\Model\\:\\:getStockableName\\(\\)\\.$#" + message: "#^Call to an undefined method Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:getStockableName\\(\\)\\.$#" count: 1 path: src/FormWidgets/StockEditor.php @@ -727,7 +727,7 @@ parameters: - message: "#^Access to an undefined property Igniter\\\\Cart\\\\Models\\\\MenuItemOptionValue\\:\\:\\$override_price\\.$#" - count: 2 + count: 1 path: src/Models/MenuItemOptionValue.php - diff --git a/pint.json b/pint.json index c4df8a3..a0c7788 100644 --- a/pint.json +++ b/pint.json @@ -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": { diff --git a/src/Actions/OrderAction.php b/src/Actions/OrderAction.php index 9edd68a..b33b136 100644 --- a/src/Actions/OrderAction.php +++ b/src/Actions/OrderAction.php @@ -2,11 +2,12 @@ namespace Igniter\Cart\Actions; +use Igniter\Flame\Database\Model; use Igniter\System\Actions\ModelAction; class OrderAction extends ModelAction { - protected $model; + protected Model $model; public function __construct($model) {