Skip to content
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

[5.7] Further renaming of scheme from schema #26640

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/Illuminate/Routing/UrlGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class UrlGenerator implements UrlGeneratorContract
protected $forcedRoot;

/**
* The forced schema for URLs.
* The forced scheme for URLs.
*
* @var string
*/
Expand All @@ -60,8 +60,9 @@ class UrlGenerator implements UrlGeneratorContract
protected $cachedRoot;

/**
* A cached copy of the URL schema for the current request.
* A cached copy of the URL scheme for the current request.
*
* @deprecated In 5.8, this will change to $cachedScheme
Copy link
Contributor

Choose a reason for hiding this comment

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

If it's deprecated, you need something to supersede it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the name were private it would not constitute a minor BC change. I don't actually think people are adding macros to UrlGenerator or extending the class in a way where they are directly accessing the cached/in-memory value of the calculated scheme, but to do our due diligence I think we should push the rename to 5.8, just in case.

In the mean time, there is nothing that can simply supersede the original protected property. All it does is track some state, and introducing a secondary (newly named) property would unnecessarily complicate the code for no real value.

* @var string|null
*/
protected $cachedSchema;
Expand Down Expand Up @@ -578,14 +579,14 @@ public function getDefaultParameters()
/**
* Force the scheme for URLs.
*
* @param string $schema
* @param string $scheme
* @return void
*/
public function forceScheme($schema)
public function forceScheme($scheme)
{
$this->cachedSchema = null;

$this->forceScheme = $schema.'://';
$this->forceScheme = $scheme.'://';
}

/**
Expand Down