phpsess/file-storage

View on GitHub

Showing 10 of 10 total issues

Remove error control operator '@' on line 105.
Open

    public function save(string $sessionIdentifier, string $sessionData): void
    {
        $fileName = $this->getFileName($sessionIdentifier);

        $contents = new SessionContent();
Severity: Minor
Found in src/FileStorage.php by phpmd

ErrorControlOperator

Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

Example

function foo($filePath) {
    $file = @fopen($filPath); // hides exceptions
    $key = @$array[$notExistingKey]; // assigns null to $key
}

Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

Remove error control operator '@' on line 74.
Open

    private function setUpSessionPath(string $path): void
    {
        if (!$path) {
            $errorMessage = 'The session path could not be determined. Either pass it as the first ' .
                'parameter to the Storage Driver constructor or define it in the ini setting session.save_path.';
Severity: Minor
Found in src/FileStorage.php by phpmd

ErrorControlOperator

Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

Example

function foo($filePath) {
    $file = @fopen($filPath); // hides exceptions
    $key = @$array[$notExistingKey]; // assigns null to $key
}

Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

Remove error control operator '@' on line 224.
Open

    public function destroy(string $sessionIdentifier): void
    {
        if (!$this->sessionExists($sessionIdentifier)) {
            $errorMessage = 'The session you are trying to destroy does not exist.';
            throw new SessionNotFoundException($errorMessage);
Severity: Minor
Found in src/FileStorage.php by phpmd

ErrorControlOperator

Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

Example

function foo($filePath) {
    $file = @fopen($filPath); // hides exceptions
    $key = @$array[$notExistingKey]; // assigns null to $key
}

Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

Remove error control operator '@' on line 255.
Open

    public function clearOld(int $maxLife): void
    {
        $files = $this->getFilesInSessionPath();

        $limitTime = microtime(true) - $maxLife / 1000000;
Severity: Minor
Found in src/FileStorage.php by phpmd

ErrorControlOperator

Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

Example

function foo($filePath) {
    $file = @fopen($filPath); // hides exceptions
    $key = @$array[$notExistingKey]; // assigns null to $key
}

Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

Remove error control operator '@' on line 274.
Open

    private function getFilesInSessionPath(): iterable
    {
        $files = @scandir($this->filePath);

        if ($files === false) {
Severity: Minor
Found in src/FileStorage.php by phpmd

ErrorControlOperator

Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

Example

function foo($filePath) {
    $file = @fopen($filPath); // hides exceptions
    $key = @$array[$notExistingKey]; // assigns null to $key
}

Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

Remove error control operator '@' on line 308.
Open

    private function shouldBeCleared(string $fileName, float $limitTime): bool
    {
        if (strpos($fileName, $this->filePrefix) !== 0) {
            return false;
        }
Severity: Minor
Found in src/FileStorage.php by phpmd

ErrorControlOperator

Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

Example

function foo($filePath) {
    $file = @fopen($filPath); // hides exceptions
    $key = @$array[$notExistingKey]; // assigns null to $key
}

Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

Remove error control operator '@' on line 128.
Open

    public function get(string $sessionIdentifier): string
    {
        $fileName = $this->getFileName($sessionIdentifier);

        if (!$this->sessionExists($sessionIdentifier)) {
Severity: Minor
Found in src/FileStorage.php by phpmd

ErrorControlOperator

Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

Example

function foo($filePath) {
    $file = @fopen($filPath); // hides exceptions
    $key = @$array[$notExistingKey]; // assigns null to $key
}

Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

Avoid using empty try-catch blocks in unlock.
Open

        } catch (Exception $e) {
        }
Severity: Minor
Found in src/FileStorage.php by phpmd

EmptyCatchBlock

Since: 2.7.0

Usually empty try-catch is a bad idea because you are silently swallowing an error condition and then continuing execution. Occasionally this may be the right thing to do, but often it's a sign that a developer saw an exception, didn't know what to do about it, and so used an empty catch to silence the problem.

Example

class Foo {

  public function bar()
  {
      try {
          // ...
      } catch (Exception $e) {} // empty catch block
  }
}

Source https://phpmd.org/rules/design.html#emptycatchblock

Line exceeds 120 characters; contains 136 characters
Open

     * @param  string|null $path        The absolute path to the session files directory. If not set, defaults to INI session.save_path.
Severity: Minor
Found in src/FileStorage.php by phpcodesniffer

Library texthtml/php-lock is licensed under a non-compliant license: GNU Affero General Public License 3.0
Open

            "name": "texthtml/php-lock",
Severity: Minor
Found in composer.lock by git-legal
Severity
Category
Status
Source
Language