Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
grunt-phpcbf
Advanced tools
Grunt plugin for running phpcbf (PHP Code Beautifier and Fixer)
This plugin is heavily based on grunt-phpcs
by Sascha Galley.
https://github.com/SaschaGalley/grunt-phpcs
phpcbf is an automatic code-fixer based on PHP CodeSniffer. https://github.com/squizlabs/PHP_CodeSniffer/wiki/Fixing-Errors-Automatically
This plugin requires Grunt ~0.4.5
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-phpcbf --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-phpcbf');
In your project's Gruntfile, add a section named phpcbf
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
phpcbf: {
options: {
// Task-specific options go here.
},
your_target: {
// Target-specific file lists and/or options go here.
},
},
});
Type: String
Default value: ', '
A string value that is used to do something with whatever.
Type: String
Default value: '.'
A string value that is used to do something else with whatever else.
grunt.initConfig({
phpcbf: {
options: {},
files: {
'dest/default_options': ['src/testing', 'src/123'],
},
},
});
###Options
Type: String
Default: 'phpcbf'
Type: Number
Default: 200*1024
Set the buffer size.
Type: Boolean
Default: false
Output more verbose information.
Type: Boolean
Default: true
Do not create a patch file.
Type: Integer
Default: false
The minimum severity required to display an error or warning.
Type: Integer
Default: false
The minimum severity required to display a warning.
Type: Integer
Default: false
The minimum severity required to display an error.
Type: String
Default: false
Define the standard to use. This can either be a builtin standard like PSR1
, PSR2
or PEAR
or a XML file
containing a ruleset.
Log report to the file.
Type: Integer
Default: false
Automatically convert tabs to the specified number of spaces when sniffing.
Do whatever you want with the output.
function log(err, stdout, stderr, callback) {
console.log(stdout);
callback();
}
grunt.initConfig({
phpcbf: {
app: {
src: ['src/**/*.php', 'tests/**/*.php']
},
options: {
callback: log
}
}
});
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
(Nothing yet)
FAQs
Grunt plugin for running phpcbf (PHP Code Beautifier and Fixer)
We found that grunt-phpcbf demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.