Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 37 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,49 @@
name: CI

on: ['push', 'pull_request']
on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
pest:
runs-on: ubuntu-latest
container:
image: kirschbaumdevelopment/laravel-test-runner:8.3

strategy:
fail-fast: false
matrix:
php: ['8.3', '8.4', '8.5']
name: Pest (PHP ${{ matrix.php }})
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4

- uses: shivammathur/setup-php@v2
with:
fetch-depth: 1
php-version: ${{ matrix.php }}
coverage: none

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

- name: Run Testsuite
run: vendor/bin/pest
run: vendor/bin/pest

quality:
runs-on: ubuntu-latest
name: Quality (PHPStan + Pint)
steps:
- uses: actions/checkout@v4

- uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
coverage: none

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

- name: Run PHPStan
run: vendor/bin/phpstan analyse

- name: Run Pint
run: vendor/bin/pint --test
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
## 馃憢 Introduction
This package allows FakerPHP to generate fake IDs which have the same structure you can expect to be returned from
Stripe. The wonderful [Pest](https://pestphp.com/) is used to run tests contained within this package, which requires
a minimum PHP Version of 8.2.
a minimum PHP Version of 8.3.

This package is listed on the [official FakerPHP website](https://fakerphp.org/third-party/) as a third party library.

Expand Down
10 changes: 9 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
},
"require-dev": {
"pestphp/pest": "^v4.0",
"pestphp/pest-plugin-faker": "^v4.0"
"pestphp/pest-plugin-faker": "^v4.0",
"phpstan/phpstan": "^2.2",
"laravel/pint": "^1.30"
},
"autoload": {
"psr-4": {
Expand All @@ -33,5 +35,11 @@
"allow-plugins": {
"pestphp/pest-plugin": true
}
},
"scripts": {
"test": "pest",
"phpstan": "phpstan analyse",
"pint": "pint",
"pint:test": "pint --test"
}
}
4 changes: 4 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
parameters:
level: max
paths:
- src
3 changes: 3 additions & 0 deletions pint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"preset": "psr12"
}
2 changes: 1 addition & 1 deletion src/Stripe.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class Stripe extends Base
{
private function generateRandomString($length = 24, $numericOnly = false): string
private function generateRandomString(int $length = 24, bool $numericOnly = false): string
{
if ($numericOnly) {
$characters = '0123456789';
Expand Down
2 changes: 1 addition & 1 deletion tests/ArchitectureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
test('provider')
->expect(Stripe::class)
->toExtend(Base::class)
->toOnlyUse(Base::class);
->toOnlyUse(Base::class);
1 change: 1 addition & 0 deletions tests/StripeTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

use Faker\Provider\Stripe;

use function Pest\Faker\fake;

beforeEach(function () {
Expand Down
Loading