Copied!

Collection of methods for parsing Segments.

  • internal
CloneableInstantiable
Methods
public static parseSegments(?string $path = NULL)
 

Parses a path into an array of segments.

  • param string|null $path
  • return array
  • throws \ValidationException
Methods
private static isValidLiteral(string $literal)
 

Check if $literal is a valid segment literal. Segment literals may only contain numbers, letters, and any of the following: .-~_

  • param string $literal
  • return bool
private static parse(string $segmentString, string $path, int $index)
 
  • param string $segmentString
  • param string $path
  • param int $index
  • return \Segment
  • throws \ValidationException
private static parseError(string $path, int $index, string $reason)
private static parseLiteralFromPath(string $literal, string $path, int $index)
 
  • param string $literal
  • param string $path
  • param int $index
  • return string
  • throws \ValidationException
private static parseSegmentFromPath(string $path, string $nextLiteral, int $index)
 

Given a path and an index, reads a Segment from the path and updates the index.

  • param string $path
  • param string $nextLiteral
  • param int $index
  • return \Segment
  • throws \ValidationException
private static parseVariableSegment(string $segmentStringWithoutBraces, string $separatorLiteral)
 
  • param string $segmentStringWithoutBraces
  • param string $separatorLiteral
  • return \Segment
  • throws \ValidationException
Methods
private static isValidLiteral(string $literal)
 

Check if $literal is a valid segment literal. Segment literals may only contain numbers, letters, and any of the following: .-~_

  • param string $literal
  • return bool
private static parse(string $segmentString, string $path, int $index)
 
  • param string $segmentString
  • param string $path
  • param int $index
  • return \Segment
  • throws \ValidationException
private static parseError(string $path, int $index, string $reason)
private static parseLiteralFromPath(string $literal, string $path, int $index)
 
  • param string $literal
  • param string $path
  • param int $index
  • return string
  • throws \ValidationException
private static parseSegmentFromPath(string $path, string $nextLiteral, int $index)
 

Given a path and an index, reads a Segment from the path and updates the index.

  • param string $path
  • param string $nextLiteral
  • param int $index
  • return \Segment
  • throws \ValidationException
public static parseSegments(?string $path = NULL)
 

Parses a path into an array of segments.

  • param string|null $path
  • return array
  • throws \ValidationException
private static parseVariableSegment(string $segmentStringWithoutBraces, string $separatorLiteral)
 
  • param string $segmentStringWithoutBraces
  • param string $separatorLiteral
  • return \Segment
  • throws \ValidationException
© 2025 Bruce Wells
Search Namespaces \ Classes
Configuration