glomberg / wpdb-unsafe-methods
Psalm plugin to forbid calling provided `$wpdb` methods
Installs: 3
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:psalm-plugin
Requires
- ext-simplexml: *
- vimeo/psalm: ^4.8
Requires (Dev)
- phpunit/phpunit: ^9.5.5
- squizlabs/php_codesniffer: ^3.3
This package is auto-updated.
Last update: 2024-09-27 15:50:33 UTC
README
Installation
composer require --dev glomberg/wpdb-unsafe-methods
vendor/bin/psalm --init
vendor/bin/psalm-plugin enable glomberg/wpdb-unsafe-methods
Features
Configuration
If you follow the installation instructions, the psalm-plugin command will add this plugin configuration to the psalm.xml
configuration file.
<?xml version="1.0"?> <psalm errorLevel="1"> <!-- project configuration --> <plugins> <pluginClass class="Glomberg\WpdbUnsafeMethods\Plugin" /> </plugins> </psalm>
Do not forget to add method
tags with the names of the methods you want to forbid.
<pluginClass class="Glomberg\WpdbUnsafeMethods\Plugin"> <method>query</method> <method>get_results</method> </pluginClass>