Skip to content

Count called on string value #26

Closed
@kelunik

Description

@kelunik

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions