Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Whitespace not ignored when attempting to get method caller #31

Closed
JDGrimes opened this issue Oct 27, 2016 · 0 comments
Closed

Whitespace not ignored when attempting to get method caller #31

JDGrimes opened this issue Oct 27, 2016 · 0 comments
Assignees
Labels
Milestone

Comments

@JDGrimes
Copy link
Owner

Given code like this:

    wordpoints_component( 'points' )
        ->get_sub_app( 'logs' )
        ->get_sub_app( 'views' );

These errors get reported:

/components/points/includes/logs.php#381 wordpoints_component( 1 ): Non gettexted string 'points'
/components/points/includes/logs.php#382 
        ->get_sub_app( 1 ): Non gettexted string 'logs'
/components/points/includes/logs.php#383 
        ->get_sub_app( 1 ): Non gettexted string 'views'

Note how instead of (unknown)->get_sub_app( 1 ), which we would get if this code was all in one line, the validator actually latches onto the whitespace. I think this is a simple case of us not discarding whitespace when we should be.

That is, given this code:

    wordpoints_component( 'points' )->get_sub_app( 'logs' )->get_sub_app( 'views' );

We'd get these errors:

/components/points/includes/logs.php#381 wordpoints_component( 1 ): Non gettexted string 'points'
/components/points/includes/logs.php#381 (unknown)->get_sub_app( 1 ): Non gettexted string 'logs'
/components/points/includes/logs.php#381 (unknown)->get_sub_app( 1 ): Non gettexted string 'views'

And that's what we would expect to get here.

@JDGrimes JDGrimes added the bug label Oct 27, 2016
@JDGrimes JDGrimes added this to the 0.3.1 milestone Oct 27, 2016
@JDGrimes JDGrimes self-assigned this Nov 2, 2016
JDGrimes added a commit that referenced this issue Nov 2, 2016
When a method call was wrapped to another line, the whitespace in front of it would be reported as the caller, instead of the correct variable or `(unknown)`.

Fixes #31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant