Refactoring Utils

This removes duplication regarding the `calculateIndent` function, adds missing docblocks, and adds tests for the `calculateIndent` function too.
Thats what happens when private methods move to Utils. It was created to
calculate indent from whitespace.
What do you suggest to change?
The example code you gave will not be a single token whitespace. Same as
with the countDocblockLines perhaps a token should be passed instead and
check for correct token type.
Op 19 dec. 2014 08:37 schreef "Dariusz Rumiński" <notifications@github.com>:

> In Symfony/CS/Utils.php
> <https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/904#discussion-diff-22092943>
> :
>
> >      public static function splitLines($content)
> >      {
> >          preg_match_all("/[^\n\r]+[\r\n]*/", $content, $matches);
> >
> >          return $matches[0];
> >      }
> > +
> > +    /**
> > +     * Calculate used indentation in whitespace.
> > +     *
> > +     * What we're doing here is grabbing everything after the final newline.
> > +     *
> > +     * @param string $content
> > +     *
> > +     * @return string
> > +     */
> > +    public static function calculateIndent($content)
>
> I am not talking about how it works, but how I think it would work after
> reading it's name...
>
> And I dont't even need to pass a whitespace token here...
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/904/files#r22092943>.
>