* @return mixed
*/
public function getVar($name) {
- if (!empty(ReflectionUtils::getCodeDocs((new ReflectionProperty($this, $name)), 'Property')['deprecated'])) {
- CRM_Core_Error::deprecatedWarning('deprecated property accessed :' . $name);
+ try {
+ if (!empty(ReflectionUtils::getCodeDocs((new ReflectionProperty($this, $name)), 'Property')['deprecated'])) {
+ CRM_Core_Error::deprecatedWarning('deprecated property accessed :' . $name);
+ }
+ }
+ catch (\ReflectionException $e) {
+ // If the variable isn't defined you can't access its properties to check if it's deprecated. Let php 8.2 deal with those warnings.
}
// @todo - add warnings for internal properties & protected properties.
return $this->$name;