-
-
Notifications
You must be signed in to change notification settings - Fork 450
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
[2.0] feat: Add global SDK #680
Conversation
Makefile
Outdated
@@ -18,10 +18,10 @@ cs-fix: | |||
vendor/bin/php-cs-fixer fix --config=.php_cs | |||
|
|||
phpstan: | |||
vendor/bin/phpstan analyse | |||
vendor/bin/phpstan analyse src tests -c phpstan.neon -l 7 |
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.
Those settings are hard-coded in the configuration, they are not needed.
composer.json
Outdated
"psr-4" : { | ||
"Sentry\\" : "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"files": ["src/Sdk.php"], |
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.
You shouldn't add it twice to the autoloader, the previous one is always used.
composer.json
Outdated
"psr-4" : { | ||
"Sentry\\" : "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"files": ["src/Sdk.php"], |
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.
"files": ["src/Sdk.php"], |
src/ClientBuilderInterface.php
Outdated
@@ -119,7 +119,7 @@ public function getMiddlewares(); | |||
/** | |||
* Gets the instance of the client built using the configured options. | |||
* | |||
* @return ClientInterface | |||
* @return Client |
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.
Please use the interface for extendability.
* @return Client | |
* @return ClientInterface |
src/ClientBuilderInterface.php
Outdated
*/ | ||
public function getClient(); | ||
public function getClient(): Client; |
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.
public function getClient(): Client; | |
public function getClient(): ClientInterface; |
src/State/Hub.php
Outdated
@@ -34,6 +34,13 @@ | |||
/** | |||
* Constructor. | |||
* | |||
* @var Hub | |||
*/ | |||
public static $currentHub; |
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.
public static $currentHub; | |
private static $currentHub; |
I will merge this now, tests work besides the |
This PR add the "global" SDK to the SDK 🙃
Which means it should enable stuff like:
Internally it uses a
Hub
,Scope
andClient
to make everything work.