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