Skip to content

Adjust return type to already existing type hint

Choose a tag to compare

@felixkempf felixkempf released this 26 Aug 16:41
· 5 commits to master since this release

\Attachments\Model\Table\AttachmentsTable::addUpload() now always returns the attachment entity, whether the save was successful or not.

  1. this makes the code consistent with the return type hint, introduced 3 months ago, which did not allow for a boolean to be returned anyway. That's also the reason why this essentially BC breaking change was still made in a patch version, as the error case returning false would have triggered a TypeError.

  2. it enables the calling context to get any validation errors if the save failed from the returned entity instead of only getting false