Skip to content

[Feature]: Add getters to Atom\Link, Media\Content, and Media\Thumbnail #3

Closed

Description

@123mousab

Problem

Most value objects expose getters (e.g. Image, Encoded::getContent(), Creator::getName()), but Atom\Link, Media\Content, and Media\Thumbnail only have setters. Once built, their values can't be read back, which makes it hard to test or inspect extensions returned by Item::getExtensions().

Proposed solution

Add read-only getters mirroring the existing setters:

  • Link: getHref(), getRel(), getType(), getHreflang(), getTitle(), getLength()
  • Thumbnail: getUrl(), getWidth(), getHeight(), getTime()
  • Content: getUrl(), getFileSize(), getType(), getMedium(), getExpression(), getBitrate(), getDuration(), getWidth(), getHeight(), getLang(), getTitle(), getDescription(), getThumbnails()

Purely additive, no output change. I'll add tests and update the docs and CHANGELOG.

Question: Content::isDefault() is already the setter. Is getIsDefault() fine for the getter, or do you prefer another name?

Happy to open a PR against 8.5.x.

Alternatives considered

Parsing the generated XML or using reflection, both fragile.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions