midasplatform/Midas

View on GitHub
core/Notification.php

Summary

Maintainability
A
0 mins
Test Coverage

Missing class import via use statement (line '96', column '23').
Open

            throw new Zend_Exception('Error: userDao parameter required');
Severity: Minor
Found in core/Notification.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '79', column '23').
Open

            throw new Zend_Exception('Error: userDao parameter required');
Severity: Minor
Found in core/Notification.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Avoid using static access to class 'MidasLoader' in method 'handleUserDeleted'.
Open

        $userApiModel = MidasLoader::loadModel('Userapi');
Severity: Minor
Found in core/Notification.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class 'MidasLoader' in method 'setDefaultWebApiKey'.
Open

        $userApiModel = MidasLoader::loadModel('Userapi');
Severity: Minor
Found in core/Notification.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class 'UtilityComponent' in method 'getDasboard'.
Open

            'Data Folder Writable' => array(is_writable(UtilityComponent::getDataDirectory())),
Severity: Minor
Found in core/Notification.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class 'UtilityComponent' in method 'getDasboard'.
Open

            'Temporary Folder Writable' => array(is_writable(UtilityComponent::getTempDirectory(''))),
Severity: Minor
Found in core/Notification.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

class Notification extends MIDAS_Notification
Severity: Minor
Found in core/Notification.php by phpcodesniffer

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 24 and the first side effect is on line 21.
Open

<?php
Severity: Minor
Found in core/Notification.php by phpcodesniffer

The property $_models is not named in camelCase.
Open

class Notification extends MIDAS_Notification
{
    /** @var array */
    public $_components = array('Utility', 'Authentication');

Severity: Minor
Found in core/Notification.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

The property $_components is not named in camelCase.
Open

class Notification extends MIDAS_Notification
{
    /** @var array */
    public $_components = array('Utility', 'Authentication');

Severity: Minor
Found in core/Notification.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

Property name "$_components" should not be prefixed with an underscore to indicate visibility
Open

    public $_components = array('Utility', 'Authentication');
Severity: Minor
Found in core/Notification.php by phpcodesniffer

Property name "$_models" should not be prefixed with an underscore to indicate visibility
Open

    public $_models = array('User', 'Item');
Severity: Minor
Found in core/Notification.php by phpcodesniffer

There are no issues that match your filters.

Category
Status