Example #1
0
 /**
  * @param string $name
  * @return Segment
  */
 public function getSegment($name = self::DEFAULT_SEGMENT_NAME)
 {
     $name = StringUtil::canonicalizeName($name);
     if (!isset($this->segments[$name])) {
         $this->segments[$name] = new Segment($name, $this->session);
     }
     return $this->segments[$name];
 }
Example #2
0
 private function cleanKey($key)
 {
     return StringUtil::canonicalizeName($key);
 }
Example #3
0
 /** @test */
 public function canCanonicalizeName()
 {
     $string = 'This is a string with -,_';
     $expected = 'thisisastringwith';
     $this->assertEquals($expected, StringUtil::canonicalizeName($string));
 }