Skip to content

Commit 0d603d9

Browse files
authored
Use Pint instead of StyleCI (#76)
* use pint * PHP Linting (Pint) * update versions * exclude some things * fix composer * work around for supporting multiple versions of phpunit * remove phpunit 10 support * migrated config * coverage * exclude versions * exclude some more * do not prefer lowest * remove older laravel tests * coverage driver --------- Co-authored-by: swilla <swilla@users.noreply.github.com>
1 parent b484fb1 commit 0d603d9

File tree

11 files changed

+112
-141
lines changed

11 files changed

+112
-141
lines changed

.github/run-tests-L7.yml

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

.github/workflows/pint.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: PHP Linting (Pint)
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches-ignore:
6+
- "dependabot/npm_and_yarn/*"
7+
jobs:
8+
phplint:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
with:
13+
fetch-depth: 2
14+
- name: "laravel-pint"
15+
uses: aglipanci/laravel-pint-action@0.1.0
16+
with:
17+
preset: laravel
18+
19+
- name: Commit changes
20+
uses: stefanzweifel/git-auto-commit-action@v4
21+
with:
22+
commit_message: PHP Linting (Pint)
23+
skip_fetch: true

.github/workflows/run-tests-l8.yml

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

.github/workflows/run-tests.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: "Run Tests - Current"
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
php: [8.3, 8.2, 8.1, 8.0, 7.4]
12+
laravel: [9.*, 8.*, 10.*]
13+
dependency-version: [prefer-lowest, prefer-stable]
14+
exclude:
15+
- laravel: 10.*
16+
php: 8.0
17+
- laravel: 10.*
18+
php: 7.4
19+
- laravel: 9.*
20+
php: 7.4
21+
- laravel: 8.*
22+
php: 8.1
23+
- laravel: 8.*
24+
php: 8.2
25+
- laravel: 8.*
26+
php: 8.3
27+
include:
28+
- laravel: 10.*
29+
testbench: 8.*
30+
- laravel: 9.*
31+
testbench: 7.*
32+
- laravel: 8.*
33+
testbench: 6.*
34+
35+
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}
36+
37+
steps:
38+
- name: Checkout code
39+
uses: actions/checkout@v4
40+
41+
- name: Cache dependencies
42+
uses: actions/cache@v3
43+
with:
44+
path: ~/.composer/cache/files
45+
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
46+
47+
- name: Setup PHP
48+
uses: shivammathur/setup-php@v2
49+
with:
50+
php-version: ${{ matrix.php }}
51+
extensions: curl, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, iconv
52+
coverage: pcov
53+
54+
- name: Install dependencies
55+
run: |
56+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "symfony/console:>=4.3.4" "mockery/mockery:^1.3.2" --no-interaction --no-update
57+
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
58+
cp .env.example .env
59+
- name: Execute tests
60+
run: vendor/bin/phpunit

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ coverage
88
.phpunit.result.cache
99
.DS_Store
1010
.idea
11+
.phpunit.cache

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^7.3 || ^8.0",
19+
"php": "^7.4 || ^8.0 || ^8.1 || ^8.2 || ^8.3",
2020
"guzzlehttp/guzzle": "~6.0 || ~7.0",
2121
"illuminate/support": "5.7.* || 5.8.* ||^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0",
2222
"symfony/dotenv": "^4.2 || ^5.1"
@@ -27,7 +27,7 @@
2727
"phpstan/extension-installer": "^1.1",
2828
"phpstan/phpstan-deprecation-rules": "^1.0",
2929
"phpstan/phpstan-phpunit": "^1.0",
30-
"phpunit/phpunit": "^8.4 || ^9.3.3"
30+
"phpunit/phpunit": "^8.4 || ^9.3.3 || ^10.0"
3131
},
3232
"autoload": {
3333
"psr-4": {
@@ -43,12 +43,12 @@
4343
"analyse": "vendor/bin/phpstan analyse",
4444
"test": "vendor/bin/phpunit",
4545
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"
46-
4746
},
4847
"config": {
4948
"sort-packages": true,
5049
"allow-plugins": {
51-
"phpstan/extension-installer": true
50+
"phpstan/extension-installer": true,
51+
"pestphp/pest-plugin": false
5252
}
5353
},
5454
"extra": {

phpunit.xml.dist

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
bootstrap="tests/autoload.php"
5-
backupGlobals="false"
6-
backupStaticAttributes="false"
7-
colors="true"
8-
verbose="true"
9-
convertErrorsToExceptions="true"
10-
convertNoticesToExceptions="true"
11-
convertWarningsToExceptions="true"
12-
processIsolation="false"
13-
stopOnFailure="false"
14-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="tests/autoload.php" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
153
<coverage>
16-
<include>
17-
<directory suffix=".php">src/</directory>
18-
</include>
194
<report>
205
<clover outputFile="build/logs/clover.xml"/>
216
<html outputDirectory="build/coverage"/>
@@ -30,4 +15,9 @@
3015
<directory suffix="Test.php">./tests/Feature</directory>
3116
</testsuite>
3217
</testsuites>
18+
<source>
19+
<include>
20+
<directory suffix=".php">src/</directory>
21+
</include>
22+
</source>
3323
</phpunit>

src/AirtableManager.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ public function __construct($app)
3535

3636
/**
3737
* Get a airtable table instance.
38-
*
39-
* @param string $table
4038
*/
4139
public function table(string $table)
4240
{

src/Api/AirtableApiClient.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,22 @@ class AirtableApiClient implements ApiClient
1111
private $client;
1212

1313
private $typecast;
14+
1415
private $base;
16+
1517
private $table;
18+
1619
private $delay;
1720

1821
private $filters = [];
22+
1923
private $fields = [];
24+
2025
private $sorts = [];
26+
2127
private $offset = false;
2228

23-
public function __construct($base, $table, $access_token, Http $client = null, $typecast = false, $delayBetweenRequests = 200000)
29+
public function __construct($base, $table, $access_token, ?Http $client = null, $typecast = false, $delayBetweenRequests = 200000)
2430
{
2531
$this->base = $base;
2632
$this->table = $table;

src/Api/ApiClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
interface ApiClient
66
{
7-
public function get(string $id = null);
7+
public function get(?string $id = null);
88

99
public function post($contents = null);
1010

0 commit comments

Comments
 (0)