align dev tooling with youngstartup conventions
require-dev: phpstan ^2.1 + strict rules, larastan ^3, php-cs-fixer ^3.91 + jubeki/laravel-code-style ^2.18, ide-helper ^3.7. add phpstan.neon (level max, app/ scope) and .php-cs-fixer.dist.php (jubeki preset, modifier_keywords rule). phpunit.xml mirrors youngstartup (sqlite :memory:, bcrypt rounds 4, enforceTimeLimit). gitignore picks up _ide_helper.php, *~, .php-cs-fixer.cache. drop sail's phpactor.json line. composer scripts: drop npm bits from setup/dev (frontend lives separately). composer test + stan + cs:check all green on default scaffold.
This commit is contained in:
parent
ffd102a1cc
commit
d58bc9036d
6 changed files with 1968 additions and 16 deletions
4
backend/.gitignore
vendored
4
backend/.gitignore
vendored
|
|
@ -3,7 +3,6 @@
|
|||
.env
|
||||
.env.backup
|
||||
.env.production
|
||||
.phpactor.json
|
||||
.phpunit.result.cache
|
||||
/.fleet
|
||||
/.idea
|
||||
|
|
@ -19,6 +18,9 @@
|
|||
/storage/*.key
|
||||
/storage/pail
|
||||
/vendor
|
||||
_ide_helper.php
|
||||
Homestead.json
|
||||
Homestead.yaml
|
||||
Thumbs.db
|
||||
*~
|
||||
.php-cs-fixer.cache
|
||||
|
|
|
|||
23
backend/.php-cs-fixer.dist.php
Normal file
23
backend/.php-cs-fixer.dist.php
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
require __DIR__.'/vendor/autoload.php';
|
||||
require __DIR__.'/bootstrap/app.php';
|
||||
|
||||
return (new Jubeki\LaravelCodeStyle\Config())
|
||||
->setFinder(
|
||||
PhpCsFixer\Finder::create()
|
||||
->notName('*.blade.php')
|
||||
->in(app_path())
|
||||
->in(config_path())
|
||||
->in(database_path('factories'))
|
||||
->in(database_path('migrations'))
|
||||
->in(database_path('seeders'))
|
||||
->notPath(base_path('vendor'))
|
||||
->in(base_path('routes'))
|
||||
->in(base_path('tests'))
|
||||
)
|
||||
->setRules([
|
||||
'modifier_keywords' => [
|
||||
'elements' => ['method', 'property'],
|
||||
],
|
||||
]);
|
||||
|
|
@ -1,23 +1,29 @@
|
|||
{
|
||||
"$schema": "https://getcomposer.org/schema.json",
|
||||
"name": "laravel/laravel",
|
||||
"name": "tide/backend",
|
||||
"type": "project",
|
||||
"description": "The skeleton application for the Laravel framework.",
|
||||
"keywords": ["laravel", "framework"],
|
||||
"description": "TIDE blogging app backend.",
|
||||
"keywords": ["laravel", "framework", "tide", "blog"],
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": "^8.2",
|
||||
"php": "^8.4",
|
||||
"laravel/framework": "^12.0",
|
||||
"laravel/tinker": "^2.10.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"barryvdh/laravel-ide-helper": "^3.7",
|
||||
"fakerphp/faker": "^1.23",
|
||||
"friendsofphp/php-cs-fixer": "^3.91",
|
||||
"jubeki/laravel-code-style": "^2.18",
|
||||
"larastan/larastan": "^3.0",
|
||||
"laravel/pail": "^1.2.2",
|
||||
"laravel/pint": "^1.24",
|
||||
"laravel/sail": "^1.41",
|
||||
"mockery/mockery": "^1.6",
|
||||
"nunomaduro/collision": "^8.6",
|
||||
"phpunit/phpunit": "^11.5.50"
|
||||
"nunomaduro/collision": "^8.8",
|
||||
"phpstan/phpstan": "^2.1",
|
||||
"phpstan/phpstan-strict-rules": "^2.0",
|
||||
"phpunit/phpunit": "^11.5.3"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
|
@ -36,14 +42,17 @@
|
|||
"composer install",
|
||||
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\"",
|
||||
"@php artisan key:generate",
|
||||
"@php artisan migrate --force",
|
||||
"npm install",
|
||||
"npm run build"
|
||||
"@php artisan migrate --force"
|
||||
],
|
||||
"dev": [
|
||||
"Composer\\Config::disableProcessTimeout",
|
||||
"npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1 --timeout=0\" \"php artisan pail --timeout=0\" \"npm run dev\" --names=server,queue,logs,vite --kill-others"
|
||||
"npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185\" \"php artisan serve\" \"php artisan queue:listen --tries=1\" \"php artisan pail --timeout=0\" --names=server,queue,logs --kill-others"
|
||||
],
|
||||
|
||||
"stan": "phpstan analyse",
|
||||
"cs:fix": "php-cs-fixer fix",
|
||||
"cs:check": "php-cs-fixer check --diff -vvv",
|
||||
|
||||
"test": [
|
||||
"@php artisan config:clear --ansi",
|
||||
"@php artisan test"
|
||||
|
|
@ -78,7 +87,8 @@
|
|||
"sort-packages": true,
|
||||
"allow-plugins": {
|
||||
"pestphp/pest-plugin": true,
|
||||
"php-http/discovery": true
|
||||
"php-http/discovery": true,
|
||||
"phpstan/extension-installer": true
|
||||
}
|
||||
},
|
||||
"minimum-stability": "stable",
|
||||
|
|
|
|||
1901
backend/composer.lock
generated
1901
backend/composer.lock
generated
File diff suppressed because it is too large
Load diff
20
backend/phpstan.neon
Normal file
20
backend/phpstan.neon
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
includes:
|
||||
- vendor/larastan/larastan/extension.neon
|
||||
- vendor/phpstan/phpstan-strict-rules/rules.neon
|
||||
|
||||
parameters:
|
||||
level: max
|
||||
treatPhpDocTypesAsCertain: false
|
||||
reportUnmatchedIgnoredErrors: false
|
||||
|
||||
paths:
|
||||
- app
|
||||
|
||||
excludePaths:
|
||||
analyse: [
|
||||
vendor,
|
||||
tests
|
||||
]
|
||||
|
||||
universalObjectCratesClasses:
|
||||
- stdClass
|
||||
|
|
@ -1,8 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
|
||||
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
|
||||
bootstrap="vendor/autoload.php"
|
||||
colors="true"
|
||||
enforceTimeLimit="true"
|
||||
>
|
||||
<testsuites>
|
||||
<testsuite name="Unit">
|
||||
|
|
@ -25,7 +26,6 @@
|
|||
<env name="CACHE_STORE" value="array"/>
|
||||
<env name="DB_CONNECTION" value="sqlite"/>
|
||||
<env name="DB_DATABASE" value=":memory:"/>
|
||||
<env name="DB_URL" value=""/>
|
||||
<env name="MAIL_MAILER" value="array"/>
|
||||
<env name="QUEUE_CONNECTION" value="sync"/>
|
||||
<env name="SESSION_DRIVER" value="array"/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue