core/Fields/Definitions/OpeningTimes.php
Avoid unused parameters such as '$customizeManager'. Open
Open
public function addCustomizerControl(WP_Customize_Manager $customizeManager, CustomizerIntegration $integration)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid unused parameters such as '$integration'. Open
Open
public function addCustomizerControl(WP_Customize_Manager $customizeManager, CustomizerIntegration $integration)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid unused parameters such as '$old'. Open
Open
public function save($new, $old)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
TODO found Open
Open
* TODO: document configuration
- Exclude checks
TODO found Open
Open
return parent::_save($new, $old); // TODO: Change the autogenerated stub
- Exclude checks
Avoid variables with short names like $v. Configured minimum length is 3. Open
Open
array_walk_recursive($splitValues, function ($v) use (&$hasSplit) {
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
The method _save is not named in camelCase. Open
Open
public function _save($new, $old = null)
{
foreach ($new as &$item) {
if (!isset($item['closed'])) {
$item['closed'] = NULL;
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}