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

Refactor1.0 #94

Merged
merged 91 commits into from
Aug 22, 2016
Merged

Refactor1.0 #94

merged 91 commits into from
Aug 22, 2016

Conversation

dlsteuer
Copy link
Contributor

@brianr @coryvirok this is quite a big change, so will need some careful review

private function setAccessToken($c)
{
if (isset($_ENV['ROLLBAR_ACCESS_TOKEN']) && !isset($config['access_token'])) {
$config['access_token'] = $_ENV['ROLLBAR_ACCESS_TOKEN'];
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like a little bit of variable confusion here. Param in the function is $c, but here and in the conditional we're checking for $config.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @chrisbarmonde fixed with a test now.

@chrisbarmonde
Copy link
Contributor

chrisbarmonde commented Aug 16, 2016

Well that's about as useful as I'm gonna be. I will say, in my time with PHP, I found it was almost always better to just use empty as opposed to isset or is_null. I feel like in 99.999% of cases, you just care whether the object exists or not (which includes it not being null already). And so if you don't think you'll get a null and you only use isset and then someone inevitably submits a null, you end up with problems. They have a big ol' table with what each of the different functions returns here: https://php.net/manual/en/types.comparisons.php

@dlsteuer
Copy link
Contributor Author

with the whole empty vs isset you have to really assess what empty means at the comparison point, for example "0" is that empty or not in the particular case where you are testing.

@dlsteuer dlsteuer merged commit 7b21897 into master Aug 22, 2016
@jessewgibbs jessewgibbs deleted the refactor1.0 branch January 6, 2017 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants