AppStateESS/InternshipInventory

View on GitHub
class/PdoFactory.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid using static access to class '\phpws2\Database' in method '__construct'.
Open

        $dsnArray = \phpws2\Database::parseDSN(PHPWS_DSN);
Severity: Minor
Found in class/PdoFactory.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

Call to method __construct from undeclared class \Intern\Exception (Did you mean class \Exception)
Open

            throw new Exception('Database connection DSN is not set.');
Severity: Critical
Found in class/PdoFactory.php by phan

Reference to undeclared constant \PHPWS_DSN
Open

        $dsnArray = \phpws2\Database::parseDSN(PHPWS_DSN);
Severity: Minor
Found in class/PdoFactory.php by phan

Call to method parseDSN from undeclared class \phpws2\Database
Open

        $dsnArray = \phpws2\Database::parseDSN(PHPWS_DSN);
Severity: Critical
Found in class/PdoFactory.php by phan

Saw unextractable annotation for comment '* @return $pdo A PDO instance, connected to the current DB'
Open

     * @return $pdo A PDO instance, connected to the current DB
Severity: Info
Found in class/PdoFactory.php by phan

There are no issues that match your filters.

Category
Status