Missing @return tag in:

  1. /core/modules/help/src/Plugin/Block/HelpBlock.php getActiveHelp(Request $request)
  2. /core/modules/hal/src/Normalizer/ContentEntityNormalizer.php denormalize($data, $class, $format = NULL, array $context = array())
  3. /core/modules/book/src/Tests/BookTest.php createBookNode($book_nid, $parent = NULL)
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ashhishhh created an issue. See original summary.

Anonymous’s picture

Status: Active » Needs review
FileSize
2.03 KB
jhodgdon’s picture

Status: Needs review » Needs work

Thanks... I am not sure this is quite right though:

  1. +++ b/core/modules/hal/src/Normalizer/ContentEntityNormalizer.php
    @@ -124,6 +124,9 @@ public function normalize($entity, $format = NULL, array $context = array()) {
    +   * @return object
    +   *   An object of the class specified with $class variable.
    +   *
        * @throws \Symfony\Component\Serializer\Exception\UnexpectedValueException
        */
       public function denormalize($data, $class, $format = NULL, array $context = array()) {
    

    That doesn't seem right to me, since the $class param documentation is:

      * @param string $class
       *   Unused, entity_create() is used to instantiate entity objects.
     
  2. +++ b/core/modules/help/src/Plugin/Block/HelpBlock.php
    @@ -89,6 +89,10 @@ public static function create(ContainerInterface $container, array $configuratio
    +   *   An array containing the help texts of the active menu item as HTML
    

    texts -> text strings

    Text is not a countable noun, at least in this context, so it should not be pluralized.

ashhishhh’s picture

snehi’s picture

Assigned: ashhishhh » snehi
Status: Needs work » Needs review
FileSize
2.04 KB
644 bytes

Hi @jhodgdon,
Can y0u please elaborate what to write in 3.1.
Done with 3.2

Attching patch and interdiff.

rakesh.gectcr’s picture

@snehi,

Please try to work on the unassigned issue. There are lots of un assigned issues are available in the queue. It is assigned to some one , that means he is working on it, Please understand. You are doing this for many times. I found out in couple of issues.

Disadvantage: Somebody is assigned , they will be really following up that issues. Time is precious, should not end in wasting time of any contributors. Please do understand.

ashhishhh’s picture

Hi @jhodgdon,
I corrected @param string $class

And I included your 2nd point as well.
Please find my patch

Regards,
Ashish

dawehner’s picture

+++ b/core/modules/hal/src/Normalizer/ContentEntityNormalizer.php
@@ -124,6 +124,9 @@ public function normalize($entity, $format = NULL, array $context = array()) {
+   * @return object
+   *   A denormalized entity object from serialized entity $data variable.

Can we typehint EntityInterface if we know it will be an entity?

ashhishhh’s picture

@dawehner But $data is serialized form.
I don't think we can do that.

ashhishhh’s picture

Assigned: snehi » ashhishhh
ashhishhh’s picture

Sorry @dawehner, I understood your point bit late.
Please find new patch.
Thanks for suggestion.

jhodgdon’s picture

Status: Needs review » Needs work
Issue tags: -rc eligible

Thanks for the patch! Sorry for delay in review -- I've been on vacation.

I think this needs some additional work, and I don't really understand why this issue was filed about 3 random missing @return tags in 3 completely different areas of the code... but anyway:

  1. +++ b/core/modules/hal/src/Normalizer/ContentEntityNormalizer.php
    @@ -124,6 +124,9 @@ public function normalize($entity, $format = NULL, array $context = array()) {
    +   *   A denormalized entity object from serialized entity $data variable.
    

    What is a "denormalized entity object"? I honestly have no idea.

  2. +++ b/core/modules/help/src/Plugin/Block/HelpBlock.php
    @@ -89,6 +89,9 @@ public static function create(ContainerInterface $container, array $configuratio
    +   * @return array
    +   *   An array containing the help text strings of the active menu item as HTML.
    

    This isn't accurate. Take a look at the code -- it always returns a string.

r_sharma08’s picture

Assigned: ashhishhh » r_sharma08

Due to no activity for a longer time, I am assigning this issue to myself.

ashhishhh’s picture

Hi @jhodgdon,
I tried to address both point here.

ashhishhh’s picture

Status: Needs work » Needs review
jhodgdon’s picture

Status: Needs review » Needs work

@ashhishhh: Normally, just after someone assigns an issue to themselves, you shouldn't jump in and make a patch. The more polite thing to do is to wait a few days, and if there is still no activity, post a comment asking if they are planning to make a patch. Only then, if there is no response, then you could assign the issue to yourself and make a patch. So going forward, if an issue is assigned to someone else, please follow that procedure. Thanks!

In any case, I reviewed the interdiff in #14... Still can be improved:

  1. +++ b/core/modules/hal/src/Normalizer/ContentEntityNormalizer.php
    @@ -125,7 +125,7 @@
    +   *   An unserialize entity object from serialize entity $data variable.
    

    OK, I at least know what this means now; no idea if it is accurate. But the grammar needs a cleanup:

    unserialize => unserialized
    serialize => serialized

    And... So entity object implies it is not serialized. And presumably $data in the param docs (I hope?) says it is serialized data. So... Probably this whole thing needs rewording, to something like:

    An entity object containing the data in $data.

  2. +++ b/core/modules/help/src/Plugin/Block/HelpBlock.php
    @@ -90,8 +90,8 @@
    +   *   Help text of the active menu item as HTML.
    

    This is better! But really in D8 we don't have "active menu items" any more. As you can see from the parameter, it's for the current request.

r_sharma08’s picture

Status: Needs work » Needs review

Thanks @jhodgdon.
Patch applied, kindly review it.

r_sharma08’s picture

jhodgdon’s picture

Status: Needs review » Needs work

Thanks for the new patch! I reviewed the whole patch this time, not the interdiff...

+++ b/core/modules/hal/src/Normalizer/ContentEntityNormalizer.php
@@ -124,6 +124,9 @@ public function normalize($entity, $format = NULL, array $context = array()) {
+   *   An unserialized entity object from serialized entity $data variable.

Hmmm... See comment #16, item 1. I suggested different wording, because entity objects are by definition unserialized.

The rest looks good!

r_sharma08’s picture

Status: Needs work » Needs review
FileSize
2.01 KB
581 bytes

Thanks jhodgdon
Patched, please review.

snehi’s picture

+++ b/core/modules/hal/src/Normalizer/ContentEntityNormalizer.php
@@ -124,6 +124,9 @@ public function normalize($entity, $format = NULL, array $context = array()) {
+   *  An entity object containing the data in $data ¶

Blank space, Please configure your IDE for not doing this.

snehi’s picture

Status: Needs review » Needs work
r_sharma08’s picture

Status: Needs work » Needs review
FileSize
2.01 KB
557 bytes

Patch updated, please review.

heykarthikwithu’s picture

Status: Needs review » Needs work

you can add description for @throws.

+   *
    * @throws \Symfony\Component\Serializer\Exception\UnexpectedValueException
    */
jhodgdon’s picture

Thanks!

Note that #24 is out of scope for this issue. You can file a new issue about this if you want to.

There is still one problem with the patch though:

+++ b/core/modules/hal/src/Normalizer/ContentEntityNormalizer.php
@@ -124,6 +124,9 @@ public function normalize($entity, $format = NULL, array $context = array()) {
+   *  An entity object containing the data in $data

This needs to end in .

r_sharma08’s picture

Status: Needs work » Needs review
FileSize
2.02 KB
569 bytes

corrected and updated patch.

snehi’s picture

Status: Needs review » Needs work
snehi’s picture

+++ b/core/modules/hal/src/Normalizer/ContentEntityNormalizer.php
@@ -124,6 +124,9 @@ public function normalize($entity, $format = NULL, array $context = array()) {
+   *  An unserialized entity object containing the data in $data

Missing fullstop here at the end of the line.
Anyway patch is looking good now. Thanks for your contribution.
Cheers !!!

r_sharma08’s picture

Status: Needs work » Needs review
FileSize
2.02 KB
583 bytes

Patch attached, please review.

  • jhodgdon committed 0a97f79 on 8.0.x
    Issue #2607332 by r_sharma08, ashhishhh, snehi, pjonckiere, dawehner:...

  • jhodgdon committed e225500 on
    Issue #2607332 by r_sharma08, ashhishhh, snehi, pjonckiere, dawehner:...
jhodgdon’s picture

Status: Needs review » Fixed

OK, good! Thanks! Committed to both 8.x branches (with a small fix to indentation in EntityNormalizer).

Status: Fixed » Closed (fixed)

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