Skip to content

Commit

Permalink
v4 (#3)
Browse files Browse the repository at this point in the history
* chore: remove php-cs-fixer

* chore: add pint custom config file

* chore: update .gitignore

* chore: update rector config file

* chore: add ide-helper custom config file

* chore: update artisan PublishCommand

* chore: update test files

* fix: typo in issue template for github

* chore: update composer.json

* chore: update README.md

* ci: add phpmd workflow

* chore: update CHANGELOG.md
  • Loading branch information
leMaur authored Nov 21, 2022
1 parent 6e79815 commit 0a42b1c
Show file tree
Hide file tree
Showing 18 changed files with 585 additions and 355 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ contact_links:
about: Share ideas for new features
- name: Report a bug
url: https://github.com/leMaur/toolbox/issues/new
about: Report a reproducable bug
about: Report a reproducible bug
23 changes: 0 additions & 23 deletions .github/workflows/php-cs-fixer.yml

This file was deleted.

37 changes: 37 additions & 0 deletions .github/workflows/phpmd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: PHPMD

on:
push:
branches: [ "master" ]

permissions:
contents: read

jobs:
phpmd:
name: Run PHPMD scanning
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
actions: read

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
coverage: none
tools: phpmd

- name: Run PHPMD
run: phpmd . sarif codesize --reportfile phpmd-results.sarif
continue-on-error: true

- name: Upload analysis results to GitHub
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: phpmd-results.sarif
wait-for-processing: true
46 changes: 0 additions & 46 deletions .php-cs-fixer.dist.php

This file was deleted.

35 changes: 30 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,50 @@

All notable changes to `toolbox` will be documented in this file.

## 4.0.0 - 2022-11-21

### Added
- add ide-helper custom configuration file
- add Laravel Pint custom configuration

### Changed
- change required minimum PHP version to ^8.1
- update .gitignore stub
- update rector configuration file
- update php-stan configuration file
- update test helpers
- update Pest configuration

### Removed
- remove friendsofphp/php-cs-fixer
- remove nunomaduro/laravel-mojito
- remove phpstan/extension-installer


## 3.2.1 - 2022-04-12

- remove double helper function `actingAs()`


## 3.2.0 - 2022-04-11

- use infection/infection -> dev-master branch
- add support and suggest sections to composer.json
- improve Pest configuration
- update Pest configuration


## 3.1.0 - 2022-03-04

- updated .php-cs-fixer.php stub file. Now it uses rulesets @PSR12 and @PHP81Migration
- update .php-cs-fixer.php stub file. Now it uses rulesets @PSR12 and @PHP81Migration

## 3.0.0 - 2022-02-03

- added laravel 9 support
- added new packages:
- add laravel 9 support
- add new packages:
- barryvdh/laravel-ide-helper
- infection/infection
- roave/security-advisories
- removed packages:
- remove packages:
- fakerphp/faker
- jasonmccreary/laravel-test-assertions
- mheap/phpunit-github-actions-printer
Expand Down
47 changes: 26 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
# Tools for Artisan!

Toolbox full of useful packages to keep your Laravel project compliant with your coding standards.
Toolbox full of useful packages to keep your **Laravel** project compliant with your coding standards.
It provides a minimum configuration to help you start with `static analysis`, `code styling` and `testing`.

[![Latest Version on Packagist](https://img.shields.io/packagist/v/lemaur/toolbox.svg?style=flat-square)](https://packagist.org/packages/lemaur/toolbox)
[![Total Downloads](https://img.shields.io/packagist/dt/lemaur/toolbox.svg?style=flat-square)](https://packagist.org/packages/lemaur/toolbox)
[![License](https://img.shields.io/packagist/l/lemaur/toolbox.svg?style=flat-square&color=yellow)](https://github.com/leMaur/toolbox/blob/master/LICENSE.md)
[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/lemaur/toolbox/Check%20&%20fix%20styling?label=code%20style&style=flat-square)](https://github.com/lemaur/toolbox/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amaster)
[![GitHub Sponsors](https://img.shields.io/github/sponsors/lemaur?style=flat-square&color=ea4aaa)](https://github.com/sponsors/leMaur)
[![Trees](https://img.shields.io/badge/dynamic/json?color=yellowgreen&style=flat-square&label=Trees&query=%24.total&url=https%3A%2F%2Fpublic.offset.earth%2Fusers%2Flemaur%2Ftrees)](https://ecologi.com/lemaur?r=6012e849de97da001ddfd6c9)

## What's Included
- [Laravel Debugbar](https://github.com/barryvdh/laravel-debugbar)
- [Laravel Ide Helper](https://github.com/barryvdh/laravel-ide-helper)
- [Php Cs Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer)
- [Analyzer](https://github.com/GrahamCampbell/Analyzer)
- [Infection](https://github.com/infection/infection)
- [Phpunit SpeedTrap](https://github.com/johnkary/phpunit-speedtrap)
- [Laravel Dusk](https://github.com/laravel/dusk)
- [Mockery](https://github.com/mockery/mockery)
- [Collision](https://github.com/nunomaduro/collision)
- [Laravel Sail](https://github.com/laravel/sail)
- [Larastan](https://github.com/nunomaduro/larastan)
- [Laravel Mojito](https://github.com/nunomaduro/laravel-mojito)
- [Pest](https://pestphp.com)
- [Phpunit](https://github.com/sebastianbergmann/phpunit)
- [Rector](https://github.com/rectorphp/rector)
Expand All @@ -45,8 +41,13 @@ You can even choose 😃:
## Installation

Install the package via composer:
```bash
composer require lemaur/toolbox --dev
```
composer require --dev lemaur/toolbox

if you still using php8.0 you should use:
```bash
composer require "lemaur/toolbox:^3.2" --dev
```

Launch the installation:
Expand All @@ -59,19 +60,19 @@ If you install this package in a fresh Laravel installation, you can simply run:
php artisan toolbox:install
```

⬇️ configure only Pest and Dusk test suites. [Those files will be overwritten](/src/Commands/PublishCommand.php#L22).
⬇️ configure only Pest and Dusk test suites. [Those files will be overwritten](/src/Commands/PublishCommand.php#L42).
```bash
php artisan toolbox:install --test-suites
```

Otherwise, you can install only the group of files you need without test suites:

⬇️ will overwrite [phpstan.neon](/src/Commands/PublishCommand.php#L24).
⬇️ will overwrite [phpstan.neon](/src/Commands/PublishCommand.php#L23).
```bash
php artisan toolbox:install --only="static-analysis"
```

or you can specify multiple values, ⬇️ will overwrite [phpstan.neon](/src/Commands/PublishCommand.php#L24) and [.php-cs-fixer.php](/src/Commands/PublishCommand.php#L28).
or you can specify multiple values, ⬇️ will overwrite [phpstan.neon](/src/Commands/PublishCommand.php#L23) and [pint.json](/src/Commands/PublishCommand.php#L27).
```bash
php artisan toolbox:install --only="static-analysis" --only="code-style"
```
Expand All @@ -88,21 +89,23 @@ Available values for the `--only` option:
Add those scripts to your `composer.json`:
```bash
"scripts": {
"post-update-cmd": [
...
"@php artisan clear-compiled",
"ide-helper": [
"@php artisan ide-helper:models --write-mixin --reset",
"@php artisan ide-helper:generate",
"@php artisan ide-helper:eloquent",
"@php artisan ide-helper:meta"
],
"models": "@php artisan ide-helper:models --write",
"analyse": "./vendor/bin/phpstan analyse --memory-limit=2G",
"refactor": "./vendor/bin/rector process",
"format": "./vendor/bin/php-cs-fixer fix --allow-risky=yes",
"refactor": "./vendor/bin/rector process --memory-limit=2G",
"format": "./vendor/bin/pint",
"test": "./vendor/bin/pest --exclude-group=e2e",
"test:fast": "./vendor/bin/pest --exclude-group=e2e --parallel",
"test:coverage": "./vendor/bin/pest --exclude-group=e2e --coverage --min=100 --coverage-html=.coverage --coverage-clover=coverage.xml",
"test:coverage": "./vendor/bin/pest --exclude-group=e2e --coverage --min=50 --coverage-html=.coverage --coverage-clover=coverage.xml",
"test:e2e": "@php artisan pest:dusk",
"test:mutation": "XDEBUG_MODE=coverage ./vendor/bin/infection --test-framework=pest --show-mutations"
"test:mutation": [
"Composer\\Config::disableProcessTimeout",
"XDEBUG_MODE=coverage vendor/bin/infection --show-mutations --threads=4 --only-covering-test-cases --min-msi=25 --min-covered-msi=85 --test-framework=pest --test-framework-options='--configuration=phpunit.xml --exclude-group=e2e'"
]
}
```

Expand All @@ -112,16 +115,18 @@ Allow plugins to be executed by Composer, by putting these lines on `composer.js
...
"allow-plugins": {
"phpstan/extension-installer": true,
"pestphp/pest-plugin": true
"pestphp/pest-plugin": true,
"infection/extension-installer": true
}
}
```

## Available Commands

Generate PHPDoc on your models (helpful for static analysis) [for more info](https://github.com/barryvdh/laravel-ide-helper#automatic-phpdocs-for-models)
Generate PHPDoc for your models and
other (helpful for your IDE and static analysis tools) [for more info](https://github.com/barryvdh/laravel-ide-helper#usage)
```bash
composer models
composer ide-helpers
```

Run code refactoring [for more info](https://github.com/rectorphp/rector)
Expand Down
35 changes: 15 additions & 20 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,43 +26,38 @@
}
],
"require": {
"php": "^8.0",
"barryvdh/laravel-debugbar": "^3.0",
"barryvdh/laravel-ide-helper": "^2.0",
"php": "^8.1",
"barryvdh/laravel-debugbar": "^3.7",
"barryvdh/laravel-ide-helper": "^2.12",
"brianium/paratest": "^6.6",
"fakerphp/faker": "^1.9.1",
"ergebnis/phpstan-rules": "^1.0",
"friendsofphp/php-cs-fixer": "^v3.0",
"graham-campbell/analyzer": "^3.0",
"graham-campbell/analyzer": "^3.1",
"illuminate/contracts": "^8.0|^9.0",
"infection/infection": "dev-master",
"johnkary/phpunit-speedtrap": "^v4.0",
"laravel/dusk": "^6.0",
"nunomaduro/larastan": "^1.0|^2.0",
"nunomaduro/laravel-mojito": "^0.2.8",
"pestphp/pest": "^1.0",
"laravel/dusk": "^7.0",
"laravel/sail": "^1.16",
"nunomaduro/larastan": "^2.2",
"pestphp/pest": "^1.22",
"pestphp/pest-plugin-faker": "^1.0",
"pestphp/pest-plugin-laravel": "^1.0",
"pestphp/pest-plugin-laravel": "^1.3",
"pestphp/pest-plugin-mock": "^1.0",
"pestphp/pest-plugin-parallel": "^v1.0",
"phpstan/extension-installer": "^1.1",
"pestphp/pest-plugin-parallel": "^v1.2",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-strict-rules": "^1.0",
"rector/rector": "^0.12",
"rector/rector": "^0.14.7",
"roave/security-advisories": "dev-latest",
"spatie/laravel-package-tools": "^1.4.3",
"spatie/laravel-ray": "^1.0",
"spatie/pest-plugin-snapshots": "^1.0",
"spatie/pest-plugin-test-time": "^1.0"
"spatie/pest-plugin-snapshots": "^1.1",
"spatie/pest-plugin-test-time": "^1.1"
},
"autoload": {
"psr-4": {
"Lemaur\\Toolbox\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Lemaur\\Toolbox\\Tests\\": "tests"
}
},
"config": {
"sort-packages": true
},
Expand Down
Loading

0 comments on commit 0a42b1c

Please sign in to comment.