-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Objects] Deprecate Value Class (#26)
Co-authored-by: onairmarc <[email protected]>
- Loading branch information
Showing
4 changed files
with
22 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# v2.0.0 | ||
|
||
- Objects\Value | ||
- This class will be removed in v2.0.0. Use their function counterparts instead. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,31 @@ | ||
<?php | ||
|
||
use EncoreDigitalGroup\StdLib\Objects\Value; | ||
|
||
if (!function_exists('not_null')) { | ||
function not_null(mixed $value): bool | ||
{ | ||
return Value::notNull($value); | ||
return !is_null($value); | ||
} | ||
} | ||
|
||
if (!function_exists('val_not_null')) { | ||
/** @deprecated Use not_null() instead. */ | ||
function val_not_null(mixed $value): bool | ||
{ | ||
return Value::notNull($value); | ||
return not_null($value); | ||
} | ||
} | ||
|
||
if (!function_exists('val_transform_bool')) { | ||
/** @deprecated Use validate_bool() instead. */ | ||
function val_transform_bool(mixed $value): bool | ||
{ | ||
return Value::transformBool($value); | ||
return validate_bool($value); | ||
} | ||
} | ||
|
||
if (!function_exists('validate_bool')) { | ||
function validate_bool(mixed $value): bool | ||
{ | ||
return filter_var($value, FILTER_VALIDATE_BOOLEAN); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters