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

PHP extension integration #42

Merged
merged 34 commits into from
Sep 9, 2019
Merged

PHP extension integration #42

merged 34 commits into from
Sep 9, 2019

Conversation

asgrim
Copy link
Collaborator

@asgrim asgrim commented Aug 23, 2019

Fixes #41

@asgrim asgrim added enhancement New feature or request WIP Work in progress - do not merge labels Aug 23, 2019
@asgrim asgrim self-assigned this Aug 23, 2019
@asgrim asgrim force-pushed the php-ext-integration branch 2 times, most recently from bb3db22 to 23df501 Compare August 24, 2019 08:39
composer.json Outdated Show resolved Hide resolved
…dle maybe/maybe not case of extension being loaded
@asgrim asgrim removed the WIP Work in progress - do not merge label Sep 9, 2019
@asgrim asgrim changed the title WIP - PHP extension integration PHP extension integration Sep 9, 2019
@asgrim
Copy link
Collaborator Author

asgrim commented Sep 9, 2019

@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');
Copy link
Contributor

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?

Copy link
Collaborator Author

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');
}

@cschneid cschneid merged commit 73616f1 into master Sep 9, 2019
@asgrim asgrim deleted the php-ext-integration branch September 9, 2019 14:41
@asgrim asgrim added this to the 0.2.0 milestone Oct 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integration PHP extension (if installed)
2 participants