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

Introduce Interfaces for library classes #248

Merged
merged 1 commit into from
Jan 17, 2022
Merged

Introduce Interfaces for library classes #248

merged 1 commit into from
Jan 17, 2022

Conversation

evansims
Copy link
Member

@evansims evansims commented Jan 17, 2022

This PR adds Interfaces to allow for class mocking within customer/downstream unit tests. This is necessary as we use the final keyword on classes to disallow extending/manipulating library methods, for reliability and safety best practices purposes.

The size of this PR is partly due to docblock changes, transitioning those documentation blocks from the classes and into their interfaces.

@@ -37,7 +37,17 @@ public function getSdk(): \Auth0\SDK\Auth0
}

/**
* Create/return instance of the Auth0-PHP SdkConfiguration.
* @inheritdoc
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added to ease unit testing purposes, allows overwriting the Auth0-PHP SDK instance.

@@ -49,7 +59,17 @@ public function getConfiguration(): \Auth0\SDK\Configuration\SdkConfiguration
}

/**
* Create/create a request state instance, a storage singleton containing authenticated user data.
* @inheritdoc
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also dded to ease unit testing purposes.

@evansims evansims marked this pull request as ready for review January 17, 2022 01:42
@evansims evansims requested a review from a team as a code owner January 17, 2022 01:42
@evansims evansims merged commit d5c656a into main Jan 17, 2022
@evansims evansims deleted the v7/add-contracts branch January 17, 2022 17:05
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants