From bb8076a09d89c50ade5fbbc03b9fa471853bf6b6 Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Wed, 17 Jan 2024 14:59:56 +0100 Subject: [PATCH] `var_export()` expects #param 2 to be bool --- application/controllers/SelfServiceController.php | 2 +- library/Director/Core/RestApiResponse.php | 2 +- library/Director/CustomVariable/CustomVariable.php | 2 +- library/Director/CustomVariable/CustomVariableBoolean.php | 2 +- library/Director/CustomVariable/CustomVariableNull.php | 2 +- library/Director/CustomVariable/CustomVariableNumber.php | 2 +- library/Director/Data/Db/DbDataFormatter.php | 2 +- library/Director/Data/Db/DbObject.php | 2 +- library/Director/Data/PropertyMangler.php | 4 ++-- library/Director/Db/Branch/Branch.php | 2 +- library/Director/Db/IcingaObjectFilterHelper.php | 2 +- library/Director/DirectorObject/Automation/BasketSnapshot.php | 2 +- library/Director/IcingaConfig/IcingaConfigHelper.php | 2 +- library/Director/Import/SyncUtils.php | 2 +- library/Director/Objects/DirectorDatalistEntry.php | 2 +- library/Director/Objects/IcingaObjectGroups.php | 2 +- library/Director/Objects/IcingaObjectMultiRelations.php | 2 +- library/Director/Objects/IcingaRelatedObject.php | 2 +- library/Director/Objects/IcingaTemplateChoice.php | 2 +- library/Director/PlainObjectRenderer.php | 2 +- .../Director/PropertyModifier/PropertyModifierArrayFilter.php | 2 +- .../PropertyModifier/PropertyModifierExtractFromDN.php | 2 +- .../PropertyModifier/PropertyModifierRejectOrSelect.php | 2 +- library/Director/RestApi/RestApiClient.php | 2 +- library/Director/Web/Form/Element/ExtensibleSet.php | 2 +- library/Director/Web/Form/IplElement/ExtensibleSetElement.php | 4 ++-- library/Director/Web/Table/BasketSnapshotTable.php | 2 +- 27 files changed, 29 insertions(+), 29 deletions(-) diff --git a/application/controllers/SelfServiceController.php b/application/controllers/SelfServiceController.php index 0b3b642f..6479a298 100644 --- a/application/controllers/SelfServiceController.php +++ b/application/controllers/SelfServiceController.php @@ -194,7 +194,7 @@ class SelfServiceController extends ActionController } else { throw new ProgrammingError( 'Expected boolean value, got %s', - var_export($value, 1) + var_export($value, true) ); } } diff --git a/library/Director/Core/RestApiResponse.php b/library/Director/Core/RestApiResponse.php index 523ed35b..43516f7e 100644 --- a/library/Director/Core/RestApiResponse.php +++ b/library/Director/Core/RestApiResponse.php @@ -113,7 +113,7 @@ class RestApiResponse throw new IcingaException('API request failed: ' . $result->status); } } else { - throw new IcingaException('API request failed: ' . var_export($result, 1)); + throw new IcingaException('API request failed: ' . var_export($result, true)); } } diff --git a/library/Director/CustomVariable/CustomVariable.php b/library/Director/CustomVariable/CustomVariable.php index 98eda84d..4b5dd3e4 100644 --- a/library/Director/CustomVariable/CustomVariable.php +++ b/library/Director/CustomVariable/CustomVariable.php @@ -236,7 +236,7 @@ abstract class CustomVariable implements IcingaConfigRenderer // TODO: check for specific class/stdClass/interface? return new CustomVariableDictionary($key, $value); } else { - throw new LogicException(sprintf('WTF (%s): %s', $key, var_export($value, 1))); + throw new LogicException(sprintf('WTF (%s): %s', $key, var_export($value, true))); } } diff --git a/library/Director/CustomVariable/CustomVariableBoolean.php b/library/Director/CustomVariable/CustomVariableBoolean.php index 9953fae7..750f1d66 100644 --- a/library/Director/CustomVariable/CustomVariableBoolean.php +++ b/library/Director/CustomVariable/CustomVariableBoolean.php @@ -31,7 +31,7 @@ class CustomVariableBoolean extends CustomVariable if (! is_bool($value)) { throw new ProgrammingError( 'Expected a boolean, got %s', - var_export($value, 1) + var_export($value, true) ); } diff --git a/library/Director/CustomVariable/CustomVariableNull.php b/library/Director/CustomVariable/CustomVariableNull.php index f87ccfaf..83e07f03 100644 --- a/library/Director/CustomVariable/CustomVariableNull.php +++ b/library/Director/CustomVariable/CustomVariableNull.php @@ -31,7 +31,7 @@ class CustomVariableNull extends CustomVariable if (! is_null($value)) { throw new ProgrammingError( 'Null can only be null, got %s', - var_export($value, 1) + var_export($value, true) ); } diff --git a/library/Director/CustomVariable/CustomVariableNumber.php b/library/Director/CustomVariable/CustomVariableNumber.php index 62838a92..7b0c3e91 100644 --- a/library/Director/CustomVariable/CustomVariableNumber.php +++ b/library/Director/CustomVariable/CustomVariableNumber.php @@ -47,7 +47,7 @@ class CustomVariableNumber extends CustomVariable if (! is_int($value) && ! is_float($value)) { throw new ProgrammingError( 'Expected a number, got %s', - var_export($value, 1) + var_export($value, true) ); } diff --git a/library/Director/Data/Db/DbDataFormatter.php b/library/Director/Data/Db/DbDataFormatter.php index e06af69b..91fc7761 100644 --- a/library/Director/Data/Db/DbDataFormatter.php +++ b/library/Director/Data/Db/DbDataFormatter.php @@ -20,7 +20,7 @@ class DbDataFormatter throw new InvalidArgumentException(sprintf( 'Got invalid boolean: %s', - var_export($value, 1) + var_export($value, true) )); } diff --git a/library/Director/Data/Db/DbObject.php b/library/Director/Data/Db/DbObject.php index e22b8ff0..114b61b9 100644 --- a/library/Director/Data/Db/DbObject.php +++ b/library/Director/Data/Db/DbObject.php @@ -984,7 +984,7 @@ abstract class DbObject $this->table, $this->getLogId(), $e->getMessage(), - var_export($this->getProperties(), 1) // TODO: Remove properties + var_export($this->getProperties(), true) // TODO: Remove properties )); } diff --git a/library/Director/Data/PropertyMangler.php b/library/Director/Data/PropertyMangler.php index a457f1df..40b25704 100644 --- a/library/Director/Data/PropertyMangler.php +++ b/library/Director/Data/PropertyMangler.php @@ -19,7 +19,7 @@ class PropertyMangler throw new InvalidArgumentException(sprintf( 'I can only append to arrays, %s is %s', $key, - var_export($current, 1) + var_export($current, true) )); } @@ -52,7 +52,7 @@ class PropertyMangler throw new InvalidArgumentException(sprintf( 'I can only remove strings or from arrays, %s is %s', $key, - var_export($current, 1) + var_export($current, true) )); } } diff --git a/library/Director/Db/Branch/Branch.php b/library/Director/Db/Branch/Branch.php index 00748ad6..c99b1bdd 100644 --- a/library/Director/Db/Branch/Branch.php +++ b/library/Director/Db/Branch/Branch.php @@ -45,7 +45,7 @@ class Branch $row->uuid = stream_get_contents($row->uuid); } if (strlen($row->uuid) !== 16) { - throw new RuntimeException('Valid UUID expected, got ' . var_export($row->uuid, 1)); + throw new RuntimeException('Valid UUID expected, got ' . var_export($row->uuid, true)); } $self->branchUuid = Uuid::fromBytes(Db\DbUtil::binaryResult($row->uuid)); $self->name = $row->branch_name; diff --git a/library/Director/Db/IcingaObjectFilterHelper.php b/library/Director/Db/IcingaObjectFilterHelper.php index 87f1cc5a..2d9f8f37 100644 --- a/library/Director/Db/IcingaObjectFilterHelper.php +++ b/library/Director/Db/IcingaObjectFilterHelper.php @@ -31,7 +31,7 @@ class IcingaObjectFilterHelper throw new InvalidArgumentException(sprintf( 'Numeric ID or IcingaObject expected, got %s', // TODO: just type/class info? - var_export($id, 1) + var_export($id, true) )); } } diff --git a/library/Director/DirectorObject/Automation/BasketSnapshot.php b/library/Director/DirectorObject/Automation/BasketSnapshot.php index bce55dcb..9638e492 100644 --- a/library/Director/DirectorObject/Automation/BasketSnapshot.php +++ b/library/Director/DirectorObject/Automation/BasketSnapshot.php @@ -410,7 +410,7 @@ class BasketSnapshot extends DbObject try { JsonString::encode($object); } catch (JsonEncodeException $singleError) { - $dump = var_export($object, 1); + $dump = var_export($object, true); if (function_exists('iconv')) { $dump = iconv('UTF-8', 'UTF-8//IGNORE', $dump); } diff --git a/library/Director/IcingaConfig/IcingaConfigHelper.php b/library/Director/IcingaConfig/IcingaConfigHelper.php index 03c017ee..634337f0 100644 --- a/library/Director/IcingaConfig/IcingaConfigHelper.php +++ b/library/Director/IcingaConfig/IcingaConfigHelper.php @@ -177,7 +177,7 @@ class IcingaConfigHelper throw new InvalidArgumentException(sprintf( 'Unexpected type %s', - var_export($value, 1) + var_export($value, true) )); } diff --git a/library/Director/Import/SyncUtils.php b/library/Director/Import/SyncUtils.php index 5528b2de..c106c20b 100644 --- a/library/Director/Import/SyncUtils.php +++ b/library/Director/Import/SyncUtils.php @@ -99,7 +99,7 @@ class SyncUtils throw new InvalidArgumentException(sprintf( 'Data is not nested, cannot access %s: %s', $var, - var_export($row, 1) + var_export($row, true) )); } diff --git a/library/Director/Objects/DirectorDatalistEntry.php b/library/Director/Objects/DirectorDatalistEntry.php index 086686a5..278de97f 100644 --- a/library/Director/Objects/DirectorDatalistEntry.php +++ b/library/Director/Objects/DirectorDatalistEntry.php @@ -51,7 +51,7 @@ class DirectorDatalistEntry extends DbObject } else { throw new RuntimeException( 'Expected array or null for allowed_roles, got %s', - var_export($roles, 1) + var_export($roles, true) ); } } diff --git a/library/Director/Objects/IcingaObjectGroups.php b/library/Director/Objects/IcingaObjectGroups.php index f4288310..8683c778 100644 --- a/library/Director/Objects/IcingaObjectGroups.php +++ b/library/Director/Objects/IcingaObjectGroups.php @@ -228,7 +228,7 @@ class IcingaObjectGroups implements Iterator, Countable, IcingaConfigRenderer } else { throw new RuntimeException( 'Invalid group object: %s', - var_export($group, 1) + var_export($group, true) ); } diff --git a/library/Director/Objects/IcingaObjectMultiRelations.php b/library/Director/Objects/IcingaObjectMultiRelations.php index a1ec9a2c..59315958 100644 --- a/library/Director/Objects/IcingaObjectMultiRelations.php +++ b/library/Director/Objects/IcingaObjectMultiRelations.php @@ -239,7 +239,7 @@ class IcingaObjectMultiRelations implements Iterator, Countable, IcingaConfigRen } else { throw new ProgrammingError( 'Invalid related object: %s', - var_export($relation, 1) + var_export($relation, true) ); } diff --git a/library/Director/Objects/IcingaRelatedObject.php b/library/Director/Objects/IcingaRelatedObject.php index d35bcb0b..ca33688a 100644 --- a/library/Director/Objects/IcingaRelatedObject.php +++ b/library/Director/Objects/IcingaRelatedObject.php @@ -180,7 +180,7 @@ class IcingaRelatedObject } else { throw new ProgrammingError( 'Related object can be name or object, got: %s', - var_export($related, 1) + var_export($related, true) ); } diff --git a/library/Director/Objects/IcingaTemplateChoice.php b/library/Director/Objects/IcingaTemplateChoice.php index 572a9959..a2be07ae 100644 --- a/library/Director/Objects/IcingaTemplateChoice.php +++ b/library/Director/Objects/IcingaTemplateChoice.php @@ -225,7 +225,7 @@ class IcingaTemplateChoice extends IcingaObject implements ExportInterface } else { throw new ProgrammingError( 'Expected array or null for allowed_roles, got %s', - var_export($roles, 1) + var_export($roles, true) ); } } diff --git a/library/Director/PlainObjectRenderer.php b/library/Director/PlainObjectRenderer.php index 4dadf4f4..e613f1f9 100644 --- a/library/Director/PlainObjectRenderer.php +++ b/library/Director/PlainObjectRenderer.php @@ -105,7 +105,7 @@ class PlainObjectRenderer } elseif (is_string($object)) { return self::renderString($object); } else { - return '(UNKNOWN TYPE) ' . var_export($object, 1); + return '(UNKNOWN TYPE) ' . var_export($object, true); } } diff --git a/library/Director/PropertyModifier/PropertyModifierArrayFilter.php b/library/Director/PropertyModifier/PropertyModifierArrayFilter.php index 0b52987e..a8fcbf71 100644 --- a/library/Director/PropertyModifier/PropertyModifierArrayFilter.php +++ b/library/Director/PropertyModifier/PropertyModifierArrayFilter.php @@ -116,7 +116,7 @@ class PropertyModifierArrayFilter extends PropertyModifierHook default: throw new ConfigurationError( '%s is not a valid value for an ArrayFilter filter_method', - var_export($method, 1) + var_export($method, true) ); } diff --git a/library/Director/PropertyModifier/PropertyModifierExtractFromDN.php b/library/Director/PropertyModifier/PropertyModifierExtractFromDN.php index c79c5b2b..6b0651dc 100644 --- a/library/Director/PropertyModifier/PropertyModifierExtractFromDN.php +++ b/library/Director/PropertyModifier/PropertyModifierExtractFromDN.php @@ -74,7 +74,7 @@ class PropertyModifierExtractFromDN extends PropertyModifierHook default: throw new InvalidPropertyException( 'DN part extraction failed for %s', - var_export($value, 1) + var_export($value, true) ); } } diff --git a/library/Director/PropertyModifier/PropertyModifierRejectOrSelect.php b/library/Director/PropertyModifier/PropertyModifierRejectOrSelect.php index 1485d5d4..04c49c57 100644 --- a/library/Director/PropertyModifier/PropertyModifierRejectOrSelect.php +++ b/library/Director/PropertyModifier/PropertyModifierRejectOrSelect.php @@ -128,7 +128,7 @@ class PropertyModifierRejectOrSelect extends PropertyModifierHook default: throw new ConfigurationError( '%s is not a valid value for an ArrayFilter filter_method', - var_export($method, 1) + var_export($method, true) ); } diff --git a/library/Director/RestApi/RestApiClient.php b/library/Director/RestApi/RestApiClient.php index 2ebc4d47..562e393a 100644 --- a/library/Director/RestApi/RestApiClient.php +++ b/library/Director/RestApi/RestApiClient.php @@ -287,7 +287,7 @@ class RestApiClient if ($statusCode >= 400) { throw new RuntimeException( - "Got $statusCode: " . \var_export($res, 1) + "Got $statusCode: " . \var_export($res, true) ); } diff --git a/library/Director/Web/Form/Element/ExtensibleSet.php b/library/Director/Web/Form/Element/ExtensibleSet.php index f3c968fc..e443b06d 100644 --- a/library/Director/Web/Form/Element/ExtensibleSet.php +++ b/library/Director/Web/Form/Element/ExtensibleSet.php @@ -28,7 +28,7 @@ class ExtensibleSet extends FormElement if (! is_array($value)) { throw new InvalidArgumentException(sprintf( 'ExtensibleSet expects to work with Arrays, got %s', - var_export($value, 1) + var_export($value, true) )); } $value = array_filter($value, 'strlen'); diff --git a/library/Director/Web/Form/IplElement/ExtensibleSetElement.php b/library/Director/Web/Form/IplElement/ExtensibleSetElement.php index 5df4983e..b723d47c 100644 --- a/library/Director/Web/Form/IplElement/ExtensibleSetElement.php +++ b/library/Director/Web/Form/IplElement/ExtensibleSetElement.php @@ -111,7 +111,7 @@ class ExtensibleSetElement extends BaseHtmlElement if (null !== $value && ! is_array($value)) { throw new ProgrammingError( 'Got unexpected value, no array: %s', - var_export($value, 1) + var_export($value, true) ); } @@ -325,7 +325,7 @@ class ExtensibleSetElement extends BaseHtmlElement } else { return \sprintf( $this->translate('%s (not an Array!)'), - \var_export($this->inherited, 1) + \var_export($this->inherited, true) ); } } diff --git a/library/Director/Web/Table/BasketSnapshotTable.php b/library/Director/Web/Table/BasketSnapshotTable.php index 08f808ab..72a855ca 100644 --- a/library/Director/Web/Table/BasketSnapshotTable.php +++ b/library/Director/Web/Table/BasketSnapshotTable.php @@ -67,7 +67,7 @@ class BasketSnapshotTable extends ZfQueryBasedTable if (! is_object($summary) && ! is_array($summary)) { throw new RuntimeException(sprintf( 'Got invalid basket summary: %s ', - var_export($summary, 1) + var_export($summary, true) )); }