Issues (14)

Examples/read-file.php (1 issue)

Labels
Severity
1
<?php
2
require "../vendor/autoload.php";
3
4
//Directory
5
$dirFile = __DIR__ . "/vendor/myFolder/myFile.txt";
6
$url = new \Developers\Dir();
7
$result = $url ->FileRead($dirFile);
0 ignored issues
show
Are you sure the assignment to $result is correct as $url->FileRead($dirFile) targeting Developers\Dir::FileRead() seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
8
9
//Print
10
echo $result;