Please consider using the the latest stable version for any production code.

The Scheme component

The Scheme class eases scheme creation and manipulation. This URI component object only exposes the package common API.

Usage

<?php

use League\Uri\Components\Scheme;

$scheme = new Scheme('FtP');
echo $scheme->getContent();      //display 'ftp'
echo $scheme;                    //display 'ftp'
echo $scheme->getUriComponent(); //display 'ftp:'

$new_scheme = $scheme->withContent(null);
echo $new_scheme->getContent();      //display null
echo $new_scheme;                    //display ''
echo $new_scheme->getUriComponent(); //display ''

The delimiter : is not part of the component value and must not be added.

If the submitted value is not valid a League\Uri\Exceptions\SyntaxError exception is thrown.