PMCORE-3853 Using array_key_exists() on objects is deprecated. Instead either isset() or property_exists() should be used.
This commit is contained in:
@@ -553,7 +553,7 @@ function upgradeContent($args, $opts)
|
||||
* Verify if we need to execute an external program for each workspace
|
||||
* If we apply the command for all workspaces, we will need to execute one by one by redefining the constants
|
||||
* @param string $args, workspaceName that we need to apply the database-upgrade
|
||||
* @param string $opts
|
||||
* @param array $opts
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
||||
@@ -68,7 +68,14 @@ class Configurations // extends Configuration
|
||||
}
|
||||
|
||||
foreach ($from as $k => $v) {
|
||||
if (isset($v) && array_key_exists($k, $object)) {
|
||||
$existKeyInObject = false;
|
||||
if (is_object($object)) {
|
||||
$existKeyInObject = property_exists($object, $k);
|
||||
}
|
||||
if (is_array($object)) {
|
||||
$existKeyInObject = array_key_exists($k, $object);
|
||||
}
|
||||
if (isset($v) && $existKeyInObject) {
|
||||
if (is_object($v)) {
|
||||
throw new Exception('Object is not permited inside configuration array.');
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ class PropelTable
|
||||
// Config attributes from XMLFORM file
|
||||
$myAttributes = get_class_vars(get_class($this));
|
||||
foreach ($this->xmlForm->xmlform->tree->attribute as $atrib => $value) {
|
||||
if (array_key_exists($atrib, $myAttributes)) {
|
||||
if (is_array($myAttributes) && array_key_exists($atrib, $myAttributes)) {
|
||||
eval('settype($value, gettype($this->' . $atrib . '));');
|
||||
if ($value !== '') {
|
||||
eval('$this->' . $atrib . '=$value;');
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user