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

dev/core#1188 Fix API v3 error Class or interface CiviCRM_API3_Exception does not exist #15043

Merged

Conversation

prondubuisi
Copy link
Contributor

@prondubuisi prondubuisi commented Aug 15, 2019

Overview

Static analysis tool Psalm reveals the above error, this is an attempt to fix it as a proof of concept that Psalm errors within civi-core can actually be fixed

Before

Psalm autoloader cannot find CiviCRM_API3_Exception

After

Autoloader can find CiviCRM_API3_Exception

Technical Details

This is not a problem with runtime php because the API_Exception is invariably thrown before the CiviCRM_API3_Exception and since they are both in the same file the require_once for API_Exception also covers CiviCRM_API3_Exception. However, for static code analysers (like Psalm) the processing order is not driven by the order of runtime events

Comments

@civicrm-builder
Copy link

Can one of the admins verify this patch?

@civibot
Copy link

civibot bot commented Aug 15, 2019

(Standard links)

@seamuslee001
Copy link
Contributor

add to whitelist

@eileenmcnaughton
Copy link
Contributor

@seamuslee001 I'm ready to merge this - do you have any hesitation?

@eileenmcnaughton
Copy link
Contributor

I'm merging this as it is constrained to one class which is 'special' and is safe IMHO

@eileenmcnaughton eileenmcnaughton merged commit a596705 into civicrm:master Aug 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants