Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 1 addition & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: ["7.3", "7.4", "8.1", "8.2", "8.3"]
php: ["8.2", "8.3", "8.4", "8.5"]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # v2.32.0
Expand All @@ -37,15 +37,6 @@ jobs:
run: |
composer install --prefer-dist --no-progress --no-interaction

- name: Lint and formatting
if: >-
matrix.php == '7.4' ||
matrix.php == '8.1' ||
matrix.php == '8.2' ||
matrix.php == '8.3'
run: |
composer run-script format-check

- name: Test
run: |
composer run-script test
38 changes: 38 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Lint

on:
push:
branches:
- "main"
pull_request: {}

defaults:
run:
shell: bash

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # v2.32.0
with:
php-version: "8.2"
tools: "composer"

- name: Cache Composer packages
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
with:
path: vendor
key: ${{ runner.os }}-php-8.2-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-8.2-

- name: Install dependencies
run: |
composer install --prefer-dist --no-progress --no-interaction

- name: Lint and formatting
run: |
composer run-script format-check
23 changes: 23 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

declare(strict_types=1);

use PhpCsFixer\Config;
use PhpCsFixer\Finder;

return (new Config())
->setRules([
'@PSR12' => true,
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'no_unused_imports' => true,
'single_quote' => true,
'trailing_comma_in_multiline' => true,
'declare_strict_types' => true,
])
->setRiskyAllowed(true)
->setFinder(
(new Finder())
->in(__DIR__)
->exclude(['vendor'])
)
;
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"[github-actions-workflow]": {
"editor.defaultFormatter": "redhat.vscode-yaml"
},
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
}
}
22 changes: 13 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@
"authors": [
{
"name": "WorkOS",
"email": "eng@workos.com"
"email": "sdk@workos.com"
}
],
"require": {
"php": ">=7.3.0",
"ext-curl": "*",
"paragonie/halite": "^4.0"
"php": "^8.2",
"ext-curl": "^8.2",
"guzzlehttp/guzzle": "^7.0",
"paragonie/halite": "^5.1"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.15|^3.6",
"phpunit/phpunit": "^9"
"friendsofphp/php-cs-fixer": "^3.0",
"phpstan/phpstan": "^2.1",
"phpunit/phpunit": "^11.5"
},
"autoload": {
"psr-4": {
Expand All @@ -33,9 +35,11 @@
},
"scripts": {
"clean": "rm -rf composer.lock vendor/",
"format": "php vendor/bin/php-cs-fixer fix -v --using-cache=no .",
"format-check": "php vendor/bin/php-cs-fixer fix -v --dry-run --using-cache=no .",
"test": "php vendor/bin/phpunit tests"
"format": "php vendor/bin/php-cs-fixer fix -v --using-cache=no --config=.php-cs-fixer.dist.php",
"format-check": "php vendor/bin/php-cs-fixer fix -v --dry-run --using-cache=no --config=.php-cs-fixer.dist.php",
"test": "php vendor/bin/phpunit tests",
"typecheck": "php vendor/bin/phpstan analyse --no-progress",
"ci": "./script/ci"
},
"config": {
"allow-plugins": {
Expand Down
Loading
Loading