yiisoft/yii2

View on GitHub
framework/web/SessionIterator.php

Summary

Maintainability
A
0 mins
Test Coverage

current accesses the super-global variable $_SESSION.
Open

    public function current()
    {
        return isset($_SESSION[$this->_key]) ? $_SESSION[$this->_key] : null;
    }
Severity: Minor
Found in framework/web/SessionIterator.php by phpmd

Since: PHPMD 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: http://phpmd.org/rules/controversial.txt

current accesses the super-global variable $_SESSION.
Open

    public function current()
    {
        return isset($_SESSION[$this->_key]) ? $_SESSION[$this->_key] : null;
    }
Severity: Minor
Found in framework/web/SessionIterator.php by phpmd

Since: PHPMD 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: http://phpmd.org/rules/controversial.txt

__construct accesses the super-global variable $_SESSION.
Open

    public function __construct()
    {
        $this->_keys = array_keys($_SESSION);
    }
Severity: Minor
Found in framework/web/SessionIterator.php by phpmd

Since: PHPMD 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: http://phpmd.org/rules/controversial.txt

next accesses the super-global variable $_SESSION.
Open

    public function next()
    {
        do {
            $this->_key = next($this->_keys);
        } while (!isset($_SESSION[$this->_key]) && $this->_key !== false);
Severity: Minor
Found in framework/web/SessionIterator.php by phpmd

Since: PHPMD 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: http://phpmd.org/rules/controversial.txt

There are no issues that match your filters.

Category
Status