Skip to content

Commit 35e377d

Browse files
Merge pull request #23 from makeabledk/feat/php8
Add GH Action + bump dependencies
2 parents 200647d + 593b714 commit 35e377d

20 files changed

+86
-125
lines changed

.github/workflows/test.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Run tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: '0 0 * * *'
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
php: [8.0, 8.1]
17+
laravel: [8.*, 9.*]
18+
dependency-version: [prefer-lowest, prefer-stable]
19+
20+
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}
21+
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v1
25+
26+
- name: Setup PHP
27+
uses: shivammathur/setup-php@v2
28+
with:
29+
php-version: ${{ matrix.php }}
30+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
31+
coverage: none
32+
33+
- name: Install dependencies
34+
run: |
35+
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
36+
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
37+
38+
- name: Execute tests
39+
run: vendor/bin/phpunit

.travis.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@
77
}
88
},
99
"require": {
10-
"php": ">=7.3.0|8.*",
11-
"illuminate/support": "^6.0|^7.0|^8.0"
10+
"php": "^8.0",
11+
"illuminate/support": "^8.80|^9.0"
1212
},
1313
"require-dev": {
14-
"orchestra/testbench": "^3.8|^4.0|^6.0"
14+
"orchestra/testbench": "^6.0",
15+
"phpunit/phpunit": "^9.0"
1516
},
1617
"autoload-dev": {
1718
"psr-4": {

phpunit.xml

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,13 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit backupGlobals="false"
3-
backupStaticAttributes="false"
4-
bootstrap="vendor/autoload.php"
5-
colors="true"
6-
convertErrorsToExceptions="true"
7-
convertNoticesToExceptions="true"
8-
convertWarningsToExceptions="true"
9-
processIsolation="false"
10-
stopOnFailure="false"
11-
verbose="true"
12-
>
13-
<testsuites>
14-
<testsuite name="Package Test Suite">
15-
<directory suffix="Test.php">./tests/</directory>
16-
</testsuite>
17-
</testsuites>
18-
<filter>
19-
<whitelist>
20-
<directory suffix=".php">src/</directory>
21-
</whitelist>
22-
</filter>
23-
<logging>
24-
<log type="tap" target="build/report.tap"/>
25-
<log type="junit" target="build/report.junit.xml"/>
26-
<log type="coverage-html" target="build/coverage" />
27-
<log type="coverage-text" target="build/coverage.txt"/>
28-
<log type="coverage-clover" target="build/logs/clover.xml"/>
29-
</logging>
2+
<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" verbose="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
3+
<coverage>
4+
<include>
5+
<directory suffix=".php">src/</directory>
6+
</include>
7+
</coverage>
8+
<testsuites>
9+
<testsuite name="Package Test Suite">
10+
<directory suffix="Test.php">./tests/</directory>
11+
</testsuite>
12+
</testsuites>
3013
</phpunit>

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Laravel Query Kit
44

55
[![Latest Version on Packagist](https://img.shields.io/packagist/v/makeabledk/laravel-querykit.svg?style=flat-square)](https://packagist.org/packages/makeabledk/laravel-querykit)
6-
[![Build Status](https://img.shields.io/travis/makeabledk/laravel-query-kit/master.svg?style=flat-square)](https://travis-ci.org/makeabledk/laravel-query-kit)
6+
[![Build Status](https://img.shields.io/github/workflow/status/makeabledk/laravel-query-kit/Run%20tests?label=Tests)](https://github.com/makeabledk/laravel-query-kit/actions)
77
[![StyleCI](https://styleci.io/repos/95551114/shield?branch=master)](https://styleci.io/repos/95551114)
88

99
This package provides a handy way to query eloquent-scopes on model instances in Laravel.

src/Builder/Builder.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Builder
3232
/**
3333
* Builder constructor.
3434
*
35-
* @param Model $model
35+
* @param Model $model
3636
*/
3737
public function __construct(Model $model)
3838
{
@@ -47,7 +47,6 @@ public function __construct(Model $model)
4747
*
4848
* @param $method
4949
* @param $parameters
50-
*
5150
* @return Builder
5251
*/
5352
public function __call($method, $parameters)
@@ -77,8 +76,7 @@ public function __call($method, $parameters)
7776
/**
7877
* @param $model
7978
* @param $name
80-
* @param array ...$args
81-
*
79+
* @param array ...$args
8280
* @return Builder
8381
*/
8482
public static function make($model, $name, ...$args)
@@ -100,8 +98,7 @@ public static function registerConstraint($class)
10098

10199
/**
102100
* @param $name
103-
* @param array ...$args
104-
*
101+
* @param array ...$args
105102
* @return mixed
106103
*/
107104
public function callScopeFunction($name, ...$args)

src/Builder/Stack.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ public function __construct()
2121
}
2222

2323
/**
24-
* @param QueryConstraint $constraint
25-
* @param bool $or
24+
* @param QueryConstraint $constraint
25+
* @param bool $or
2626
* @return Stack
2727
*/
2828
public function apply(QueryConstraint $constraint, $or = false)
@@ -61,7 +61,7 @@ protected function push($constraint)
6161
}
6262

6363
/**
64-
* @param Stack $stack
64+
* @param Stack $stack
6565
* @param $model
6666
* @return bool
6767
*/
@@ -73,7 +73,7 @@ public function check($model)
7373
}
7474

7575
/**
76-
* @param Collection $track
76+
* @param Collection $track
7777
* @param $model
7878
* @return bool
7979
*/

src/Builder/Where.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Where implements QueryConstraint
2525
/**
2626
* Where constructor.
2727
*
28-
* @param array ...$args
28+
* @param array ...$args
2929
*/
3030
public function __construct(...$args)
3131
{
@@ -34,7 +34,6 @@ public function __construct(...$args)
3434

3535
/**
3636
* @param $model
37-
*
3837
* @return bool
3938
*/
4039
public function check($model)
@@ -85,8 +84,7 @@ protected function isSubQuery()
8584
/**
8685
* @param $property
8786
* @param $operator
88-
* @param null $value
89-
*
87+
* @param null $value
9088
* @return array
9189
*/
9290
protected function normalize($property, $operator = null, $value = null)

src/Builder/WhereBetween.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ public function __construct($property, $range)
3333

3434
/**
3535
* @param $model
36-
*
3736
* @return bool
3837
*/
3938
public function check($model)

src/Builder/WhereColumn.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ class WhereColumn implements QueryConstraint
2525
/**
2626
* WhereColumn constructor.
2727
*
28-
* @param mixed $property
29-
* @param mixed $operator
30-
* @param mixed $propertyToCompare
28+
* @param mixed $property
29+
* @param mixed $operator
30+
* @param mixed $propertyToCompare
3131
*/
3232
public function __construct($property, $operator, $propertyToCompare)
3333
{
@@ -38,7 +38,6 @@ public function __construct($property, $operator, $propertyToCompare)
3838

3939
/**
4040
* @param $model
41-
*
4241
* @return bool
4342
*/
4443
public function check($model)

0 commit comments

Comments
 (0)