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

Appearance settings

[Filesystem] added exists method #4586

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

Merged
merged 1 commit into from
Jun 16, 2012
Merged

[Filesystem] added exists method #4586

merged 1 commit into from
Jun 16, 2012

Conversation

aerialls
Copy link
Contributor

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets:
Todo:
License of the code: MIT
Documentation PR:

@travisbot
Copy link

This pull request passes (merged ebd1a4c6 into f881d28).

@sstok
Copy link
Contributor

sstok commented Jun 16, 2012

Shouldn't it be better to stop on the first failure? as all the others files will be false automatically.

@stof
Copy link
Member

stof commented Jun 16, 2012

indeed. We should avoid unnecessary filesystem IO by returning false as soon as it is known

@aerialls
Copy link
Contributor Author

Indeed it's better this way. fixed!

@travisbot
Copy link

This pull request passes (merged 8d98f417 into 76b2ed4).

public function exists($files)
{
foreach ($this->toIterator($files) as $file) {
if (false === file_exists($file)) {
Copy link
Member

Choose a reason for hiding this comment

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

it should be if (!file_exists($file)) to follow the Symfony CS. We use the strict comparison with false only for cases where it is necessary (such as strpos which can return 0 with the opposite meaning)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed. Thanks for the feedback

fabpot added a commit that referenced this pull request Jun 16, 2012
Commits
-------

38cad9d [Filesystem] added exists method

Discussion
----------

[Filesystem] added exists method

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets:
Todo:
License of the code: MIT
Documentation PR:

---------------------------------------------------------------------------

by travisbot at 2012-06-15T16:29:20Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1629204) (merged ebd1a4c6 into f881d28).

---------------------------------------------------------------------------

by sstok at 2012-06-16T09:05:48Z

Shouldn't it be better to stop on the first failure? as all the others files will be false automatically.

---------------------------------------------------------------------------

by stof at 2012-06-16T10:21:49Z

indeed. We should avoid unnecessary filesystem IO by returning false as soon as it is known

---------------------------------------------------------------------------

by aerialls at 2012-06-16T11:55:24Z

Indeed it's better this way. fixed!

---------------------------------------------------------------------------

by travisbot at 2012-06-16T12:01:16Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1634615) (merged 8d98f417 into 76b2ed4).
@fabpot fabpot merged commit 38cad9d into symfony:master Jun 16, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.