Skip to content

Fixed undefined ImageValidator::$suffices property when uploading an image during functional tests #11111

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

Closed
wants to merge 2 commits into from
Closed

Fixed undefined ImageValidator::$suffices property when uploading an image during functional tests #11111

wants to merge 2 commits into from

Conversation

OwlyCode
Copy link
Contributor

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #11110
License MIT
Doc PR

This will make the FileValidator::$suffices attribute protected so ImageValidator or any inherited class can access it. It fixes #11110 in the most simple way possible.

@@ -29,7 +29,7 @@ class FileValidator extends ConstraintValidator

const MB_BYTES = 1000000;

private static $suffices = array(
protected static $suffices = array(
Copy link
Contributor

Choose a reason for hiding this comment

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

static::$suffices[$coef] should be changed to self::$suffices[$coef] instead

Copy link
Member

Choose a reason for hiding this comment

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

I agree with @Tobion. there is no point changing the visibility. Fixing the code reading it is better

@OwlyCode
Copy link
Contributor Author

I changed the fix so now $suffices will be accessed via self::$suffices and still be private. Thank you for your feedback !

@Tobion
Copy link
Contributor

Tobion commented Jun 12, 2014

👍

1 similar comment
@romainneutron
Copy link
Contributor

👍

@fabpot
Copy link
Member

fabpot commented Jun 12, 2014

Thank you @OwlyCode.

fabpot added a commit that referenced this pull request Jun 12, 2014
…loading an image during functional tests (OwlyCode)

This PR was squashed before being merged into the 2.5 branch (closes #11111).

Discussion
----------

Fixed undefined ImageValidator::$suffices property when uploading an image during functional tests

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #11110
| License       | MIT
| Doc PR        |

This will make the FileValidator::$suffices attribute protected so ImageValidator or any inherited class can access it. It fixes #11110 in the most simple way possible.

Commits
-------

859f34e Fixed undefined ImageValidator:: property when uploading an image during functional tests
@fabpot fabpot closed this Jun 12, 2014
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