BaguettePHP/mastodon-api

View on GitHub

Showing 443 of 443 total issues

set_flash accesses the super-global variable $_SESSION.
Open

function set_flash(array $input)
{
    $has_flash = !isset($_SESSION['_flash']) || !is_array($_SESSION['_flash']);
    $flash = $has_flash ? $_SESSION['_flash'] : [];

Severity: Minor
Found in sample/inc/functions.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

gc_session accesses the super-global variable $_SESSION.
Open

    function gc_session()
    {
        $now = time();

        $_SESSION['login'] = isset($_SESSION['login']) ? $_SESSION['login'] : [];
Severity: Minor
Found in sample/inc/app.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

gc_session accesses the super-global variable $_SESSION.
Open

    function gc_session()
    {
        $now = time();

        $_SESSION['login'] = isset($_SESSION['login']) ? $_SESSION['login'] : [];
Severity: Minor
Found in sample/inc/app.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

Call to method __construct from undeclared class \Monolog\Logger
Open

        $logger = new \Monolog\Logger('');
Severity: Critical
Found in sample/inc/functions.php by phan

Return type of requestAPI() is undeclared type \Psr\Http\Message\ResponseInterface
Open

    public function requestAPI($method, $path, array $options, SessionStorage $session)
Severity: Minor
Found in src/Client.php by phan

Call to undeclared method \Baguette\Mastodon\Config\DotEnvStorage::readLinesFromFile
Open

            return $this->readLinesFromFile($fp);
Severity: Critical
Found in src/Config/DotEnvStorage.php by phan

Class uses undeclared trait \Teto\Object\TypedProperty
Open

class Status extends Entity
Severity: Critical
Found in src/Entity/Status.php by phan

Expected an object instance or the name of a class but saw expression with type false|string
Open

            $retval[] = ($obj instanceof $class) ? $obj : new $class($obj);
Severity: Minor
Found in src/Entity/helpers.php by phan

Doc-block of $http in auth contains phpdoc param type \Baguette\Mastodon\Grant\Client which is incompatible with the param type \GuzzleHttp\ClientInterface declared in the signature
Open

     * @param Client      $http
Severity: Minor
Found in src/Grant/Grant.php by phan

Call to method intVal from undeclared class \Respect\Validation\Validator
Open

        v::intVal()->min(0)->assert($id);
Severity: Critical
Found in src/Requester.php by phan

Call to method stringType from undeclared class \Respect\Validation\Validator
Open

            v::stringType()->assert($update_data['display_name']);
Severity: Critical
Found in src/Requester.php by phan

Call to method intVal from undeclared class \Respect\Validation\Validator
Open

            v::intVal()->min(0)->assert($options['max_id']);
Severity: Critical
Found in src/Requester.php by phan

Cannot modify read-only magic property \Baguette\Mastodon\Service\toot->toot_string defined at src/Service/Toot.php:13
Open

        $this->toot_string = $toot_string;
Severity: Minor
Found in src/Service/Toot.php by phan

Call to method __construct from undeclared class \GuzzleHttp\Client (Did you mean class \Baguette\Mastodon\Client)
Open

        $cached_client = new \GuzzleHttp\Client;
Severity: Critical
Found in src/functions.php by phan

Call to method required from undeclared class \Dotenv\Dotenv
Open

    $dotenv->required('MY_PHP_ENV');
Severity: Critical
Found in sample/inc/bootstrap.php by phan

Call to method pushHandler from undeclared class \Monolog\Logger
Open

        $logger->pushHandler(new StreamHandler($fp, Logger::INFO, true, null, true));
Severity: Critical
Found in sample/inc/functions.php by phan

Return type of chrome_log() is undeclared type \Monolog\Logger
Open

function chrome_log()
Severity: Minor
Found in sample/inc/functions.php by phan

Call to method pushHandler from undeclared class \Monolog\Logger
Open

        $logger->pushHandler($handler);
Severity: Critical
Found in sample/inc/functions.php by phan

Parameter $client has undeclared type \GuzzleHttp\Client (Did you mean class \Baguette\Mastodon\Client)
Open

    public function setAPIHttpClient(\GuzzleHttp\Client $client)
Severity: Minor
Found in src/Client.php by phan

Class extends undeclared class \Dotenv\Loader
Open

class DotEnvStorage extends \Dotenv\Loader implements Storage
Severity: Critical
Found in src/Config/DotEnvStorage.php by phan
Severity
Category
Status
Source
Language