Make WordPress Core

Opened 8 weeks ago

Closed 8 weeks ago

#65901 closed defect (bug) (fixed)

PHPDoc comments and types missing in Translation_Entry

Reported by: pedromendonca Owned by: SergeyBiryukov
Priority: normal Milestone: 7.2
Component: I18N Version:
Severity: normal Keywords: has-patch
Cc: Focuses: docs, coding-standards

Description

Function and property declarations are missing PHPDoc comment, types declaration and @return tags at many places of src/wp-includes/pomo/entry.php.

Proposed patch added.

Change History (5)

This ticket was mentioned in ​PR #13126 on ​WordPress/wordpress-develop by ​@pedromendonca.


8 weeks ago
#1

Add missing Docblocks and declare types of Translation_Entry properties.

Trac ticket: 65901

## Use of AI Tools

AI assistance: Yes
Tool: Claude
Model: Opus 5
Used for: Initial assessment and code skeleton; final implementation was reviewed and edited by me.

This ticket was mentioned in ​PR #13128 on ​WordPress/wordpress-develop by ​@wprashed.


8 weeks ago
#2

## Trac Ticket
https://core.trac.wordpress.org/ticket/65901

## Description

Adds missing PHPDoc blocks and type declarations to the Translation_Entry class in src/wp-includes/pomo/entry.php.

### Changes

Property docblocks added for all previously undocumented properties:

  • $singular — string|null
  • $plural — string|null
  • $translations — (string|null)[]
  • $context — string|null
  • $translator_comments — string
  • $extracted_comments — string
  • $references — string[]
  • $flags — string[]

Constructor docblock improved:

  • Added @since 2.8.0 tag
  • Added summary line (Constructor.)
  • Updated parameter description to Optional. Array of arguments. Default empty array.
  • Updated @type annotations with precise types (string[] instead of array, (string|null)[] for translations)

Other improvements:

  • Added missing @param tag to the deprecated PHP4 constructor Translation_Entry()
  • Added @return void to merge_with()
  • Fixed period at end of file-level docblock description

Fixes #65901.

​@mukesh27 commented on ​PR #13128:


8 weeks ago
#3

Duplicate of #13126.

#4 @mukesh27
8 weeks ago

  • Milestone Awaiting Review → 7.2
  • Version trunk

#5 @SergeyBiryukov
8 weeks ago

  • Owner set to SergeyBiryukov
  • Resolution → fixed
  • Status new → closed

In 63323:

Docs: Add missing descriptions and declare types for Translation_Entry properties.

Developed in ​https://github.com/WordPress/wordpress-develop/pull/13126.

Follow-up to r10584, r32990, r57734.

Props pedromendonca, mukesh27, dhruvang21.
Fixes #65901.

Note: See TracTickets for help on using tickets.