Recent Releases of https://github.com/stefanzweifel/laravel-stats
https://github.com/stefanzweifel/laravel-stats - v2.16.0
Added
- Add Pest v4 Support (#232)
- PHP
Published by github-actions[bot] 6 months ago
https://github.com/stefanzweifel/laravel-stats - v2.15.0
Changed
- Add Support for Laravel 12 (#230)
- PHP
Published by github-actions[bot] about 1 year ago
https://github.com/stefanzweifel/laravel-stats - v2.14.0
Added
- Add Support for PHP 8.4 (#229)
Changed
- PHP
Published by github-actions[bot] over 1 year ago
https://github.com/stefanzweifel/laravel-stats - v2.13.2
Changed
- Sort Files when statistics is shown in Verbose Mode (#226)
- Refactor Codebase to use modern PHP features using Rector (#225)
- PHP
Published by github-actions[bot] almost 2 years ago
https://github.com/stefanzweifel/laravel-stats - v2.13.1
Changed
- Remove calls to getLaravelVersion() for versions no longer supported (#224)
Fixed
- Fix Middleware Classifier for Laravel 11 (#223)
- PHP
Published by github-actions[bot] about 2 years ago
https://github.com/stefanzweifel/laravel-stats - v2.13.0
Added
- Add Support for Laravel 11 (#222)
- PHP
Published by github-actions[bot] about 2 years ago
https://github.com/stefanzweifel/laravel-stats - v2.12.0
Added
- Add Support for PHP 8.3 (#221)
- PHP
Published by github-actions[bot] over 2 years ago
https://github.com/stefanzweifel/laravel-stats - v2.11.4
Fixed
- Fix Laravel 10 bug in stats list command. (#220)
- PHP
Published by github-actions[bot] over 2 years ago
https://github.com/stefanzweifel/laravel-stats - v2.11.3
Fixed
- Ignore Pest Files when finding and loading Classes (#219)
- PHP
Published by github-actions[bot] over 2 years ago
https://github.com/stefanzweifel/laravel-stats - v2.11.2
Fixed
- Switch to forked phploc package and add support for Laravel 10 / PHPUnit 10 (#217)
- PHP
Published by github-actions[bot] almost 3 years ago
https://github.com/stefanzweifel/laravel-stats - v2.11.1
Changed
- Add Support for PhpUnit 10 (#215)
- PHP
Published by github-actions[bot] almost 3 years ago
https://github.com/stefanzweifel/laravel-stats - v2.11.0
Added
- Add Support for Laravel 10 (#213)
Changed
- PHP
Published by github-actions[bot] about 3 years ago
https://github.com/stefanzweifel/laravel-stats - v2.10.0
Added
- Add Support for PHP 8.2 (#210)
- PHP
Published by github-actions[bot] over 3 years ago
https://github.com/stefanzweifel/laravel-stats - v2.9.2
Fixed
- Fix Issue with Anonymous Database Migrations (#208)
- PHP
Published by github-actions[bot] over 3 years ago
https://github.com/stefanzweifel/laravel-stats - v2.9.1
Fixed
- Fix Issue with running
statswith Laravel Sail and Swoole extension installed (#207)
- PHP
Published by github-actions[bot] over 3 years ago
https://github.com/stefanzweifel/laravel-stats - v2.9.0
Deprecated
- Deprecate
--shareoption (#205)
- PHP
Published by github-actions[bot] almost 4 years ago
https://github.com/stefanzweifel/laravel-stats - v2.8.1
Fixed
- Fix EventListenerClassifier and add EventSubscribers Test (#204)
- PHP
Published by github-actions[bot] about 4 years ago
https://github.com/stefanzweifel/laravel-stats - v2.8.0
Added
- Add Support for Laravel 9 (#202)
- PHP
Published by github-actions[bot] about 4 years ago
https://github.com/stefanzweifel/laravel-stats - v2.7.0
Added
- Add Livewire Component classifier (#201)
- PHP
Published by github-actions[bot] over 4 years ago
https://github.com/stefanzweifel/laravel-stats - v2.6.0
Added
- Add Support for PHP 8.1 (#198)
Removed
- Drop Support for Laravel 6 (#200)
- PHP
Published by github-actions[bot] over 4 years ago
https://github.com/stefanzweifel/laravel-stats - v2.5.2
Fixes
- Update config to exclude
Swoolenamespace when runningstatscommand. (Fixes Issue when runningstatsin a Laravel Octane Application) #196
- PHP
Published by stefanzweifel almost 5 years ago
https://github.com/stefanzweifel/laravel-stats - v2.5.1
Fixes
- Fix
statscommand when run in projects which is using Closure based Event Listeners in Modelsbootedmethod. #193
- PHP
Published by stefanzweifel almost 5 years ago
https://github.com/stefanzweifel/laravel-stats - v2.5.0
Added
- Support for PHP 8 #187
- PHP
Published by stefanzweifel over 5 years ago
https://github.com/stefanzweifel/laravel-stats - v2.4.1
Changed
- Use latest version of
stefanzweifel/laravel-stats-phploc(Remove deprecatedsebastian/finder-facadedependency) #185, #184
- PHP
Published by stefanzweifel over 5 years ago
https://github.com/stefanzweifel/laravel-stats - v2.4.0
Added
- PHP
Published by stefanzweifel over 5 years ago
https://github.com/stefanzweifel/laravel-stats - v2.3.0
I'm thrilled to release v2.3.0 of laravel-stats. π
A quick overview of what has changed in this version.
- Support for Model Observers has been added. (#177, #128)
- A new
--shareoption has been added (see below for more information) #178 - Support for Laravel 6 and PHPUnit 8 has been added back. (Was previously removed in v2.1.0)
New --share option
v2.3.0 comes with a new --share-option for the stats-command.
By executing php artisan stats --share your project statistics are shared anonymously with the Laravel community.
Your statistics will be combined with other Laravel projects to provide metrics available on stats.laravelshift.com.
The stats command will never automatically share anything! Only when this option is used and you confirm the prompts will data be shared.
What does this mean in detail?
By executing php artisan stats --share you can opt-in to share the used components and its statistical numbers like "number of classes" and "lines of code per component" with the Laravel community on stats.laravelshift.com.
Jason McCreary, the creator of Shift, and I developed this feature from an idea we had 2 years ago after Jason gave his "Laravel by the Numbers" talk at Laracon US 2018.
Our goal is to collect and aggregate statistical data from Laravel projects and transform the raw data into an easy-to-read dashboard for the Laravel community.
We hope it to make it easier for you as a developer to make decisions when crafting your Laravel projects. For example: "How many projects use Blade Components?" or "How many projects have a Models folder?"
What is being shared?
The request sent to the API contains:
- the project name you've defined (used internally as a unique identifier)
- a list of components and their statistical numbers in your projects. (e.g.
controllers_lloc_per_methodorphpunit_tests)
Class names or code will never be shared. If you would like to see the exact payload which is sent to the API, you may use the --payload option. You may also use the --dry-run option to prevent sending a request to the API.
For example, the following command will simulate sharing your project stats with the API and output the data to that would be sent:
shell
php artisan stats --share --payload --dry-run
- PHP
Published by stefanzweifel over 5 years ago
https://github.com/stefanzweifel/laravel-stats - v2.1.1
Removed
- Drop support for
phpunit8.0
- PHP
Published by stefanzweifel almost 6 years ago
https://github.com/stefanzweifel/laravel-stats - v2.1.0
Note: Due to underlying changes to the phploc-dependency, the numbers for "loc" and "lloc" in your project may change.
Changed
- Run test suite against Laravel 7 #170
Removed
- Removed support to detect
Illuminate\Http\Resources\Json\Resourceas an API resource #170 - Dropped support for Laravel 5.8 #170
- Dropped support for Laravel 6.0 #170
- Dropped support for PHP 7.2 #170
- PHP
Published by stefanzweifel almost 6 years ago
https://github.com/stefanzweifel/laravel-stats - v2.0.1
Added
Changed
- Test Package against Laravel 6.0 #155
- Set
declare(strict_types=1)everywhere #161 - Changed Version Contraints in composer.json to support Laravel 7.0
- Changed Version Contraints for
phpunit/phpunitto support9.0
Fixed
- Make
ControllerClassifiercompatible with Lumen 6.0 2462fe - Fix an Issue in
ResourceClassifierwhere not all kinds of Resources were correctly identified as API Resources #156
- PHP
Published by stefanzweifel about 6 years ago
https://github.com/stefanzweifel/laravel-stats - v2.0.2
Changed
- Changed Version Contraints for
phploc/phplocto support6.0#167
- PHP
Published by stefanzweifel about 6 years ago
https://github.com/stefanzweifel/laravel-stats - v2.0.0
Almost 2 years after the first major release of stats I'm thrilled to release 2.0. π
Under the hood a lot has changed: Many internal classes have been rewritten to pave the path for new cool features (more about them soon). Performance for bigger projects with more than 1000 classes has also been improved, by using more caches internally.
On the side of breaking changes, support for older PHP, Laravel and Lumen versions has been removed. Also checkout the "Upgrade Guide" below to see, if your apps works as intended with version 2.0.
New Features
Differentiation between Application Code and Test Code
One of the statistics stats shows you, is the ratio between application code and test code.
The previous versions had a naive approach of determining if a class belongs to the application or test code (If the class wasn't a test, it counted towards the application code).
In 2.0, each Component can now be explicitly be configured to count towards application or test code.
For example all Laravel Nova Classifiers (Actions, Filters, Lenses and Resources) have been configured to NOT count towards the application AND NOT towards the test code.
If you disagree with this decision, feel free to open an issue. Im open for discussions!
Verbose Mode
Previously, it was impossible to see which classes have been classified as "Others". Version 2.0 now supports a verbose option β triggered by adding -v or --verbose to the command call β which will list all recognized classes for a component.
Example output for a fresh Laravel 6.0 app:
shell
php artisan stats --verbose
+----------------------------+----------------------------+---------+---------------+-----+------+-------------+
| Name | Classes | Methods | Methods/Class | LoC | LLoC | LLoC/Method |
+----------------------------+----------------------------+---------+---------------+-----+------+-------------+
| Middlewares | 7 | 2 | 0.29 | 146 | 26 | 13 |
| - App\Http\Middleware\VerifyCsrfToken | 0 | 0 | 24 | 4 | 0 |
| - App\Http\Middleware\RedirectIfAuthenticated | 1 | 1 | 26 | 5 | 5 |
| - App\Http\Middleware\TrimStrings | 0 | 0 | 18 | 3 | 0 |
| - App\Http\Middleware\Authenticate | 1 | 1 | 21 | 3 | 3 |
| - App\Http\Middleware\TrustProxies | 0 | 0 | 23 | 5 | 0 |
| - App\Http\Middleware\CheckForMaintenanceMode | 0 | 0 | 17 | 3 | 0 |
| - App\Http\Middleware\EncryptCookies | 0 | 0 | 17 | 3 | 0 |
+----------------------------+----------------------------+---------+---------------+-----+------+-------------+
| Migrations | 3 | 6 | 2 | 103 | 31 | 5.17 |
| - CreatePasswordResetsTable | 2 | 2 | 32 | 8 | 4 |
| - CreateUsersTable | 2 | 2 | 36 | 12 | 6 |
| - CreateFailedJobsTable | 2 | 2 | 35 | 11 | 5.5 |
+----------------------------+----------------------------+---------+---------------+-----+------+-------------+
| Models | 1 | 0 | 0 | 39 | 8 | 0 |
| - App\User | 0 | 0 | 39 | 8 | 0 |
+----------------------------+----------------------------+---------+---------------+-----+------+-------------+
| Seeders | 1 | 1 | 1 | 16 | 1 | 1 |
| - DatabaseSeeder | 1 | 1 | 16 | 1 | 1 |
+----------------------------+----------------------------+---------+---------------+-----+------+-------------+
| Service Providers | 5 | 9 | 1.8 | 186 | 28 | 3.11 |
| - App\Providers\AppServiceProvider | 2 | 2 | 28 | 2 | 1 |
| - App\Providers\AuthServiceProvider | 1 | 1 | 30 | 5 | 5 |
| - App\Providers\EventServiceProvider | 1 | 1 | 34 | 7 | 7 |
| - App\Providers\RouteServiceProvider | 4 | 4 | 73 | 9 | 2.25 |
| - App\Providers\BroadcastServiceProvider | 1 | 1 | 21 | 5 | 5 |
+----------------------------+----------------------------+---------+---------------+-----+------+-------------+
| PHPUnit Tests | 3 | 2 | 0.67 | 50 | 12 | 6 |
| - Tests\TestCase | 0 | 0 | 10 | 3 | 0 |
| - Tests\Unit\ExampleTest | 1 | 1 | 19 | 4 | 4 |
| - Tests\Feature\ExampleTest | 1 | 1 | 21 | 5 | 5 |
+----------------------------+----------------------------+---------+---------------+-----+------+-------------+
| Other | 9 | 11 | 1.22 | 410 | 61 | 5.55 |
| - App\Console\Kernel | 2 | 2 | 42 | 6 | 3 |
| - App\Exceptions\Handler | 2 | 2 | 51 | 7 | 3.5 |
| - App\Http\Controllers\Controller | 0 | 0 | 13 | 6 | 0 |
| - App\Http\Controllers\Auth\ForgotPasswordController | 1 | 1 | 32 | 5 | 5 |
| - App\Http\Controllers\Auth\LoginController | 1 | 1 | 39 | 6 | 6 |
| - App\Http\Controllers\Auth\ResetPasswordController | 1 | 1 | 39 | 6 | 6 |
| - App\Http\Controllers\Auth\RegisterController | 3 | 3 | 72 | 11 | 3.67 |
| - App\Http\Controllers\Auth\VerificationController | 1 | 1 | 41 | 8 | 8 |
| - App\Http\Kernel | 0 | 0 | 81 | 6 | 0 |
+----------------------------+----------------------------+---------+---------------+-----+------+-------------+
+----------------------------+----------------------------+---------+---------------+-----+------+-------------+
| Total | 29 | 31 | 1.07 | 950 | 167 | 5.39 |
+-------------------- Code LLoC: 155 β’ Test LLoC: 12 β’ Code/Test Ratio: 1:0.1 β’ Routes: 2 +------+-------------+
Filter output by Components
It's now possible to filter the output for certain components.
shell
php artisan stats --components=Migrations,Models
+------------+---------+---------+---------------+-----+------+-------------+
| Name | Classes | Methods | Methods/Class | LoC | LLoC | LLoC/Method |
+------------+---------+---------+---------------+-----+------+-------------+
| Migrations | 3 | 6 | 2 | 103 | 31 | 5.17 |
| Models | 1 | 0 | 0 | 39 | 8 | 0 |
+------------+---------+---------+---------------+-----+------+-------------+
| Total | 29 | 31 | 1.07 | 950 | 167 | 5.39 |
+--- Code LLoC: 155 β’ Test LLoC: 12 β’ Code/Test Ratio: 1:0.1 β’ Routes: 2 ---+
Upgrade Guide
Update configuration file
Impact: All users, Effort: Low
Laravel 6.0 comes with a new tests/bootstrap.php file. If you have an existing app which has been updated to Laravel 6.0, add the file to the exclude-key in config/stats.php to improve the performance of artisan stats.
diff
'exclude' => [
+ base_path('tests/bootstrap.php'),
// base_path('app/helpers.php'),
// base_path('app/Services'),
],
Update Custom Component Classifiers
Impact: Moderate, Effort: Moderate
The Classifier-contract has been updated:
- Return Type Hints have been declared for all methods in the contract.
- The
getName()method has been renamed toname(). - The
countsTowardsApplicationCode()has been added. The method must return a boolean and indicates, if the given component should count towards the application code. This piece of information is used in the calculation of the "Code to Test ratio". - The
countsTowardsTests()has been added. The method must return a boolean and indicates, if the given component should count towards the test code. This piece of information is used in the calculation of the "Code to Test ratio".
If you've defined your own Custom Components, you have to update your implementations to meet the new criterias.
- PHP
Published by stefanzweifel over 6 years ago
https://github.com/stefanzweifel/laravel-stats - v1.9.1
- Fix compatibility issues with Lumen #139
- PHP
Published by stefanzweifel almost 7 years ago
https://github.com/stefanzweifel/laravel-stats - v1.8.3
- Add compatibility with PHP7.3 (please also run
composer upgrade phploc/phploc)
- PHP
Published by stefanzweifel almost 7 years ago
https://github.com/stefanzweifel/laravel-stats - v1.9.0
- Display number of Routes #136
- PHP
Published by stefanzweifel almost 7 years ago
https://github.com/stefanzweifel/laravel-stats - v.1.8.1
- Add Support for Laravel 5.8 (#132)
See our CHANGELOG for more details.
- PHP
Published by stefanzweifel about 7 years ago
https://github.com/stefanzweifel/laravel-stats - v.1.8.0
- Add Support for Laravel Nova Components (#127)
- Automatically test the package against multiple PHP and Laravel Versions (#126)
See our CHANGELOG for more details.
- PHP
Published by stefanzweifel over 7 years ago
https://github.com/stefanzweifel/laravel-stats - v1.7.2
- Add Support for Laravel 5.7
See our CHANGELOG for more details.
- PHP
Published by stefanzweifel over 7 years ago
https://github.com/stefanzweifel/laravel-stats - v1.7.0
This release add support for Lumen. Thanks to @krenor for his PR (#121)
See our CHANGELOG for more details.
- PHP
Published by stefanzweifel almost 8 years ago
https://github.com/stefanzweifel/laravel-stats - v1.6.0
- Add support for Laravel 5.6
See our CHANGELOG for more details.
- PHP
Published by stefanzweifel about 8 years ago
https://github.com/stefanzweifel/laravel-stats - v1.5.0
This release adds 2 new features:
The stats.php config file slightly changed for this release. I suggest you update your local version.
See our CHANGELOG for more details.
- PHP
Published by stefanzweifel about 8 years ago
https://github.com/stefanzweifel/laravel-stats - v1.4.0
This release adds 2 new configuration options:
These new configuration options should help you running the stats-command in exotic environments like discussed in Issue #46.
See our CHANGELOG for more details.
- PHP
Published by stefanzweifel about 8 years ago
https://github.com/stefanzweifel/laravel-stats - v1.3.0
This release adds support to display the Code to Test ratio at the bottom of the summary table.
See our CHANGELOG for more details.
- PHP
Published by stefanzweifel over 8 years ago
https://github.com/stefanzweifel/laravel-stats - v1.2.0
This release adds support to detect Event Listener.
See our CHANGELOG for more details.
- PHP
Published by stefanzweifel over 8 years ago
https://github.com/stefanzweifel/laravel-stats - v1.1.0
This release adds support to detect PHPUnit, Laravel Dusk and Laravel Browser Kit tests.
If you upgrade from 1.0.0 you have to update your stats.php config file:
php
'paths' => [
base_path('app'),
base_path('database'),
base_path('tests'), // <= Add this line to get insights about your tests
],
See our CHANGELOG for more details.
- PHP
Published by stefanzweifel over 8 years ago
https://github.com/stefanzweifel/laravel-stats - v1.0.0
π v1.0.0 has been released.
We now cover most of Laravels Core components. If you think something is missing or you have found a bug, please create a new issue.
If you have been using the package before, you should delete and re-publish the config file.
Thanks for all the support and feedback. Special thanks to JerguΕ‘ Lejko and all contributors for their pull requests and feedback.
See our CHANGELOG for more details.
- PHP
Published by stefanzweifel over 8 years ago