Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes 32 - Method getDateModified of RSS reader doesn't iterate over different formats #33

Merged
merged 1 commit into from
Jan 4, 2021

Conversation

froschdesign
Copy link
Member

Q A
Bugfix yes

Copy link
Member

@weierophinney weierophinney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look reasonable to me. Please check the Psalm output, though, as you'll either need to correct some new issues, or add to the baseline:

@froschdesign
Copy link
Member Author

@weierophinney

Please check the Psalm output, though, as you'll either need to correct some new issues…

Yes, there are massive problems with many bugs. But these are old problems and not related to this pull request. No new problems are introduced with this PR.


Pslam reports the following problem for example:

RedundantCastGivenDocblockType - test/Reader/Entry/AtomStandaloneEntryTest.php:150:39

Redundant cast to array given docblock-provided type (see https://psalm.dev/263)
$this->assertEquals($authors, (array) $entry->getAuthors());

https://travis-ci.com/github/laminas/laminas-feed/jobs/464005564#L881-L882

But the problem is not the redundant cast, the problem is the related DocBlock:

/**
* Get an array with feed authors
*
* @return array
*/
public function getAuthors();

It's not a array it's a collection or null:

class Author extends AbstractCollection
{
/**
* Return a simple array of the most relevant slice of
* the author values, i.e. all author names.
*
* @return array
*/
public function getValues()
{
$authors = [];
foreach ($this->getIterator() as $element) {
$authors[] = $element['name'];
}
return array_unique($authors);
}
}

if (count($authors) === 0) {
$authors = null;
}

@froschdesign
Copy link
Member Author

There is a separate issue report for the wrong DocBlocks: #30

@weierophinney weierophinney added this to the 2.13.1 milestone Jan 4, 2021
@weierophinney weierophinney merged commit c7651c0 into laminas:2.13.x Jan 4, 2021
@froschdesign froschdesign deleted the hotfix/32 branch January 4, 2021 19:17
weierophinney added a commit that referenced this pull request Jan 4, 2021
Signed-off-by: Matthew Weier O'Phinney <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Method getDateModified of RSS reader doesn't iterate over different formats
2 participants