markuspoerschke/guestbook

View on GitHub

Showing 7 of 7 total issues

Missing class import via use statement (line '29', column '32').
Open

        $this->createdAt = new \DateTime();
Severity: Minor
Found in src/Entity/Entry.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 '\DateTime' in method 'getAll'.
Open

            $entry->setCreatedAt(DateTime::createFromFormat(static::DATE_FORMAT, $row['created_at']));
Severity: Minor
Found in src/Repository/PdoEntryRepository.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

Doc-block of $createdAt in setCreatedAt contains phpdoc param type \DateTimeImmutable which is incompatible with the param type \DateTime declared in the signature
Open

     * @param \DateTimeImmutable $createdAt
Severity: Minor
Found in src/Entity/Entry.php by phan

Call to method setRules from undeclared class \PhpCsFixer\Config
Open

return (new PhpCsFixer\Config())
Severity: Critical
Found in .php-cs-fixer.php by phan

Call to method __construct from undeclared class \PhpCsFixer\Finder
Open

$finder = (new PhpCsFixer\Finder())
Severity: Critical
Found in .php-cs-fixer.php by phan

Call to method __construct from undeclared class \PhpCsFixer\Config
Open

return (new PhpCsFixer\Config())
Severity: Critical
Found in .php-cs-fixer.php by phan

Call to method in from undeclared class \PhpCsFixer\Finder
Open

$finder = (new PhpCsFixer\Finder())
Severity: Critical
Found in .php-cs-fixer.php by phan
Severity
Category
Status
Source
Language