Refactor constructor in AttributeExist to require sOqlPropertyPath parameter

* https://github.com/Combodo/iTop/pull/857#discussion_r2993953031
This commit is contained in:
lenaick.moreira
2026-03-26 15:57:39 +01:00
parent aae6d324f9
commit be3726623f

View File

@@ -32,18 +32,14 @@ class AttributeExist extends Constraint
/**
* Constructor.
*
* @param string|null $sOqlPropertyPath
* @param string $sOqlPropertyPath
* @param string|null $sFilter
* @param array $aOptions
* @param array|null $aGroups
* @param mixed|null $oPayload
*/
public function __construct(?string $sOqlPropertyPath = null, ?string $sFilter = null, array $aOptions = [], ?array $aGroups = null, mixed $oPayload = null)
public function __construct(string $sOqlPropertyPath, ?string $sFilter = null, array $aOptions = [], ?array $aGroups = null, mixed $oPayload = null)
{
if ($sOqlPropertyPath === null) {
throw new InvalidArgumentException('The argument "sOqlPropertyPath" must be set.');
}
// Merge argument into options array
$aOptions = array_merge([
'sOqlPropertyPath' => $sOqlPropertyPath,