I had to split the action of minification into a separate
method because recursively importing files requires them
to also be minified, and I don't want that one to write
to a file.
I assumed it would be able to access the protected property
because we're in one from the same class, so it know the
business logic.
But we're in a closure which, in PHP5.3, doesn't inherit that
scope (which was exactly what I wanted to solve)
Let's just pass it the array, since I don't want to go making
that property public.
* Let everything go through move(), even if the file is not being
written elsewhere (it also does some cleanup)
* Reorder minify statements: string/comment parsing should come first
* Update test with url() that makes no sense
* Update same test to escape as intended (double-escape would’ve been needed)
Unless they're preceded/followed by whitespace (which is
already stripped around most operators) or ; or {}, a
keyword is likely not a keyword, but a key of an object.
Fixes issue #33
em is not only a unit, it's also an element, so it can be
(part of) a selector.
The regex was incomplete as it would be stripping 'em'
occurences even if it's not immediately preceded by 0
(because of the many for a 0 can come in: -0, 0, .0, ...)
Fixes bug #31
I originally executed this on content where string had not yet been replaced.
Because this could cause false positives and match content inside strings, I
switched it to be executed after strings had been extracted.
However, this means those array key texts were also replaced, by something that
always looks like a valid variable. I've now moved that check to match the
extracted value, which we'll be replacing.
Both from and/or to can be nothing (when fed plain content
instead of reading from a file, or when just returning content
instead of writing to new file)
In those cases, realpath() wouldn't make sense and would just
return the `pwd`, converting paths relative to whatever PHP
script is running.
Had to split the regex into 2 separate ones; the possible
@import syntaxes made it impossible to be strict on having
" or ' inside url(), which made it impossible to be strict
on the media.