예제 #1
0
파일: Parser.php 프로젝트: lucidphp/xml
 /**
  * Convert hyphens to underscores.
  *
  * @param string $name
  *
  * @return string
  */
 public static function fixNodeName($name)
 {
     return strtr(Str::snakeCase($name), ['-' => '_']);
 }
예제 #2
0
파일: StrTest.php 프로젝트: lucidphp/common
 /**
  * @test
  * @dataProvider strrandLengthProvider
  */
 public function strquickRand($length)
 {
     $this->assertSame($length, strlen(Str::quickRand($length)));
 }
예제 #3
0
파일: Normalizer.php 프로젝트: lucidphp/xml
 /**
  * normalizeString
  *
  * @param string $string
  *
  * @return string
  */
 protected function normalizeString($string)
 {
     $value = $this->isAllUpperCase($string) ? strtolower(trim($string, '_-#$%')) : Str::snakeCase(trim($string, '_-#$%'));
     return strtolower(preg_replace('/[^a-zA-Z0-9(^@)]+/', '-', $value));
 }