return ($uri === '/' ||
$uri === ''
) ? '/' :
ltrim($uri, '/'
);
} /**
* Provides a convenient way to work with the Negotiate class
* for content negotiation.
*/
public function negotiate(string
$type, array
$supported, bool
$strictMatch = false
): string
{ if ($this->negotiator === null
) { $this->negotiator = Services::
negotiator($this, true
);
} switch (strtolower($type)) { case 'media':
return $this->negotiator->
media($supported,
$strictMatch);
case 'charset':
return $this->negotiator->
charset($supported);
case 'encoding':
return $this->negotiator->
encoding($supported);