Added missing type hints and PHPDoc