vindi/vindi-woocommerce

View on GitHub
src/includes/admin/ProductStatus.php

Summary

Maintainability
A
0 mins
Test Coverage

The property $vindi_settings is not named in camelCase.
Open

class VindiProductStatus
{

  /**
   * @var VindiSettings
Severity: Minor
Found in src/includes/admin/ProductStatus.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 9 and the first side effect is on line 6.
Open

<?php

Visibility must be declared on method "__construct"
Open

  function __construct(VindiSettings $vindi_settings)

Expected 0 spaces before closing bracket; 1 found
Open

if ( ! defined( 'ABSPATH' ) ) {

Inline control structures are not allowed
Open

    if(empty(get_transient('vindi_product_message')))

Spaces must be used to indent lines; tabs are not allowed
Open

    exit; // Exit if accessed directly

Line indented incorrectly; expected at least 8 spaces, found 4
Open

    include_once VINDI_SRC . 'views/product-status.php';

Expected 0 spaces before closing bracket; 1 found
Open

if ( ! defined( 'ABSPATH' ) ) {

Line indented incorrectly; expected at least 4 spaces, found 2
Open

  {

Line indented incorrectly; expected 4 spaces, found 2
Open

  }

Line indented incorrectly; expected 4 spaces, found 2
Open

  }

Line indented incorrectly; expected at least 8 spaces, found 4
Open

    if(empty(get_transient('vindi_product_message')))

Line indented incorrectly; expected at least 4 spaces, found 2
Open

  {

Expected 0 spaces after opening bracket; 1 found
Open

if ( ! defined( 'ABSPATH' ) ) {

Line indented incorrectly; expected at least 8 spaces, found 4
Open

    $this->vindi_settings = $vindi_settings;

Line indented incorrectly; expected 4 spaces, found 2
Open

  public function product_status_notifier()

Expected 1 space after IF keyword; 0 found
Open

    if(empty(get_transient('vindi_product_message')))

Line indented incorrectly; expected at least 8 spaces, found 4
Open

    add_action('admin_notices', array(&$this, 'product_status_notifier'));

Line indented incorrectly; expected at least 8 spaces, found 6
Open

      return;

Line indented incorrectly; expected 4 spaces, found 2
Open

  function __construct(VindiSettings $vindi_settings)

Space after opening parenthesis of function call prohibited
Open

if ( ! defined( 'ABSPATH' ) ) {

Line indented incorrectly; expected 4 spaces, found 2
Open

  private $vindi_settings;

There are no issues that match your filters.

Category
Status