Make WordPress Core

Opened 6 years ago

Closed 10 months ago

Last modified 10 months ago

#44424 closed task (blessed) (fixed)

PHPDoc comments and @return tags missing at many places

Reported by: subrataemfluence's profile subrataemfluence Owned by: swissspidy's profile swissspidy
Milestone: 6.5 Priority: normal
Severity: minor Version:
Component: I18N Keywords: has-patch good-first-bug
Focuses: docs, coding-standards Cc:

Description

Function/methods and property declarations are missing PHPDoc comment and @return tags at many places of src/wp-includes/pomo/translations.php

Proposed patch added.

Attachments (1)

44424.diff (3.1 KB) - added by subrataemfluence 6 years ago.
Proposed patch

Download all attachments as: .zip

Change History (12)

@subrataemfluence
6 years ago

Proposed patch

#1 @netweb
6 years ago

  • Keywords has-patch added; needs-patch removed
  • Milestone changed from Awaiting Review to 5.0

#2 @pento
6 years ago

  • Milestone changed from 5.0 to 5.1

#3 @pento
6 years ago

  • Keywords needs-refresh added

Reviewing 44424.diff:

  • $entries and $headers could do with descriptions.
  • get_header() returns a header, not an element.
  • translate_entry() returns an entry, not an element.
  • select_plural_form() returns int, and the return needs a description.
  • translate_plural() only returns a string. The params and return need a description.
  • gettext_select_plural_form() returns the result of calling the callable that make_plural_form_function() returns. The callable that make_plural_form_function() returns will return an int.
  • make_plural_form_function() returns a callable.
  • All of the docblocks added to NOOP_Translations need descriptions.

#4 @pento
6 years ago

  • Milestone changed from 5.1 to Future Release
  • Version trunk deleted

#5 @swissspidy
19 months ago

  • Keywords good-first-bug added

#6 @niravsherasiya7707
19 months ago

@swissspidy Should I take ownership of the task to implement the improvements?

#7 @swissspidy
19 months ago

You can, but it's not a requirement. People reading through the comments here will see that you're working on it regardless :-)

Just remember to follow the PHP documentation standards

This ticket was mentioned in PR #5212 on WordPress/wordpress-develop by @hrshahin.


15 months ago
#8

  • Keywords needs-refresh removed

Trac ticket: https://core.trac.wordpress.org/ticket/44424

Description :

Add missing PHPDoc comments and @return tags in many places.

Changes:

Class Translations:
Manages translation entries and headers.
Methods for adding entries, setting headers, translating, and merging entries.

Class Gettext_Translations (extends Translations):
Extends Translations with gettext-specific functionality.
Handles plural forms and expressions for gettext translations.

Class NOOP_Translations:
Provides a placeholder class with the same interface as Translations but no actual translation operations.

#9 @swissspidy
10 months ago

  • Milestone changed from Future Release to 6.5
  • Owner set to swissspidy
  • Severity changed from normal to minor
  • Status changed from new to reviewing
  • Type changed from defect (bug) to task (blessed)

#10 @swissspidy
10 months ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 57734:

I18N: Improve docs for pomo library classes.

Props subrataemfluence, pento, hrshahin.
Fixes #44424.

Note: See TracTickets for help on using tickets.