php - Fatal error: Uncaught ArgumentCountError: Too few arguments to function PostManager::__construct()

one text

Solution:

Try this:

$stmt->setFetchMode(PDO::FETCH_CLASS, 'PostManager', array($conn, $postId));

You forgot to pass the parameters here.

This is the signature you wanna use:

public PDOStatement::setFetchMode(int $mode = PDO::FETCH_CLASS, string $class, ?array $constructorArgs): bool

As you can see if the Ctor has args then you need to pass them as another parameter
array $constructorArgs

Source