Skip to content

Instantly share code, notes, and snippets.

View JustSteveKing's full-sized avatar
🐘
Building API tools and educational content

Steve McDougall JustSteveKing

🐘
Building API tools and educational content
View GitHub Profile
@JustSteveKing
JustSteveKing / phpstan.neon
Last active May 12, 2024 08:12
Default Laravel PHPStan Config
parameters:
paths:
- app/
level: 9
ignoreErrors:
excludePaths:
@JustSteveKing
JustSteveKing / State.php
Created August 11, 2023 18:31
US States as a PHP Enum
<?php
declare(strict_types=1);
namespace App\Enums;
enum State: string
{
case ALABAMA = 'AL';
case ALASKA = 'AK';
@JustSteveKing
JustSteveKing / ApiRenderer.php
Last active September 8, 2023 15:03
Handling Errors in Laravel
<?php
declare(strict_types=1);
namespace App\Exceptions\Rendering;
use Illuminate\Contracts\Support\Responsable;
use Illuminate\Http\Request;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Throwable;
@JustSteveKing
JustSteveKing / rector.php
Created January 13, 2024 22:44
Laravel Rector Config
<?php
declare(strict_types=1);
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
return static function (RectorConfig $rectorConfig): void {