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

PhpFunctionUtil.getReturnType(): advanced analysis #9

Open
15 tasks
rentalhost opened this issue May 31, 2017 · 0 comments
Open
15 tasks

PhpFunctionUtil.getReturnType(): advanced analysis #9

rentalhost opened this issue May 31, 2017 · 0 comments

Comments

@rentalhost
Copy link
Owner

Additional analysis (should check if all is applicable):

  • Compound types: array, object, callable (and iterable?);
  • Resource type: resource;
  • Callable type: callable;
  • Void type: void;
    • From return;;
    • From no return statement;
  • Make sure to ignores unreacheable return statements;
    • After the last return (eg. return; return $unreacheable;);
    • After an uncatched throw;
  • Support to complex array types:
    • Return int[] from one type array (eg. [1, 2, 3]);
    • Return mixed[] from mixed type array (eg. [1, 'a', true]);
  • Make sure that comparison returns bool (eg. return $a === $b);
  • Make sure that expressions returns int (eg. return $a + $b);
  • Make sure that concats returns string (eg. return $a . $b);
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

1 participant