Releases: salient-labs/toolkit
Releases · salient-labs/toolkit
v0.99.71
Added
Utility
- Add
Filemethodsrename()andsymlink() - Add
Regex::quote()for completeness
Changed
Utility
- Improve
Regexpattern consistency and readability - Add non-capturing groups to
Regexpatterns as needed for atomicity and to limit the scope of case sensitivity changes - Don't match leading and trailing whitespace in
RegexpatternsBOOLEAN_STRINGandINTEGER_STRING
Removed
Utility
- Remove unused
RegexpatternsPHP_UNION_TYPE,PHP_INTERSECTION_TYPE,PHP_DNF_SEGMENT,PHP_DNF_TYPEandPHP_FULL_TYPE
Security
Utility
- Apply umask by default in
File::create()andcreateDir()
v0.99.70
Changed
- Adopt
ReflectionClass<*>instead ofReflectionClass<object>to work aroundTnot being covariant on PHPStan 2.1.2 + PHP 8.4
Polyfill
- Remove dependency on
salient/utils
Fixed
Polyfill
- Fix issue where
PhpTokendoesn't tokenize binary strings likeb"$foo"correctly - Fix issue where
PhpTokenfails ifsalient/sliis not installed
Security
Utility
- Optionally honour umask in
File::create()andcreateDir()
v0.99.69
Added
Utility
- Add
File::createTemp()for completeness
Changed
Utility
- Rename
File::getCleanDir()tosanitiseDir() - In
File, remove resource type checks in favour of upstream exceptions
Fixed
Utility
- Fix issue where
File::createTempDir()consumes full CPU indefinitely if given a directory that is not writable (or not a directory)
Security
Utility
- In
File::create()andcreateDir():- Change default permissions from
0777to0755 - Use umask
0077to prevent access by an attacker before permissions are applied - In
create(), open files with mode'x'instead of usingtouch()to create them
- Change default permissions from
v0.99.68
Added
PHPStan
- Add
HasMutatorReadWritePropertiesExtensionto resolve errors likeproperty.unusedandproperty.unusedTypein classes that insertHasMutator
Sync
- Add
SyncUtil::getServicedEntityType()
Changed
Sync
-
In
SyncEntityProvider, resolve custom entity types to base entities serviced by the provider if necessaryThis change means sync operations performed on a
$providervia$provider->with(<entity>::class)are resolved against a parent of<entity>if:$providerdoesn't service<entity>but does service one of its non-abstract parents, and- the service container resolves that parent to
<entity>
v0.99.67
v0.99.66
v0.99.65
Added
Collection
- Add and implement
isEmpty() - Add PHPStan assertions that narrow the return types of
all(),first()andlast()when a collection is non-empty
Changed
Utility
- Accept
ReflectionConstantinReflect::getNames()
Fixed
Utility
- Fix issue where
Get::code()may not match the longest possible string in$constants, generating output like"Type::PROPERTY . '_HOOK'"instead of"Type::PROPERTY_HOOK"
v0.99.64
Changed
Collection
- Move
ListInterfacemethods toCollectionInterface - Use PHPStan conditional parameter types to vary
forEach(),map(),filter()andfind()callback signatures by$mode - Return a modified instance from collection methods that previously operated on a single instance:
set()unset()add()merge()pop()shift()
- Adopt
iterableas return type for protectedgetItems()andfilterItems()methods - In list collections, silently replace invalid keys instead of throwing an exception
- Replace
AbstractTypedCollectionandCollectionwith non-finalCollection - Replace
AbstractTypedListandListCollectionwith non-finalListCollection - Rename:
ListTrait->ListCollectionTraitReadableCollectionTrait->ReadOnlyCollectionTrait
- Rename
ImmutableArrayAccessTraittoReadOnlyArrayAccessTraitand move it back to theCollectionnamespace
Http
- Rename
HttpHeadersInterface::add()toappend()to resolve conflict withCollectionInterface::add() - In
HttpHeaders:- Implement methods added to
CollectionInterface - Replace
generateItems()withgetItems()now that theReadOnlyCollectionTraitmethod can returniterable - Implement
CollectionInterface::map()
- Implement methods added to
Utility
- Update
Debug::getCaller()to work with PHP 8.4's backtrace changes
Removed
Collection
- Remove
ListInterface - Remove "immutable" collections and traits:
ImmutableCollectionImmutableCollectionTraitImmutableListCollectionImmutableListTrait
- Remove redundant collection methods
empty()andcopy()
Core
- Remove
ImmutableArrayAccessTrait(moved toCollectioncomponent asReadOnlyArrayAccessTrait)
Fixed
Collection
- Fix issue where numeric keys are reindexed when
shift()is called on a collection
Core
- Remove references to
E_STRICTconstant (deprecated in PHP 8.4)
v0.99.63
v0.99.62
Added
PHPDoc
- Add
PHPDoc::getClassTemplates()
Changed
Container
- Require
Application::startSync()arguments to be strings
Core
- Require new keys passed to
SerializeRulesInterfaceto be strings - In
HasBuildertrait:- Use
selfinstead ofstaticto derivegetBuilder()return value - Remove
finalfrom method declarations to allow reinsertion by subclasses
- Use
Iterator
- Update return type of
FluentIteratorInterface::nextWithValue()to indicateTValuemust be an object or array - In
FluentIteratorTrait::nextWithValue(), remove special handling ofArrayAccessobjects - In
RecursiveFilesystemIterator::nextWithValue(), don't reject keys that resolve togetFileInfo()orgetPathInfo()
PHPDoc
- Rename
PHPDoc::getTemplatesForTag()togetTagTemplates()
Sli
- In
generate builder:- Include constructor templates in declared methods if they appear in the relevant parameter type
- Preserve original template names if possible
Utility
- Improve
Arr::wrap()andArr::wrapList()return type annotations
Fixed
Container
- Fix issue where fallback arguments passed to the entity store may not be not strings
Utility
- Fix
File::isSeekableStream()andFile::isStream()assertions