Repository navigation
2.5.0 #1114
mglaman
announced in
Announcements
2.5.0
#1114
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Upgrading
This release reports new errors by default, and changes the class name in some existing ones. If your project has a PHPStan baseline, regenerate it after upgrading:
The changes behind that:
trustedCallbacks()are reported. See "Render callbacks".@FieldTypeannotations are reported as deprecated.Entity storage types
A storage typed with a broad interface, like
RevisionableStorageInterfaceorSqlEntityStorageInterface, resolved to the first entity type in the mapping. That was usuallyBlockContentorBlock, whatever the storage really held. Now it resolves to the base interface every matching entity type shares:load()returnsNodeStorageInterfaceNode|null, as beforeRevisionableStorageInterface,ContentEntityStorageInterfaceorSqlContentEntityStorageContentEntityInterface|nullConfigEntityStorageInterfaceorConfigEntityStorageConfigEntityInterface|nullEntityStorageInterfaceEntityInterface|nullErrors that named
BlockContent,Block,EntityInterfaceorRevisionableInterfacefor something loaded from these storages now nameContentEntityInterfaceorConfigEntityInterface. That's why baseline entries stop matching:loadRevision(),loadRevisionUnchanged()andloadMultipleRevisions()now resolve to the entity class too, likeload().Assigning to a content entity field, like
$node->title = 'foo', is no longer reported.ContentEntityBase::__set()passes the value to the field'ssetValue(). After the assignment,$node->titleis still aFieldItemListInterface.Field items
Stored field item properties are nullable, like
StringItemBase::$value(?string) andIntegerItem::$value(?int). Items fromappendItem()and items on unsaved entities returnNULL, and core'sisEmpty()methods check for it. Code that passes$item->valueto astringparameter is now reported.New stubs type the properties of
TelephoneItem, the options module's list items andImageItem.ImageItem::$displayand$description, andDateRangeItem::$date, are typednull: those classes don't define them, so reading one returnsNULL.Render callbacks
Drupal throws
UntrustedCallbackExceptionwhen a#pre_render,#post_renderor#lazy_buildercallback is a method thattrustedCallbacks()doesn't return. That's now reported:Container parameters
ContainerInterface::getParameter()returns the type of the parameter's default in theservices.ymlfiles, likestringforapp.rootandarrayforrenderer.config. It returnedarray|bool|float|int|string|UnitEnum|nullfor every parameter.Bleeding edge
bleedingEdge.neonenables three new opt-in rules. Each has adrupal.rules.*parameter and a README section.formApiCallbackRulereports Form API callbacks that fail when Drupal calls them, like a missing function in#validateor a non-static method in[static::class, 'method'].lazyBuilderRulereports#lazy_builderrender arrays that breakRenderer's rules, and arguments that don't match the callback's parameters.phpDocSeeReferenceRulereports@seetags whose class, method or function doesn't exist.The README no longer says that
checkCoreDeprecatedHooksInApiFilesandcheckContribDeprecatedHooksInApiFilesreport deprecated hooks. They only load the.api.phpfiles. #963 tracks the rule.Fixes
accessCheck()anywhere in a chained entity query statement marks the query as checked.BrowserTestBase::$defaultThemeset in a trait is found.EntityListBuilderOperationsCacheabilityRuleno longer runs on Drupal 12.0-dev.What's Changed
New Contributors
Full Changelog: 2.4.0...2.5.0
This discussion was created from the release 2.5.0.
All reactions