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

Fix optional parameter getStats($type) #337

Merged

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
Contributor

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