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

Added support for other schemes #190

Merged
merged 5 commits into from
Apr 29, 2021

Conversation

Stilch
Copy link
Contributor

@Stilch Stilch commented Apr 12, 2021

For example

class WsUri extends Uri
{
    protected const SUPPORTED_SCHEME = [
        'ws' => 80,
        'wss' => 443,
    ];
}

src/Uri.php Outdated Show resolved Hide resolved
@coveralls
Copy link

coveralls commented Apr 27, 2021

Coverage Status

Coverage remained the same at 100.0% when pulling 37da6c8 on Stilch:feature-other-schemes into 78a2f6e on slimphp:master.

@Stilch Stilch changed the title Added support others scheme Added support other schemes Apr 28, 2021
@Stilch Stilch changed the title Added support other schemes Added support for other schemes Apr 28, 2021
@l0gicgate l0gicgate added this to the 1.4 milestone Apr 29, 2021
@l0gicgate l0gicgate merged commit e99324d into slimphp:master Apr 29, 2021
@Stilch Stilch deleted the feature-other-schemes branch April 30, 2021 06:00
$scheme = str_replace('://', '', strtolower($scheme));
if (!isset($valid[$scheme])) {
throw new InvalidArgumentException('Uri scheme must be one of: "", "https", "http"');
if (!key_exists($scheme, self::SUPPORTED_SCHEMES)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should it be static:: here?

Suggested change
if (!key_exists($scheme, self::SUPPORTED_SCHEMES)) {
if (!key_exists($scheme, static::SUPPORTED_SCHEMES)) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, you're right. I fix it.

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.

4 participants