Skip to content

Commit

Permalink
Laravel 11 (#24)
Browse files Browse the repository at this point in the history
* Bump dependencies for Laravel 11

* Update GitHub Actions for Laravel 11

* Apply fixes from StyleCI (#23)

* Fix version constraints

* Drop support for Laravel 9

---------

Co-authored-by: Shift <shift@laravelshift.com>
  • Loading branch information
rasmuscnielsen and laravel-shift authored Apr 8, 2024
1 parent 9ce8d69 commit f440890
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 52 deletions.
71 changes: 37 additions & 34 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,42 @@
name: Run tests

on:
push:
pull_request:
schedule:
- cron: '0 0 * * *'
push:
pull_request:
schedule:
- cron: '0 0 * * *'

jobs:
test:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php: [8.1, 8.2]
laravel: [9.*, 10.*]
dependency-version: [prefer-lowest, prefer-stable]

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
- name: Execute tests
run: vendor/bin/phpunit
test:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php: [8.1, 8.2, 8.3]
laravel: ['10.*', '11.*']
dependency-version: [prefer-lowest, prefer-stable]
exclude:
- laravel: 11.*
php: 8.1

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
- name: Execute tests
run: vendor/bin/phpunit
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ composer.lock
vendor
.php_cs.cache
.phpunit.result.cache
.phpunit.cache
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
},
"require": {
"php": "^8.1",
"illuminate/support": "^9.0|^10.0",
"illuminate/support": "^10.0|^11.0",
"makeabledk/laravel-querykit": "^3.0|^4.0"
},
"require-dev": {
"laravel/laravel": "^9.0|^10.0",
"phpunit/phpunit": "^9.0"
"laravel/laravel": "^10.3.3|^11.0.5",
"phpunit/phpunit": "^10.5.17"
},
"autoload-dev": {
"psr-4": {
Expand Down
7 changes: 1 addition & 6 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" backupStaticAttributes="false" bootstrap="vendor/autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory suffix=".php">src/</directory>
</include>
</coverage>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<testsuites>
<testsuite name="Package Test Suite">
<directory>./tests/</directory>
Expand Down
10 changes: 5 additions & 5 deletions src/Status.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ abstract class Status implements Arrayable, JsonSerializable
protected $value;

/**
* @param $value
* @param $value
* @param bool $validate
*
* @throws InvalidStatusException
Expand All @@ -45,7 +45,7 @@ public function __toString()
}

/**
* @param $value
* @param $value
* @return Status|null
*/
public static function find($value)
Expand Down Expand Up @@ -95,7 +95,7 @@ public static function all()
}

/**
* @param $model
* @param $model
* @return Status
*
* @throws Exception
Expand All @@ -112,7 +112,7 @@ public static function guess($model)
}

/**
* @param $value
* @param $value
* @return bool
*/
public static function validate($value)
Expand All @@ -137,7 +137,7 @@ public function getTitle()
}

/**
* @param $query
* @param $query
* @return Builder
*/
public function scope($query)
Expand Down
6 changes: 3 additions & 3 deletions src/StatusManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ class StatusManager
protected static $map = [];

/**
* @param $model
* @param $status
* @param $model
* @param $status
*/
public static function bind($model, $status)
{
Expand All @@ -40,7 +40,7 @@ public static function map($modelStatusMap, $merge = true)
}

/**
* @param $model
* @param $model
* @return Status
*
* @throws InvalidStatusException
Expand Down
2 changes: 1 addition & 1 deletion tests/Stubs/OrderStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class OrderStatus extends Status
{
/**
* @param $query
* @param $query
* @return mixed
*/
public function pendingAccept($query)
Expand Down

0 comments on commit f440890

Please sign in to comment.