All Projects → akovalyov → DebugStatementsFixers

akovalyov / DebugStatementsFixers

Licence: MIT license
Fixers set for PHP-CS-Fixer. Removes debug statements, which shouldn't be in production ever.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to DebugStatementsFixers

php-cs-fixer-extensions
PHP-CS-Fixer extensions and configurations
Stars: ✭ 71 (+222.73%)
Mutual labels:  php-cs-fixer
solrdump
Export SOLR documents efficiently with cursors.
Stars: ✭ 33 (+50%)
Mutual labels:  dump
laravel-database-manager
Make your database simple, easier and faster with vuejs.
Stars: ✭ 50 (+127.27%)
Mutual labels:  dump
php-cs-fixer-config
📓 Provides a configuration for friendsofphp/php-cs-fixer, used within Refinery29.
Stars: ✭ 43 (+95.45%)
Mutual labels:  php-cs-fixer
LuaKit
Lua核心工具包,包含对面向对象,组件系统(灵活的绑定解绑模式),mvc分模块加载,事件分发系统等常用模式的封装。同时提供打印,内存泄漏检测,性能分析等常用工具类。
Stars: ✭ 112 (+409.09%)
Mutual labels:  dump
godump
Dumps information about a variable Like var_dump() in php.
Stars: ✭ 54 (+145.45%)
Mutual labels:  dump
sniff
Simpler PHP code sniffer built on top of PHP-CS-Fixer.
Stars: ✭ 14 (-36.36%)
Mutual labels:  php-cs-fixer
php-toolbox
🐳 A Docker image designed for PHP developers that care about code quality.
Stars: ✭ 18 (-18.18%)
Mutual labels:  php-cs-fixer
pagebuster
PageBuster - dump all executable pages of packed processes.
Stars: ✭ 188 (+754.55%)
Mutual labels:  dump
WikiChron
Data visualization tool for wikis evolution
Stars: ✭ 19 (-13.64%)
Mutual labels:  dump
php-cs-fixer-config
📓 Provides a configuration factory and multiple rule sets for friendsofphp/php-cs-fixer.
Stars: ✭ 29 (+31.82%)
Mutual labels:  php-cs-fixer
coding-standard
Nette Coding Standard code checker & fixer
Stars: ✭ 37 (+68.18%)
Mutual labels:  php-cs-fixer
appdecrypt
appdecrypt is a tool to make decrypt application encrypted binaries on macOS when SIP-enabled
Stars: ✭ 447 (+1931.82%)
Mutual labels:  dump
phpcsfixer-preset
Use the same php-cs-fixer configuration across all of your projects, with presets for common project layouts (Laravel, Composer packages, etc.).
Stars: ✭ 22 (+0%)
Mutual labels:  php-cs-fixer
moneta
Moneta is a live usermode memory analysis tool for Windows with the capability to detect malware IOCs
Stars: ✭ 384 (+1645.45%)
Mutual labels:  dump
annotate-pull-request-from-checkstyle
cs2pr - Annotate a GitHub Pull Request based on a Checkstyle XML-report within your GitHub Action
Stars: ✭ 146 (+563.64%)
Mutual labels:  php-cs-fixer
cassandra-exporter
Simple Tool to Export / Import Cassandra Tables into JSON
Stars: ✭ 44 (+100%)
Mutual labels:  dump
dd.js
Laravel dd() in JS
Stars: ✭ 51 (+131.82%)
Mutual labels:  dump
var-trumper
Make VarDumper great again
Stars: ✭ 16 (-27.27%)
Mutual labels:  dump
krumo
Krumo: Structured information display solution for PHP
Stars: ✭ 74 (+236.36%)
Mutual labels:  var-dump

Debug Statements Fixers

Fixers set for PHP-CS-Fixer. Removes debug statements, which shouldn't be in production ever.

PHP 7.0 Build Status Latest Stable Version Total Downloads License

If you have ever had 500 Error on production because dump() function is missing, or you forget to remove debug statements time to time - this small package is for you.

Debug statements are good for debugging, but it should never get to master branch.

Initially proposed as RFC in PHP-CS-Fixer repository, it was considered too risky to have it in core (see discussion at PHP-CS-Fixer/PHP-CS-Fixer#2218)

N.B. These fixers are risky and potentially can break your application. You should understand consequences of having it in your project (especially a legacy one). You are warned.

Functions being removed:

  • dump()
  • var_dump()
  • dd()

Usage

  1. Install it:

    $ composer require drew/debug-statements-fixers:^0.4 --dev
  2. Adjust your PHP-CS-Fixer config:

    # .php_cs.dist
    <?php
    
    $finder = PhpCsFixer\Finder::create()
        ->in([__DIR__.'/src', __DIR__.'/tests']);
    
    return PhpCsFixer\Config::create()
        ->setRules([
            //any fixers you would like to have
            'RemoveDebugStatements/dump' => true,
        ])
        ->registerCustomFixers([new Drew\DebugStatementsFixers\Dump()])
        ->setRiskyAllowed(true)
        ->setFinder($finder);    
  3. Enjoy.

Protip!

Works best when integrated with your CI server, just add this step to your CI config:

$ php vendor/bin/php-cs-fixer fix --diff --dry-run -v
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].