Skip to content

Fix the DocBlock for offsetGet(). - #578

Merged
jrfnl merged 2 commits into
WordPress:developfrom
costdev:offsetGet_use_offsetExists
Oct 14, 2021
Merged

jrfnl merged 2 commits into
WordPress:developfrom
costdev:offsetGet_use_offsetExists

Conversation

@costdev

@costdev costdev commented Oct 14, 2021 •

Copy link
Copy Markdown
Contributor

Pull Request Type

  • I have checked there is no other PR open for the same change.

This is a:

  • Bug fix
  • New feature
  • Code quality improvement

Context

What do you want to achieve with this PR?
Fix the documentation.

Why did you write this code? What problem does this PR solve?
The offsetGet() method doesn't call offsetExists() as its DocBlock states.

What should be mentioned about this PR in the changelog?
That the DocBlock is now accurate.

Detailed Description

The docs for CaseInsensitiveDictionary::offsetGet() state:

@return string|null Item value (null if offsetExists is false)

However, this method doesn't call offsetExists().

With this change, the DocBlock no longer references offsetExists() and now states:

@return string|null Item value (null if the item key doesn't exist)

Quality assurance

  • This change does NOT contain a breaking change (fix or feature that would cause existing functionality to change).
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added unit tests to accompany this PR.
  • The (new/existing) tests cover this PR 100%.
  • I have (manually) tested this code to the best of my abilities.
  • My code follows the style guidelines of this project.

@costdev costdev changed the title Make offsetGet() use offsetExists(). Fix the DocBlock for offsetGet(). Oct 14, 2021
@costdev
costdev marked this pull request as ready for review October 14, 2021 19:33
@jrfnl jrfnl added this to the 2.0.0 milestone Oct 14, 2021
@jrfnl
jrfnl merged commit 0bc2604 into WordPress:develop Oct 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants