Added Lines Before Namespace Fixers

NoBlankLinesBeforeNamespaceFixer is a contrib level fixer, and OneBlankLinesBeforeNamespaceFixer is a symfony level fixer. This also includes some utils refactoring and improvements.
Countlines is not merged yet, so can be changed berore that already


splitLines name change would have to wait for 2.0 indeed


2014-12-17 23:55 GMT+01:00 Graham Campbell <notifications@github.com>:
>
> In Symfony/CS/Utils.php
> <https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/879#discussion-diff-22011917>
> :
>
> >      public static function splitLines($content)
> >      {
> >          preg_match_all("/[^\n\r]+[\r\n]*/", $content, $matches);
> >
> >          return $matches[0];
> >      }
> > +
> > +    /**
> > +     * Count the number of lines in a string.
> > +     *
> > +     * @param string $content
> > +     *
> > +     * @return int
> > +     */
> > +    public static function countLines($content)
>
> Actually, the function can't be renamed, sorry. It's already part of the
> public api as of 1.4. It can only be changed in 2.0.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/879/files#r22011917>.
>