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 required from undeclared class \Dotenv\Dotenv
Open

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

Parameter $router has undeclared type ?\Teto\Routing\Router
Open

function router(Router $router = null)
Severity: Minor
Found in sample/inc/functions.php by phan

Parameter $action has undeclared type \Teto\Routing\Action
Open

$routes['acct'] = ['GET', '/acct/:acct', function (Action $action) {
Severity: Minor
Found in sample/inc/routes.php by phan

Reference to instance property param from undeclared class \Teto\Routing\Action
Open

    $acct_input = $action->param['acct'];
Severity: Minor
Found in sample/inc/routes.php by phan

Possibly zero references to use statement for classlike/namespace v (\Respect\Validation\Validator)
Open

    use Respect\Validation\Validator as v;
Severity: Minor
Found in sample/inc/app.php by phan

Call to method __construct from undeclared class \Whoops\Run
Open

        $whoops = new \Whoops\Run;
Severity: Critical
Found in sample/inc/bootstrap.php by phan

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

    $dotenv = new Dotenv\Dotenv(dirname(__DIR__));
Severity: Critical
Found in sample/inc/bootstrap.php by phan

Doc-block of $router in router is phpdoc param type \Teto\Routing\Router which is not a permitted replacement of the nullable param type ?\Teto\Routing\Router declared in the signature ('?T' should be documented as 'T|null' or '?T')
Open

 * @param  Router $router
Severity: Minor
Found in sample/inc/functions.php by phan

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

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

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

    chrome_log()->info('session', $_SESSION);
Severity: Critical
Found in sample/inc/routes.php by phan

Call to method makePath from undeclared class \Teto\Routing\Router
Open

    $callback_url = app\get_service_base_url(router()->makePath('auth_callback'));
Severity: Critical
Found in sample/inc/routes.php by phan

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

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

Call to method __construct from undeclared class \Monolog\Handler\NoopHandler
Open

        $handler = is_production() ? new NoopHandler : new ChromePHPHandler(Logger::INFO);
Severity: Critical
Found in sample/inc/functions.php by phan

Parameter $action has undeclared type \Teto\Routing\Action
Open

$routes['license'] = ['GET', '/license', function (Action $action) {
Severity: Minor
Found in sample/inc/routes.php by phan

Parameter $action has undeclared type \Teto\Routing\Action
Open

$routes['post_login'] = ['POST', '/login', function (Action $action) {
Severity: Minor
Found in sample/inc/routes.php by phan

Call to method __construct from undeclared class \Monolog\Handler\StreamHandler
Open

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

Doc-block of $flash in last_flash is phpdoc param type array which is not a permitted replacement of the nullable param type ?array declared in the signature ('?T' should be documented as 'T|null' or '?T')
Open

 * @param array  $flash
Severity: Minor
Found in sample/inc/functions.php by phan
Severity
Category
Status
Source
Language