Skip to content

Commit

Permalink
feat: add larastan
Browse files Browse the repository at this point in the history
  • Loading branch information
Justintime50 committed Aug 28, 2024
1 parent 7e937f3 commit b5473d6
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## Next Release

- Adds `larastan`

## v0.9.0 (2024-06-10)

- Updates items to follow patterns for Laravel 11
Expand Down
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ In the `composer.json` file, add the following:

1. `"bin-dir": "bin"` to the `config` section
2. Install PHP CodeSniffer: `composer require --dev squizlabs/php_codesniffer`
3. Install Justintime50 PHP styles via `npm install --save-dev justintime50-styles`
4. Correct prod and dev dependencies as production builds won't contain dev deps
5. Add the folllowing to the `scripts` section of the `composer.json` file:
3. Install larastan: `composer require --dev larastan/larastan`
4. Install Justintime50 PHP styles via `npm install --save-dev justintime50-styles`
5. Correct prod and dev dependencies as production builds won't contain dev deps
6. Add the folllowing to the `scripts` section of the `composer.json` file:

```json
"clean": "rm -rf bin clover.html node_modules vendor *.cache .*.cache bootstrap/cache/*.php",
Expand All @@ -59,6 +60,7 @@ In the `composer.json` file, add the following:
"migrate-fresh": "docker exec -t laravel-template-laravel-template-1 php artisan migrate:fresh --no-interaction --force",
"migrate-seed": "docker exec -t laravel-template-laravel-template-1 php artisan migrate:fresh --seed --no-interaction --force",
"migrate": "docker exec -t laravel-template-laravel-template-1 php artisan migrate --no-interaction --force",
"phpstan": "./bin/phpstan analyse --memory-limit=2G",
"rollback": "docker exec -t laravel-template-laravel-template-1 php artisan migrate:rollback --no-interaction --force",
"seed": "docker exec -t laravel-template-laravel-template-1 php artisan db:seed --no-interaction --force",
"test": "./bin/phpunit"
Expand All @@ -71,6 +73,19 @@ In the `composer.json` file, add the following:
"fix": "npx stylelint resources/sass/*.scss --config node_modules/justintime50-styles/src/css/.stylelintrc.json --custom-syntax postcss-scss --fix"
```

7. Create a `phpstan.neon` file with the following content:

```neon
includes:
- vendor/larastan/larastan/extension.neon
parameters:
paths:
- app/
- tests/
level: 5
```

## Install

```bash
Expand Down
6 changes: 5 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ install:
npm install

# Lint entire project
lint: lint-php lint-css
lint: lint-php lint-css phpstan

# Lint the PHP files
lint-php:
Expand Down Expand Up @@ -53,6 +53,10 @@ migrate-fresh:
migrate-seed:
composer migrate-seed

# Run static analysis on the project
phpstan:
composer phpstan

# Deploy the project for production
prod:
docker compose -f ../docker-compose.yml -f ../docker-compose-prod.yml up -d --build
Expand Down

0 comments on commit b5473d6

Please sign in to comment.