Skip to content

Instantly share code, notes, and snippets.

@havramar
Last active April 3, 2018 14:53
Show Gist options
  • Save havramar/fbc9f094870e8fec12fe to your computer and use it in GitHub Desktop.
Save havramar/fbc9f094870e8fec12fe to your computer and use it in GitHub Desktop.
PHPCS PSR2 standard with var_dump disallowed
{
"require": {
},
"require-dev": {
"squizlabs/php_codesniffer": "2.*@dev"
}
}
<?xml version="1.0"?>
<ruleset name="Custom Standard">
<description>A little bit extended PSR2 standard</description>
<exclude-pattern>*/tests/*</exclude-pattern>
<exclude-pattern>*/data/*</exclude-pattern>
<rule ref="PSR2"/>
<rule ref="Squiz.PHP.ForbiddenFunctions">
<properties>
<property name="forbiddenFunctions" type="array" value="var_dump=>NULL,sizeof=>count,delete=>unset,print=>echo,is_null=>NULL,create_function=>NULL"/>
</properties>
</rule>
</ruleset>
<?php
var_dump('x');
sizoef 'asdf';
delete $x;
print 'asdf';
is_null(null);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment