Browse Source

Fix up PHPStan issues.

mscherer 3 years ago
parent
commit
c84cd005d6

+ 1 - 1
src/Model/Behavior/JsonableBehavior.php

@@ -240,7 +240,7 @@ class JsonableBehavior extends Behavior {
 			return $val;
 		}
 
-		$flags = JSON_THROW_ON_ERROR | $this->_config['decodeParams']['options'];
+		$flags = $this->_config['decodeParams']['options'];
 		$decoded = json_decode($val, $this->_config['decodeParams']['assoc'], $this->_config['decodeParams']['depth'], $flags);
 
 		if ($decoded === false) {

+ 2 - 2
src/Model/Behavior/PasswordableBehavior.php

@@ -435,10 +435,10 @@ class PasswordableBehavior extends Behavior {
 			return true;
 		}
 
-		$primaryKey = $context['data'][$primaryKey];
+		$primaryKeyValue = $context['data'][$primaryKey];
 		$value = $context['data'][$context['field']];
 
-		$dbValue = $this->_table->find()->where([$this->_table->getAlias() . '.' . $primaryKey => $primaryKey])->first();
+		$dbValue = $this->_table->find()->where([$this->_table->getAlias() . '.' . $primaryKey => $primaryKeyValue])->first();
 		if (!$dbValue) {
 			return true;
 		}