-
Notifications
You must be signed in to change notification settings - Fork 3
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
PHP extension integration #42
Conversation
bb3db22
to
23df501
Compare
93da59f
to
adadb5a
Compare
…dle maybe/maybe not case of extension being loaded
…ossible dependencies
adadb5a
to
91825f3
Compare
…an slate' at the start
@cschneid this is ready for review now please (note: please don't squash when merging, there are some potentially useful scripts that I added and removed within this PR which may be useful to refer back to later) |
Assert::keyExists($extensionCall, 'function'); | ||
Assert::keyExists($extensionCall, 'entered'); | ||
Assert::keyExists($extensionCall, 'exited'); | ||
Assert::keyExists($extensionCall, 'time_taken'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does php not have a builtin for has_key?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, array_key_exists
serves this purpose (and is actually used by the assertion library). The assertion library just abstracts away the logical assertion into a single semantic statement, the following is more or less equivalent:
if (!isset($extensionCall['time_taken']) || !array_key_exists('time_taken', $extensionCall)) {
throw new \InvalidArgumentException('The key time_taken did not exist');
}
Fixes #41