method not found in class...

plz see my index.php in that when i write

var_dump($tasks[0]->foo());
it says under foo method not found in class..
and also in
function fetchAll($conn)
{
$statement = $conn->prepare('select * from todos');
$statement->execute();
return $statement->fetchAll(PDO::FETCH_CLASS, 'Task');
}
under prepare , fetchall




im new to phpstorm plz help me

0
3 comments

Does this code processed correctly by PHP?

0
Avatar
Permanently deleted user

yes

0

Hi there,

Typehint $tasks variable with PHPDoc comment.

This one should do the job -- it tells that $tasks is an array of Task instances:

/** @var Task[] $tasks */

 

0

Please sign in to leave a comment.