i trie to figure out what the use of the "text" is before te propery/variable in the contructor. What is the use of "TableGatewayInterface" in the constructor in the example below?
use Laminas\Db\TableGateway\TableGatewayInterface;
private function __construct(TableGatewayInterface $tableGateway)
{
$this->tableGateway = $tableGateway;
}
It states that
$tableGatewayproperty must come fromTableGatewayInterface, must be declared in that aliased struct. It means that You cannot simply make an instance with such constructor, with parameter of any value of Your choice, but with named parameter strictly fromTableGatewayInterface.Here is nice insight for You: List of Types Supported By PHP
Research PHP named parameters and return type declarations.