v0.21.10
Added
- Add
Str::coalesce() - Add
Arr::sameValues() - Add
RecursiveFilesystemIterator::count() - Add
Builder::unsetB()
Changed
- In
Buildermethods, only return a clone if a value is changed - Rename
ProvidesBuilderinterface toBuildableand consolidate extended interfaces, reverting needlessly complicated split - Add default implementation of
Buildable::getBuilder()toHasBuildertrait and remove boilerplate code from classes that use it - Allow assertions in
Assertto throw a given exception - Clean up and rename
Convert::toBoolOrNull()andtoIntOrNull()totoBool()andtoInt() - Clean up
Envand adoptPcre::*methods - Tolerate whitespace around boolean and integer values in environment variables
- Clean up abstract enumeration and dictionary classes
Cli:
- Add
CliOption::$Name- Primarily for
*_POSITIONALoptions, but others can use it too - Takes the value of
CliOption::$Longif not set explicitly - Positional options are not permitted to apply different values to
CliOption::$NameandCliOption::$Long
- Primarily for
- Add
CliOption::$IsBoundtrueif the option is bound to a variable via constructor parameter$bindTo- Prevents propagation of normalised values into the option's scope
- Add
CliOption::$Unique - Implement case-insensitive
ONE_OF_*value matching
Removed
- Remove support for extending default and/or environment values via
CliOption::$KeepDefaultandCliOption::$KeepEnv - Remove unused
Convert::emptyToNull()method - Remove
ResolvesBuilder,ReturnsBuilder,ReturnsBuilderServiceinterfaces
Fixed
Env: fix issue where negative integers are rejectedCli: add explicit checks fornull,''and[]to prevent issues with "falsey" values like"0"- Fix
Introspectorissues:- Detect constructor parameters that have a default value but are not nullable, and throw an exception if
nullis passed to them, e.g. from a builder - Determine minimum number of arguments to pass to a constructor and suppress unnecessary arguments, e.g. so classes can rely on
func_num_args()to detect variables passed by reference
- Detect constructor parameters that have a default value but are not nullable, and throw an exception if