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

[REF][PHP8.2] Avoid dynamic properties in civicrm_api3 class #25253

Merged
merged 1 commit into from
Jan 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 84 additions & 1 deletion api/class.api.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,89 @@
*/
class civicrm_api3 {

/**
* Are we performing a local or remote API call?
*
* @var bool
*/
public $local = TRUE;

/**
* Array of inputs to pass to `call`, if param not passed directly
*
* @var array
* @internal
*/
public $input = [];

/**
* Holds the result of the last API request.
* If the request has not yet run, lastResult will be empty.
*
* @var \stdClass
* @internal
*/
public $lastResult;

/**
* When making a remote API request,
* $uri will be the path to the remote server's API endpoint
*
* @var string|null
* @internal
*/
public $uri = NULL;

/**
* When making a remote API request,
* $key will be sent as part of the request
*
* @var string|null
* @internal
*/
public $key = NULL;

/**
* When making a remote API request,
* $api_key will be sent as part of the request
*
* @var string|null
* @internal
*/
public $api_key = NULL;

/**
* When making a remote API request,
* $referer holds the Referer header value to be sent as part of the request
*
* @var string|null
* @internal
*/
public $referer = NULL;

/**
* When making a remote API request,
* $useragent holds the User-Agent header value to be sent as part of the request
*
* @var string|null
* @internal
*/
public $useragent = NULL;

/**
* Reference to the CRM_Core_Config singleton
*
* @var CRM_Core_Config
*/
protected $cfg;

/**
* The current entity, which actions should be performed against
*
* @var string|null
*/
protected $currentEntity = NULL;

/**
* Class constructor.
*
Expand All @@ -97,7 +180,7 @@ class civicrm_api3 {
public function __construct($config = NULL) {
$this->local = TRUE;
$this->input = [];
$this->lastResult = [];
$this->lastResult = new stdClass();
if (!empty($config) && !empty($config['server'])) {
// we are calling a remote server via REST
$this->local = FALSE;
Expand Down