Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Finder] no PHP warning on empty directory iteration#19636

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
ggottwald wants to merge3 commits intosymfony:2.7fromggottwald:2.7
Closed

[Finder] no PHP warning on empty directory iteration#19636

ggottwald wants to merge3 commits intosymfony:2.7fromggottwald:2.7

Conversation

@ggottwald
Copy link
Contributor

@ggottwaldggottwald commentedAug 16, 2016
edited
Loading

QA
Branch?2.8
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets
LicenseMIT
Doc PRSince RecursiveDirectoryIterator::SKIP_DOTS is set as flag, opendir gets a warning if an empty directory is reached


if ($this->getPath() ==='') {
return$this->rewindable =false;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

A test should probably be added to cover this scenario

@fabpot
Copy link
Member

@ggottwald Can you update the empty title to something relevant? Thanks.

@ggottwaldggottwald changed the title2.7[Finder] no PHP warning on empty directory iterationAug 17, 2016
@ggottwald
Copy link
ContributorAuthor

https://gist.github.com/ggottwald/07194dc7926ae9093b773ec2297116f3
The changes will fix a warning with HHVM opening an empty directory. Any other ideas resolving this issue? I will also open an issue at HHVM.

@ggottwald
Copy link
ContributorAuthor

facebook/hhvm#7281

@nicolas-grekas
Copy link
Member

@ggottwald could you please add a test case?

@ggottwald
Copy link
ContributorAuthor

Sorry for the late response. Until now I was not able to force a catchable warning in the test.
In production I got a errorhandler catching the warning and throws an exception. I didn't find a way to reproduce this in the unittest.
This fix would also only be a workaround of a HHVM bug. Maybe we wait until it's fixed on their side.

@nicolas-grekas
Copy link
Member

👍
Status: reviewed

return$this->rewindable;
}

if ($this->getPath() ==='') {
Copy link
Member

Choose a reason for hiding this comment

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

should be using a Yoda condition:'' === $this->getPath()

@fabpot
Copy link
Member

Thank you@ggottwald.

fabpot added a commit that referenced this pull requestSep 14, 2016
…twald)This PR was squashed before being merged into the 2.7 branch (closes#19636).Discussion----------[Finder] no PHP warning on empty directory iteration| Q             | A| ------------- | ---| Branch?       | 2.8| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets || License       | MIT| Doc PR        | Since RecursiveDirectoryIterator::SKIP_DOTS is set as flag, opendir gets a warning if an empty directory is reachedCommits-------695e341 [Finder] no PHP warning on empty directory iteration
@fabpotfabpot closed thisSep 14, 2016
This was referencedOct 3, 2016
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@ggottwald@fabpot@nicolas-grekas@jameshalsall@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp