When using PHPStan on code interacting with the Paragraphs API there are some complaints which are caused by (ever so slightly) incorrect return type documentation in the interfaces.

Adapting the return type docs fixes the PHPStan issues.

CommentFileSizeAuthor
#5 3114396-3.patch1.27 KBkris_nikolov
#2 3114396-2.patch1.25 KBtstoeckler

Comments

tstoeckler created an issue. See original summary.

tstoeckler’s picture

Status: Active » Needs review
StatusFileSize
new1.25 KB
tstoeckler’s picture

Title: Fix return typehints » Fix some return type documentation

Fixing slightly misleading title

berdir’s picture

Status: Needs review » Needs work
+++ b/src/ParagraphInterface.php
@@ -18,7 +18,7 @@ interface ParagraphInterface extends ContentEntityInterface, EntityOwnerInterfac
    *
-   * @return ContentEntityInterface
+   * @return ContentEntityInterface|null
    *   The parent entity.

lets make this use the namespace when we touch it anyway?

kris_nikolov’s picture

Status: Needs work » Needs review
StatusFileSize
new1.27 KB

Patch with changes based on #4 suggestion.

tmaiochi’s picture

Assigned: Unassigned » tmaiochi

I'll review this!

tmaiochi’s picture

Assigned: tmaiochi » Unassigned
Status: Needs review » Reviewed & tested by the community

The patch change the return type for the namespace as suggested in #4

@kris_nikolov Just a warning your patch is named with the wrong comment number. See this in Patch naming conventions

berdir’s picture

Status: Reviewed & tested by the community » Fixed

Committed.

  • Berdir committed 6a75a61 on 8.x-1.x authored by kris_nikolov
    Issue #3114396 by tstoeckler, kris_nikolov: Fix some return type...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.