yiisoft/yii2

View on GitHub
framework/web/SessionIterator.php

Summary

Maintainability
A
0 mins
Test Coverage

__construct accesses the super-global variable $_SESSION.
Open

    public function __construct()
    {
        $this->_keys = array_keys(isset($_SESSION) ? $_SESSION : []);
        $this->rewind();
    }
Severity: Minor
Found in framework/web/SessionIterator.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

next accesses the super-global variable $_SESSION.
Open

    public function next()
    {
        do {
            $this->_key = next($this->_keys);
        } while ($this->_key !== false && !isset($_SESSION[$this->_key]));
Severity: Minor
Found in framework/web/SessionIterator.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

__construct accesses the super-global variable $_SESSION.
Open

    public function __construct()
    {
        $this->_keys = array_keys(isset($_SESSION) ? $_SESSION : []);
        $this->rewind();
    }
Severity: Minor
Found in framework/web/SessionIterator.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

current accesses the super-global variable $_SESSION.
Open

    public function current()
    {
        return $this->_key !== false && isset($_SESSION[$this->_key]) ? $_SESSION[$this->_key] : null;
    }
Severity: Minor
Found in framework/web/SessionIterator.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

current accesses the super-global variable $_SESSION.
Open

    public function current()
    {
        return $this->_key !== false && isset($_SESSION[$this->_key]) ? $_SESSION[$this->_key] : null;
    }
Severity: Minor
Found in framework/web/SessionIterator.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

There are no issues that match your filters.

Category
Status