added traits and modified phpdocs type hints