djthossi/url-parser

A small lean self written URL parser which parsed a given URL into a OOP version

1.2.0 2019-06-17 09:21 UTC

This package is auto-updated.

Last update: 2024-06-17 20:50:27 UTC


README

UrlParser

This URL parser works currenlty only for http and https. If you required // or other protocols, feel free to add them. Build Status Maintainability Test Coverage

How to install

You have several options to install this package

Composer

composer require djthossi/url-parser

Git

git clone https://github.com/DjThossi/url-parser.git

Download

https://github.com/DjThossi/url-parser/archive/master.zip

Example

use DjThossi\UrlParser\ParsedUrl;
use DjThossi\UrlParser\UrlParser;

class SomeClass
{
    public function parseUrl(string $url): ParsedUrl
    {
        $urlParser = new UrlParser();
        return $urlParser->parseUrl($url);
    }
}