fix cast, fix phpdoc