Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Finder] simplified code #15962

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
Sep 28, 2015
Merged

[Finder] simplified code #15962

merged 1 commit into from
Sep 28, 2015

Conversation

fabpot
Copy link
Member

@fabpot fabpot commented Sep 28, 2015

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

return !preg_match('/[*?[:alnum:] \\\\]/', $start);
}

if ($start === '{' && $end === '}') {
Copy link
Member

Choose a reason for hiding this comment

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

these are not the only bracket types supported for delimiters btw. Our code is missing support for other ones: http://php.net/manual/en/regexp.reference.delimiters.php

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

Copy link
Member

Choose a reason for hiding this comment

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

btw, the logic in the Expression subsystem was supporting () as delimiters, so this is actually a regression

@fabpot fabpot force-pushed the finder-simplification branch from 9c0f54d to 3e1e1c7 Compare September 28, 2015 10:01
@stof
Copy link
Member

stof commented Sep 28, 2015

👍 this complex system is not necessary anymore now that we deprecated the find-based adapters.

@fabpot is it possible to add tests for the regex detection here, including the case of all kinds of bracket delimiters ?
The logic was currently covered by tests of the Expression class, but we need to cover it by itself now as we won't call the Expression class anymore here.

and you need to mark tests of the Expression classes as legacy ones to avoid issues with deprecation warnings.

@fabpot fabpot force-pushed the finder-simplification branch from 3e1e1c7 to 4fa3eaf Compare September 28, 2015 10:21
@fabpot
Copy link
Member Author

fabpot commented Sep 28, 2015

The tests where already in the iterator test class for isRegex(), but I've just added some more.
We should be good now.

@stof
Copy link
Member

stof commented Sep 28, 2015

good to me

@fabpot fabpot merged commit 4fa3eaf into symfony:2.8 Sep 28, 2015
fabpot added a commit that referenced this pull request Sep 28, 2015
This PR was merged into the 2.8 branch.

Discussion
----------

[Finder] simplified code

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

Commits
-------

4fa3eaf [Finder] simplified code
@fabpot fabpot mentioned this pull request Nov 16, 2015
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.

3 participants