8000 [Routing] unify RequestContext as fluent class by Tobion · Pull Request #9073 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Routing] unify RequestContext as fluent class #9073

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
Oct 9, 2014

Conversation

Tobion
Copy link
Contributor
@Tobion Tobion commented Sep 18, 2013
Q A
Bug fix? yes
New feature? partly
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR
  • some methods were tagged with @api which makes no sense since the class is already tagged as stable. this automatically includes all methods. also our bc promise is only about @api on classes
  • setParameters the only fluent method! I made them all fluent which makes sense for this class

@@ -219,19 +227,19 @@ public function getHttpsPort()
/**
* Sets the HTTPS port.
*
* @param string $httpsPort The HTTPS port
* @param integer $httpsPort The HTTPS port
Copy link
Contributor

Choose a reason for hiding this comment

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

this can be integer|string no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it can but not sure if we want to document that

@fabpot
Copy link
Member
fabpot commented Dec 31, 2013

@Tobion What about this PR? Do you have time to finish it?

@Tobion
Copy link
Contributor Author
Tobion commented Jan 1, 2014

@fabpot yes I will. Do you agree with all the points in the description?

@Tobion Tobion force-pushed the request-context-tolerance branch from 7fb7885 to bf47577 Compare October 8, 2014 21:07
* @param array $parameters The parameters
*
* @return Route The current Route instance
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was even documenting the wrong class

@Tobion Tobion changed the title [WIP][Routing] make RequestContext fault-tolerant [Routing] fix inconsistencies in RequestContext Oct 8, 2014
@Tobion
Copy link
Contributor Author
Tobion commented Oct 8, 2014

@fabpot this is ready. IMO this should be merged into 2.3 to reduce the divergence. But lets see what the mergers say.

@Tobion Tobion force-pushed the request-context-tolerance branch from bf47577 to 93b6050 Compare October 8, 2014 21:59
@@ -47,21 +48,26 @@ class RequestContext
* @param int $httpsPort The HTTPS port
* @param string $path The path
* @param string $queryString The query string
*
* @api
Copy link
Member

Choose a reason for hiding this comment

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

I think that @api calls must not be removed. We do have a lot of classes with @api on methods only. I understand that this is kind of redundant with the @api on the class, but that's probably not related to this PR and should be discussed for an overall change instead of a local one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok I left this untouched

@Tobion Tobion force-pushed the request-context-tolerance branch from 93b6050 to 6c31ce4 Compare October 9, 2014 11:12
*
* @param Request $request A Request instance
*
* @return RequestContext The current instance, implementing a fluent interface
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be self (instead of RequestContext)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

thanks

@fabpot
Copy link
Member
fabpot commented Oct 9, 2014

Looks good to me. I'm a bit reluctant to merge it into 2.3 though. What @symfony/deciders think?

@stof
Copy link
Member
stof commented Oct 9, 2014

Well, fixing the inconsistencies in the type of values could go in 2.3 IMO. but turning the API into a fluent one should only be done in master IMO. It is not a bugfix

@fabpot
Copy link
Member

@stof agreed

@lsmith77
Copy link
Contributor
lsmith77 commented Oct 9, 2014

I agree as well

@Tobion
Copy link
Contributor Author
Tobion commented Oct 9, 2014

I would consider the fluent thing a bug fix because one method had this already (probably unintentional). So either the ugly code stays in an LTS version or we make all setters fluent (which is not considered a bc break).

@Tobion
Copy link
Contributor Author
Tobion commented Oct 9, 2014

If you still want me to split it, I can do it though

@fabpot
Copy link
Member
fabpot commented Oct 9, 2014

I prefer to stay strict on what we do in 2.3. So, the split looks like a better option to me (even if indeed these changes are not a big deal.)

@Tobion
Copy link
Contributor Author
Tobion commented Oct 9, 2014

Here you go, the one for 2.3: #12190

@Tobion
Copy link
Contributor Author
Tobion commented Oct 9, 2014

If #12190 is merged and 2.3 merged into master, I can rebase this.

@Tobion Tobion changed the title [Routing] fix inconsistencies in RequestContext [Routing] unify RequestContext as fluent class Oct 9, 2014
@fabpot
Copy link
Member
fabpot commented Oct 9, 2014

#12190 merged and 2.3 merged into master

@Tobion Tobion force-pushed the request-context-tolerance branch from 6c31ce4 to 41412f9 Compare October 9, 2014 16:14
@Tobion
Copy link
Contributor Author
Tobion commented Oct 9, 2014

Adjusted

@fabpot
Copy link
Member
fabpot commented Oct 9, 2014

Thank you @Tobion.

@fabpot fabpot merged commit 41412f9 into symfony:master Oct 9, 2014
fabpot added a commit that referenced this pull request Oct 9, 2014
This PR was merged into the 2.6-dev branch.

Discussion
----------

[Routing] unify RequestContext as fluent class

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

- [x] <del>some methods were tagged with `@api` which makes no sense since the class is already tagged as stable. this automatically includes all methods. also our bc promise is only about `@api` on classes</del>
- [x] setParameters the only fluent method! I made them all fluent which makes sense for this class

Commits
-------

41412f9 [Routing] unify fluent interface in RequestContext
@Tobion Tobion deleted the request-context-tolerance branch October 9, 2014 17:43
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.

9 participants
0