protected function checkValidSlug($slug)
    {
        if (preg_match_all('#^([a-z,A-Z,0-9,\-,_]*)(.+)?$#', $slug, $matches)
            && (strlen($matches[2][0]) > 0)
        ) {
            throw new \RuntimeException(
                sprintf(
                    'Error: prefix "%s" is invalid. It must only contain letters, numbers, underscores and hyphens. ' .
                    'Found problem near: "%s"',
                    $slug,
                    $matches[2][0]
                )
            );
        }
    }
protected function checkValidSlug($slug)
    {
        if (preg_match_all('#^([a-z,A-Z,0-9,\-,_]*)(.+)?$#', $slug, $matches)
            && (strlen($matches[2][0]) > 0)
        ) {
            throw new \RuntimeException(
                sprintf(
                    'Error: prefix "%s" is invalid. It must only contain letters, numbers, underscores and hyphens. ' .
                    'Found problem near: "%s"',
                    $slug,
                    $matches[2][0]
                )
            );
        }
    }
protected function checkValidSlug ( $ slug ) { if ( preg_match_all ( '#^([a-z,A-Z,0-9,\-,_]*)(.+)?$#' , $ slug , $ matches ) && ( strlen ( $ matches [ 2 ] [ 0 ] ) > 0 ) ) { throw new \ RuntimeException ( sprintf ( 'Error: prefix "%s" is invalid. It must only contain letters, numbers, underscores and hyphens. ' . 'Found problem near: "%s"' , $ slug , $ matches [ 2 ] [ 0 ] ) ) ; } }
Check that the passed project slug complies to the transifex restrictions.

@param string $slug The slug to test.

@return void

@throws \RuntimeException When the slug is invalid, an exception is thrown.
Check that the passed project slug complies to the transifex restrictions .