PMCORE-3853 Using array_key_exists() on objects is deprecated. Instead either isset() or property_exists() should be used.

This commit is contained in:
Roly Gutierrez
2022-08-31 11:32:16 -04:00
parent 91638296ac
commit b8b9722374
10 changed files with 20 additions and 28 deletions

View File

@@ -722,14 +722,6 @@ class Bpmn extends Handler
public function updateEvent($evnUid, array $data)
{
/*if (array_key_exists("EVN_CANCEL_ACTIVITY", $data)) {
$data["EVN_CANCEL_ACTIVITY"] = $data["EVN_CANCEL_ACTIVITY"] ? 1 : 0;
}
if (array_key_exists("EVN_WAIT_FOR_COMPLETION", $data)) {
$data["EVN_WAIT_FOR_COMPLETION"] = $data["EVN_WAIT_FOR_COMPLETION"] ? 1 : 0;
}*/
try {
self::log("Update Event: $evnUid", "With data: ", $data);

View File

@@ -47,13 +47,13 @@ class Test extends Api
'age' => ''
);
if (array_key_exists('name', $request_data)) {
if (is_array($request_data) && array_key_exists('name', $request_data)) {
$this->data[$id]['name'] = $request_data['name'];
}
if (array_key_exists('lastname', $request_data)) {
if (is_array($request_data) && array_key_exists('lastname', $request_data)) {
$this->data[$id]['lastname'] = $request_data['lastname'];
}
if (array_key_exists('age', $request_data)) {
if (is_array($request_data) && array_key_exists('age', $request_data)) {
$this->data[$id]['age'] = $request_data['age'];
}
@@ -65,13 +65,13 @@ class Test extends Api
public function put($id, $request_data = null)
{
if (array_key_exists($id, $this->data)) {
if (array_key_exists('name', $request_data)) {
if (is_array($request_data) && array_key_exists('name', $request_data)) {
$this->data[$id]['name'] = $request_data['name'];
}
if (array_key_exists('lastname', $request_data)) {
if (is_array($request_data) && array_key_exists('lastname', $request_data)) {
$this->data[$id]['lastname'] = $request_data['lastname'];
}
if (array_key_exists('age', $request_data)) {
if (is_array($request_data) && array_key_exists('age', $request_data)) {
$this->data[$id]['age'] = $request_data['age'];
}
$this->saveData();