-
Notifications
You must be signed in to change notification settings - Fork 216
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
Fix info headers Extend error in dependant libs #304
Conversation
@@ -54,7 +54,9 @@ | |||
<exclude name="Generic.Functions.OpeningFunctionBraceKernighanRitchie"/> | |||
</rule> | |||
<rule ref="Generic.Metrics"/> | |||
<rule ref="Generic.NamingConventions"/> | |||
<rule ref="Generic.NamingConventions"> |
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.
PHP formatting directive
* | ||
* @var array | ||
*/ | ||
protected $data = []; | ||
protected $data = [ 'name' => 'Not set (PHP)', 'version' => 'Not set (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.
Default package data to call out if setPackage
is not being called. Worth it to look into setting these in a constructor at some point in the future.
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.
I rather have whoever reads and pulls this data to add defaults in a transformation rather than sending "defaults" when missing or not set on every request.
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.
@lbalmaceda - Can't do a transformation without a name present. I think this will help to figure out if we have untracked entries and where they came from.
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.
On second thought ... I think you're right. This is jumping the gun on addressing untracked SDKs. I'll pull this out tomorrow, just me know if you have any other feedback.
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.
In PHP, why wouldn't you be able to ask for the PHP version?
http://php.net/manual/en/function.phpversion.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.
@cocojoe - This is the SDK version and has to be set explicitly.
'name' => $name, | ||
'version' => $version, | ||
]; | ||
$this->setEnvProperty($name, $version); |
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.
Make sure we're using the correct env
format here. Deprecated but needs to be refactored in other libs before it can be removed.
'name' => $name, | ||
'version' => $version, | ||
]; | ||
$this->setEnvProperty($name, $version); |
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.
Deprecated but make sure we're capturing the data here if it's being used anywhere else.
|
||
$oldData = $headers->get(); | ||
if (! empty( $old_headers['env'] ) && is_array( $old_headers['env'] )) { |
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.
Check for the existence of the env
key before trying to set it.
* | ||
* @return void | ||
*/ | ||
public function testThatSetEnvironmentSetsDataCorrectly() |
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.
Test for InformationHeaders:: setEnvironment()
while it's still being used.
* | ||
* @return void | ||
*/ | ||
public function testThatExtendedHeadersBuildCorrectly() |
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.
Test for dependent lib behavior (AKA: testing what broke)
* | ||
* @var array | ||
*/ | ||
protected $data = []; | ||
protected $data = [ 'name' => 'Not set (PHP)', 'version' => 'Not set (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.
I rather have whoever reads and pulls this data to add defaults in a transformation rather than sending "defaults" when missing or not set on every request.
class InformationHeaders | ||
{ | ||
|
||
/** | ||
* Default header data to send. | ||
* | ||
* @var array | ||
*/ | ||
protected $data = []; |
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.
@lbalmaceda - Fixed up!
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
env
data before extending.Reported in auth0/laravel-auth0#108
Closes #303