Example #1
0
 /**
  * Convert hyphens to underscores.
  *
  * @param string $name
  *
  * @return string
  */
 public static function fixNodeName($name)
 {
     return strtr(Str::snakeCase($name), ['-' => '_']);
 }
Example #2
0
 /**
  * @test
  * @dataProvider strrandLengthProvider
  */
 public function strquickRand($length)
 {
     $this->assertSame($length, strlen(Str::quickRand($length)));
 }
Example #3
0
 /**
  * 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));
 }