Why you think it is overkill? How would I implement it with explode?


2014-03-22 2:12 GMT+02:00 Dionysis Zindros <notifications@github.com>:

> In models/migration.php:
>
> > +            }
> > +            if ( empty( $env ) ) {
> > +                $environments = [ 'development', 'test' ];
> > +                $last = [];
> > +                foreach ( $environments as $env ) {
> > +                    $last[ $env ] = self::getLast( $env, $logs );
> > +                }
> > +                return $last;
> > +            }
> > +            else {
> > +                return self::getLast( $env, $logs );
> > +            }
> > +        }
> > +
> > +        protected static function getLast( $env, $logs ) {
> > +            $result = preg_split( "/$env:/", $logs );
>
> Regexp is overkill; use explode
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/dionyziz/endofcodes/pull/147/files#r10859093>
> .
>