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

Fixes php warning when asset id (ancestor) is not found for whatever … #10998

Closed
wants to merge 1 commit into from
Closed

Conversation

regularlabs
Copy link
Contributor

@regularlabs regularlabs commented Jul 3, 2016

.

@joomla-cms-bot
Copy link

Please add more information to your issue. Without test instructions and/or any description we will close this issue within 4 weeks. Thanks.
This is an automated message from the J!Tracker Application.

@sovainfo
Copy link
Contributor

sovainfo commented Jul 3, 2016

Suggest code below instead:

if (isset(self::$assetPermissionsById[$extensionName][$id]))
{
    $collected[] = self::$assetPermissionsById[$extensionName][$id]->rules
}

Consider this a nobrainer, it fixes a rookie mistake referencing data that is unknown to exist.
Should be accepted based on code review!

@regularlabs
Copy link
Contributor Author

I prefer to use ifs for negative exceptions only (as much as possible).

So the returns/continues are inside ifs. And the code you want the thing (function/method/loop) to do is outside (under) the ifs/exceptions.

@sovainfo
Copy link
Contributor

sovainfo commented Jul 3, 2016

Noticed that, don't mind it that much, but do consider my code better to read.
The important thing is that this is accepted based on code review.

@brianteeman
Copy link
Contributor

Please add more information to your issue. Without test instructions and/or any description we will close this issue within 4 weeks. Thanks.

No reply so closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants