src/Convert.php
/**
     * Detects word separator of $input string and tells you what strategy you should use.
     *
     * @param string $input String to be analysed
     *
     * @throws \Jawira\CaseConverter\CaseConverterException
     * @return \Jawira\CaseConverter\Split\Splitter
     */
Detects word separator of $input string and tells you what strategy you should use.
@param string $input String to be analysed


Detects word separator of $input string and tells you what strategy you should use . @param string $input String to be analysed
protected function analyse(string $input): Splitter
    {
        switch (true) {
            case $this->contains($input, UnderscoreGluer::DELIMITER):
                $splittingStrategy = new UnderscoreSplitter($input);
                break;
            case $this->contains($input, DashGluer::DELIMITER):
                $splittingStrategy = new DashSplitter($input);
                break;
            case $this->contains($input, SpaceGluer::DELIMITER):
                $splittingStrategy = new SpaceSplitter($input);
                break;
            case $this->contains($input, DotNotation::DELIMITER):
                $splittingStrategy = new DotSplitter($input);
                break;
            case $this->isUppercaseWord($input):
                $splittingStrategy = new UnderscoreSplitter($input);
                break;
            default:
                $splittingStrategy = new UppercaseSplitter($input);
                break;
        }
        return $splittingStrategy;
    }
protected function analyse ( string $ input ) : Splitter { switch ( true ) { case $ this -> contains ( $ input , UnderscoreGluer :: DELIMITER ) : $ splittingStrategy = new UnderscoreSplitter ( $ input ) ; break ; case $ this -> contains ( $ input , DashGluer :: DELIMITER ) : $ splittingStrategy = new DashSplitter ( $ input ) ; break ; case $ this -> contains ( $ input , SpaceGluer :: DELIMITER ) : $ splittingStrategy = new SpaceSplitter ( $ input ) ; break ; case $ this -> contains ( $ input , DotNotation :: DELIMITER ) : $ splittingStrategy = new DotSplitter ( $ input ) ; break ; case $ this -> isUppercaseWord ( $ input ) : $ splittingStrategy = new UnderscoreSplitter ( $ input ) ; break ; default : $ splittingStrategy = new UppercaseSplitter ( $ input ) ; break ; } return $ splittingStrategy ; }
Detects word separator of $input string and tells you what strategy you should use.
Detects word separator of $input string and tells you what strategy you should use .