Skip to content

Conversation

ackintosh
Copy link
Contributor

type is optional, but ReflectionParameter::isOptional() returns false.

example

        $method = new \ReflectionMethod(new \Memcached(), 'getStats');
        foreach ($method->getParameters() as $p) {
            var_dump($p->name, $p->isOptional());
        }

before

string(4) "args"
bool(false)

after

string(4) "type"
bool(true)

@sodabrew sodabrew added this to the 3.0.4 milestone Apr 23, 2017
@sodabrew sodabrew merged commit 6b660bd into php-memcached-dev:master Apr 23, 2017
@sodabrew
Copy link
Collaborator

Thanks for the contribution!

@stolenegg
Copy link

Many thanks for this fix - it was causing an issue in some of our unit tests (mocked instances were incorrectly requiring the optional parameter) 👍

@ackintosh ackintosh deleted the fix-optional-parameter-getstats branch May 20, 2017 02:19
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.

3 participants