Releases: salient-labs/toolkit
Releases · salient-labs/toolkit
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
v0.99.61
Added
PHPDoc
- Add support for
@propertytags and their-read/-writevariants - Add and adopt
PHPDocfactory methods:forClass(),forMethod(),forProperty(),forConstant()
Sli
- Add PHPDoc descriptions and "magic" properties and methods to
AnalyseClassoutput
Changed
Console
- Simplify
ConsoleWriter::exception()output
PHPDoc
- Add an
ErrorTagto thePHPDocinstead of throwing an exception when an invalid tag is encountered - Close unterminated code fences instead of throwing an exception
- Expand aliases (optionally passed to
PHPDoc::__construct()) when parsing DocBlocks - In
PHPDoc::normalise(), if the PHPDoc has one@vartag with the same name as the property the instance is associated with, remove the name from the tag - Allow
@method,@property*and@mixintags to be inherited from interfaces and traits by classes - Don't return one-line DocBlocks from
PHPDoc::__toString() - Don't inherit specialised
@templatetags - Rename
PHPDocUtil::getParameterPHPDoc()togetParameterTag() - Handle
@templatevariance via boolean values instead of a string - Improve consistency of tag constructors
PHPStan
- Add property visibility check to
HasMutatorrule
Sli
In AnalyseClass:
- Catch and report PHPDoc errors
- Suppress inherited summaries and descriptions
- Improve Markdown output
- Propagate imports to
PHPDocfor type expansion
Fixed
PHPDoc
- Fix regression where DocBlocks with default values in
@methodparameters trigger an exception