Lines Matching refs:value

11      * The property name when the type value is persisted
56 * The constant value
96 throw new ExceptionBadArgument("The value passed is not a numeric/nor a string. We can not translate it to an integer. Value: $varExport");
111 throw new ExceptionBadArgument("The value ($targetValue) can not be cast to an integer.");
126 public static function toBoolean($value, $ifNull = null)
128 if ($value === null) return $ifNull;
129 return filter_var($value, FILTER_VALIDATE_BOOLEAN);
133 * @throws ExceptionBadArgument - if the value is not a numeric
135 public static function toFloat($value): float
137 if (is_float($value)) {
138 return $value;
141 if (!is_numeric($value)) {
142 throw new ExceptionBadArgument("The value ($value) is not a numeric");
145 return floatval($value);
148 public static function toBooleanString(?bool $value): ?string
150 if ($value === null) {
153 if ($value) {
161 * @param mixed|null $value
162 * @return bool - true if the value is built-in boolean or null
164 public static function isBoolean($value): bool
166 return is_bool($value);
171 * ie (the true boolean value is not printed as `1` but `true`)
172 * @param $value
175 public static function toString($value)
177 if ($value === null) {
180 if (is_string($value)) {
181 return $value;
183 if (is_array($value)) {
184 return ArrayUtility::formatAsString($value);
186 if (is_object($value)) {
187 return $value->__toString();
189 if (is_bool($value)) {
190 return var_export($value, true);
192 return strval($value);
195 public static function getType($value): string
197 if (is_string($value)) {
200 if (is_array($value)) {
203 if (is_object($value)) {
204 return "object (" . get_class($value) . ")";
206 return gettype($value);
219 public static function isObject($value): bool
221 return is_object($value);