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

callable type hint in php 5.4 #5

Conversation

samsonasik
Copy link

apply callable type hint, refs zendframework#7119

@Ocramius
Copy link
Owner

These changes are semver-incompatible, as the signature of the methods change.

I wouldn't mind, to be honest, but any inheritance in the affected classes would be broken in this case.

(Shameless plug: we need more final)

@samsonasik
Copy link
Author

the @param type already indicate it must be callable, I don't change the @param callable|string|null as it optional. /cc @weierophinney if it is acceptable ?

@Ocramius
Copy link
Owner

@samsonasik the problem is that following code will cause a PHP Strict standards: Declaration of Bar::baz() should be compatible with Foo::baz(callable $baz):

<?php

class Foo
{
    public function baz(callable $baz)
    {
    }
}

class Bar extends Foo
{
    public function baz($baz)
    {
    }
}

@samsonasik
Copy link
Author

ok ;)

@Ocramius
Copy link
Owner

Closing as per review. Sorry @samsonasik, but I hope you understand what incompatibility is being introduced here.

@Ocramius Ocramius closed this Jan 13, 2015
@Ocramius Ocramius self-assigned this Jan 13, 2015
@samsonasik
Copy link
Author

it's ok 👍

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

Successfully merging this pull request may close these issues.

2 participants