\Apigee\ManagementAPI\DeveloperApp::loadByAppId() should not return a CompanyApp #80
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Besides this is a bad practice it also brakes \Apigee\ManagementAPI\AbstractApp::loadFromResponse() call if an app is a company app. In that case, this method is unable to fill in its first argument's properties from the API response. This is the reason why you had to grab the returned value of the loadByAppId() in the \ApigeeCompanyAppController::delete() in the Apigee Developer Portal's code base, because $dev_app0's properties remain empty.
After applying this fix you'll probably fix some calls on the portal where you have relied on this bad implementation. For example in this delete() call I'd check whether the app is a company app if it is, I'd delete it as a company app, otherwise as a simple developer app.