/** * @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]; }
private function cleanKey($key) { return StringUtil::canonicalizeName($key); }
/** @test */ public function canCanonicalizeName() { $string = 'This is a string with -,_'; $expected = 'thisisastringwith'; $this->assertEquals($expected, StringUtil::canonicalizeName($string)); }