phpDocumentor/TypeResolver

Count called on string value

kelunik opened this issue · 0 comments

https://github.com/phpDocumentor/TypeResolver/blob/master/src/Types/Context.php#L54 calls count($fqnn), but $fqnn is a string. That makes count($fqnn) return always 1, so the first character is checked here again instead of the last one. Fortunately, this doesn't strip the last character that's then as a leading \\ has been striped and the new first value is probably not a \\ again.

This should use strlen instead. Maybe it can be removed completely, as it has never been used and didn't matter so far.

Travis Build that led to the current version: https://travis-ci.org/phpDocumentor/TypeResolver/jobs/66579958
Introduction: e99540d