Repository navigation
A major release: the package requires PHP 8.3 and drops two traits. Read Upgrading below before updating.
Changed
- Requires PHP 8.3 or later (PHP 8.2 is no longer maintained). CI runs on PHP 8.3 and 8.4, with Laravel 12 and 13.
declare(strict_types=1)in every file. A scalar of the wrong type passed to a typed parameter of this package now throws aTypeErrorinstead of being converted. The package has many untyped parameters, which keep accepting what they accepted.- Return types on public methods, added where the code returns a single type:
isApproved(): bool,isReply(): bool,hasReplies(): bool,hasTerm(): bool,getAvatarAttribute(): string,getKeywordsStrAttribute(): string,getFormat(): string|array|false,createModel(): object,__toString(): stringand others. A model that overrides one of them with another return type must be updated. - Declared dependencies match what the code uses:
illuminate/contractsandnesbot/carbonare required,illuminate/filesystemis not (nothing used it), andfakerphp/fakeris a development dependency (only the test factories use it). PasswordServicedeclares its$hasherproperty: creating it dynamically is deprecated since PHP 8.2.Post::getImageAttribute()is documented asstring|nulland returnsnullexplicitly when the post has no thumbnail (same value as before);getPostInstance()andnewFromBuilder()are documented as returningstatic.- The models declare the columns and relations the code reads with
@propertytags, for static analysis. - The package is checked by the Pollora harness: every gate blocks a merge (code style, PHPStan with a baseline of 52 reports that can only go down, Rector, dependency analysis, security patterns, public surface, tests).
Removed
Pollora\Colt\Concerns\AdvancedCustomFields: deprecated, it relied on aPollora\Colt\Acf\AdvancedCustomFieldsclass that was never part of the package and threw aLogicException. Read ACF values withget_field()or through the model's meta.Pollora\Colt\Laravel\Auth\ResetsPasswords: the trait that stored a reset password with WordPress's hashing. A controller that used it must hash the password itself withPollora\Colt\Services\PasswordService::makeHash()and save theuser_passof the user.
Upgrading
- Run PHP 8.3 or later.
- Remove
use AdvancedCustomFieldsanduse ResetsPasswordsfrom your classes. - If you override one of the methods listed under "Return types", give it a compatible return type.
- Run your tests: a
TypeErrorpoints at a call that relied on a scalar being converted.