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

PHP 7 requirement not detected for return type hint #233

Closed
CybotTM opened this issue Aug 8, 2017 · 5 comments
Closed

PHP 7 requirement not detected for return type hint #233

CybotTM opened this issue Aug 8, 2017 · 5 comments
Assignees

Comments

@CybotTM
Copy link

CybotTM commented Aug 8, 2017

PHP CompatInfo does not detect PHP 7 minimum requirement for return type hint.

With following source code file:

<?php

function fooBar(integer $i) : string
{
    return (string) $i;
}

i would expect PHP CompatInfo returns PHP 7 as minimum, but it does report PHP 5.0.0 as minimum:

$ phpcompatinfo analyser:run php7.php

Data Source Analysed

Directories                                          1
Files                                                1

Extensions Analysis

    Extension Matches REF  EXT min/Max PHP min/Max PHP all
    Core              Core             4.0.0
    Total [1]                          4.0.0

Namespaces Analysis

    Namespace Matches REF  EXT min/Max PHP min/Max PHP all
    +global           Core             5.0.0
    Total [1]                          5.0.0

No interface found

No trait found

Classes Analysis

    Class     Matches REF  EXT min/Max PHP min/Max PHP all
  U integer   1       user             4.0.0
    Total [1]                          4.0.0

Functions Analysis

    Function  Matches REF  EXT min/Max PHP min/Max
    fooBar            user             5.0.0
    Total [1]                          5.0.0

No constant found

No condition found

Requires PHP 5.0.0 (min), PHP 5.0.0 (all)
@llaville
Copy link
Owner

llaville commented Aug 9, 2017

Hello
Thanks for reporting this issue. BTW, be aware that I've beginning to write a new Major version 6.0 that will be independant of php-reflect and will support PHP 7.0, 7.1, and future 7.2

Branch 5.0 is features closed. I'll drop branch 5.1, that was an attempt to include a new architecture based on sniffs.
Branch 6.0 will be soon available with an alpha version and a rewrites of monolithic CompatibilityAnalyser.

I'll keep you in touch ASAP.

@llaville llaville self-assigned this Oct 5, 2017
@llaville llaville added this to the 6.0 milestone Oct 5, 2017
@MatthiasKuehneEllerhold
Copy link

MatthiasKuehneEllerhold commented Dec 4, 2017

Just for completeness:
Detection of nullable types are also missing (as an indicator for 7.1), but I'm sure you had that on your radar already. :)

@llaville
Copy link
Owner

Removes MS 6.0 because it will be included for upcoming release 5.4 (that is a compromise before full rewrites of v6), using the sniff architecture.

llaville added a commit that referenced this issue Jul 10, 2020
@llaville llaville mentioned this issue Jul 10, 2020
24 tasks
@llaville
Copy link
Owner

Sorry to be very so long to gave us a fix, but the world health situation give me a chance of free time ;-)

@llaville llaville added the bug label Jul 10, 2020
@llaville
Copy link
Owner

llaville commented Aug 5, 2020

@MatthiasKuehneEllerhold I bit late to reply, but you're right it's effectivly on scope and issue #273 referenced it now !

It will be solved and with beta code of version 5.4 that will be available very soon now on repository.

Feedback of incoming v5.4 that will improve PHP 7 detection are of course welcome !

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

No branches or pull requests

3 participants