class/PdoFactory.php
Avoid using static access to class '\phpws2\Database' in method '__construct'. Open
Open
$dsnArray = \phpws2\Database::parseDSN(PHPWS_DSN);
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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
Open
throw new Exception('Database connection DSN is not set.');
- Create a ticketCreate a ticket
- Exclude checks
Reference to undeclared constant \PHPWS_DSN
Open
Open
$dsnArray = \phpws2\Database::parseDSN(PHPWS_DSN);
- Create a ticketCreate a ticket
- Exclude checks
Call to method parseDSN
from undeclared class \phpws2\Database
Open
Open
$dsnArray = \phpws2\Database::parseDSN(PHPWS_DSN);
- Create a ticketCreate a ticket
- Exclude checks
Saw unextractable annotation for comment '* @return $pdo A PDO instance, connected to the current DB'
Open
Open
* @return $pdo A PDO instance, connected to the current DB
- Create a ticketCreate a ticket
- Exclude checks