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

[BrowserKit] Rename Client to Browser#30541

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

Merged
fabpot merged 1 commit intosymfony:masterfromfabpot:client-rename
Mar 12, 2019

Conversation

@fabpot
Copy link
Member

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?yes
Tests pass?yes
Fixed ticketsn/a
LicenseMIT
Doc PRn/a

Client is very generic and used in 3 places: BrowserKit, HttpKernel, and FramewrokBundle. Each Client extends another one. So, to make things clearer, I'd like to rename Client to Browser like this:

Symfony\Component\BrowerKit\Client -> AbstractBrowser
Symfony\Component\HttpKernel\Client -> HttpKernelBrowser
Symfony\Bundle\FrameworkBundle\Client -> KernelBrowser

The next PR will introduce anHttpBrowser based on the new HttpClient component :)

fancyweb and ro0NL reacted with thumbs up emojiHeahDude reacted with hooray emoji
@nicolas-grekasnicolas-grekas changed the titleRename Client to Browser[BrowserKit] Rename Client to BrowserMar 12, 2019
@fabpotfabpotforce-pushed theclient-rename branch 2 times, most recently fromb5151a7 to3a84669CompareMarch 12, 2019 20:38
@fabpotfabpot merged commitdbe4f86 intosymfony:masterMar 12, 2019
fabpot added a commit that referenced this pull requestMar 12, 2019
This PR was merged into the 4.3-dev branch.Discussion----------[BrowserKit] Rename Client to Browser| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no     <!-- seehttps://symfony.com/bc -->| Deprecations? | yes| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->| Fixed tickets | n/a| License       | MIT| Doc PR        | n/a`Client` is very generic and used in 3 places: BrowserKit, HttpKernel, and FramewrokBundle. Each Client extends another one. So, to make things clearer, I'd like to rename Client to Browser like this:Symfony\Component\BrowerKit\Client -> AbstractBrowserSymfony\Component\HttpKernel\Client -> HttpKernelBrowserSymfony\Bundle\FrameworkBundle\Client -> KernelBrowserThe next PR will introduce an `HttpBrowser` based on the new HttpClient component :)Commits-------dbe4f86 renamed Client to Browser
* @returnClient AClient instance
* @returnKernelBrowser AKernelBrowser instance
*/
protectedstaticfunctioncreateClient(array$options = [],array$server = [])
Copy link
Member

Choose a reason for hiding this comment

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

should we rename that method too ?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I thought about renaming methods but I think that's too much. What others think?

Copy link
Contributor

Choose a reason for hiding this comment

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

With a hard copy pasting you could also add return type hints on methods.

@stof
Copy link
Member

This is a BC break, because the BC classSymfony\Bundle\FrameworkBundle\Client does not extend the BC classSymfony\Component\BrowerKit\Client

alexislefebvre reacted with thumbs up emoji

@stof
Copy link
Member

I think you will need to use class aliases here instead., to preserve the class hierarchy.

@fabpotfabpot deleted the client-rename branchMarch 17, 2019 07:41
@Devristo
Copy link
Contributor

Devristo commentedApr 9, 2019
edited
Loading

Yes, it breaks at leasthttps://github.com/FriendsOfBehat/SymfonyExtension andhttps://github.com/minkphp/MinkBrowserKitDriver.

For now people can workaround it by adding the following to their test bootstrap:

class_alias(\Symfony\Component\BrowserKit\AbstractBrowser::class, 'Symfony\Component\BrowserKit\Client');

This should be near the top, as it will only work when the class has not yet been autoloaded.

alexislefebvre and pamil reacted with thumbs up emoji

@fabpot
Copy link
MemberAuthor

@Devristo Can you create a new issue... and if you can provide a PR, that would be wonderful :)

Devristo reacted with thumbs up emoji

fabpot added a commit that referenced this pull requestApr 15, 2019
… to Browser (Devristo)This PR was squashed before being merged into the 4.3-dev branch (closes#31040).Discussion----------[BrowserKit] Fixed BC-break introduced by rename of Client to Browser| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#31039| License       | MIT| Doc PR        |Since#30541 the inheritance hierarchy of `\Symfony\Component\BrowserKit\Client` has changed. Notably the test.client no longer is an instance of `\Symfony\Component\BrowserKit\Client`.This PR uses `class_alias` to fix the class hierarchy similarly as has been done in Twig. In this case I copied the approach of `Twig_TokenParser_AutoEscape` and `\Twig\TokenParser\AutoEscapeTokenParser`Commits-------6a94dea [BrowserKit] Fixed BC-break introduced by rename of Client to Browser
@fabpotfabpot mentioned this pull requestMay 9, 2019
fabpot added a commit that referenced this pull requestJun 6, 2019
…icolas-grekas)This PR was merged into the 4.3 branch.Discussion----------[FramworkBundle][HttpKernel] fix KernelBrowser BC layer| Q             | A| ------------- | ---| Branch?       | 4.3| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#31762| License       | MIT| Doc PR        | -Swap the order of inheritance to preserve BC with legacy `Client` type hints.From#30541Commits-------1a4c254 [FramworkBundle][HttpKernel] fix KernelBrowser BC layer
javiereguiluz referenced this pull request in symfony/symfony-docsJun 8, 2020
…bstractBrowser since SF 4.3 (Calex92)This PR was merged into the 4.4 branch.Discussion----------[Browserkit] The Client class has been replaced by the AbstractBrowser since SF 4.3I noticed that in the BrowserKit documentation, there was multiple references to the old ``Symfony\Component\BrowserKit\Client`` class instead of the ``Symfony\Component\BrowserKit\AbstractBrowser`` one.See [https://github.com/symfony/symfony/pull/30541](https://github.com/symfony/symfony/pull/30541)There was a previous merge request for SF5 here (#12717), but I don't know if it was possible for me to use it since I'm quite new with Github best practice about contribution.Don't hesitate to tell me if I'm wrong!Commits-------a3ff4e0 The Client class has been replaced by the AbstractBrowser since SF 4.3
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof left review comments

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

+1 more reviewer

@HeahDudeHeahDudeHeahDude left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

@fabpot@stof@Devristo@nicolas-grekas@HeahDude@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp