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
17 changes: 17 additions & 0 deletions .github/workflows/qol.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
jobs:
phpcs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
- uses: actions/checkout@v5

- name: Set up PHP
- uses: shivammathur/setup-php@v2
with:
php-version: '8.3'

- name: Install dependencies
- run: composer install

- name: Run PHP CodeSniffer
- run: composer cs
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ composer.lock
.env
/phpunit.xml
/.env
.php-cs-fixer.php
.php-cs-fixer.cache
20 changes: 20 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php declare(strict_types=1);

use PhpCsFixer\Config;
use PhpCsFixer\Finder;
use PhpCsFixer\Runner\Parallel\ParallelConfigFactory;

return (new Config())
->setRiskyAllowed(false)
->setParallelConfig(
ParallelConfigFactory::detect()
)
->setRules([
'@PSR12' => true,
])
->setFinder(
(new Finder())
->in(__DIR__)
->exclude('vendor')
->name('*.php')
);
8 changes: 7 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,17 @@
"phpstan/phpstan": "^2.1",
"pestphp/pest": "^3.8",
"orchestra/testbench": "^10.4",
"pestphp/pest-plugin-laravel": "^3.2"
"pestphp/pest-plugin-laravel": "^3.2",
"friendsofphp/php-cs-fixer": "^3.86"
},
"config": {
"allow-plugins": {
"pestphp/pest-plugin": true
}
},
"scripts": {
"test": "vendor/bin/pest",
"cs": "vendor/bin/php-cs-fixer check",
"cs:fix": "vendor/bin/php-cs-fixer fix"
}
}
4 changes: 3 additions & 1 deletion src/GithubClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ class GithubClient implements GithubClientInterface
{
use ApiActionTrait;

public function __construct(protected string $token) {}
public function __construct(protected string $token)
{
}

/**
* Get a user's profile by username.
Expand Down
2 changes: 1 addition & 1 deletion src/GithubForgeServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function register(): void

$this->app->singleton(
'github-forge',
fn($app) => new GithubClient(
fn ($app) => new GithubClient(
$app['config']->get('github-forge.token')
)
);
Expand Down
4 changes: 2 additions & 2 deletions src/Traits/ApiActionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ public function getResponse(string $route = '', array $queryParams = [], array $
* @return Collection
* @throws ConnectionException
*/
public function getPaginatedResponse(string $route = '', array $queryParams = [], array $headers = []): Collection
public function getPaginatedResponse(string $route = '', array $queryParams = [], array $headers = []): Collection
{
$results = new Collection;
$results = new Collection();
$page = 1;

do {
Expand Down