Skip to content

Fix optional parameter getStats($type) - #337

Merged
sodabrew merged 2 commits into
php-memcached-dev:masterfrom
ackintosh:fix-optional-parameter-getstats
Apr 23, 2017
Merged

Fix optional parameter getStats($type)#337
sodabrew merged 2 commits into
php-memcached-dev:masterfrom
ackintosh:fix-optional-parameter-getstats

Conversation

@ackintosh

Copy link
Copy Markdown
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
Copy Markdown
Collaborator

Thanks for the contribution!

@stolenegg

Copy link
Copy Markdown

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