diff --git a/.travis.yml b/.travis.yml index c6ad6600..2d3418f6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,8 @@ php: - "5.3" - "5.5" - "5.6" + - "7.0" + - "nightly" - hhvm script: phpunit . diff --git a/README.md b/README.md index 2297e9f2..68833f65 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ If you want to manipulate a `RuleSet`, use the methods `addRule(Rule $oRule)`, ` * `Size` – consists of a numeric `size` value and a unit. * `Color` – colors can be input in the form #rrggbb, #rgb or schema(val1, val2, …) but are always stored as an array of ('s' => val1, 'c' => val2, 'h' => val3, …) and output in the second form. -* `String` – this is just a wrapper for quoted strings to distinguish them from keywords; always output with double quotes. +* `CSSString` – this is just a wrapper for quoted strings to distinguish them from keywords; always output with double quotes. * `URL` – URLs in CSS; always output in URL("") notation. There is another abstract subclass of `Value`, `ValueList`. A `ValueList` represents a lists of `Value`s, separated by some separation character (mostly `,`, whitespace, or `/`). There are two types of `ValueList`s: @@ -193,8 +193,8 @@ To see what you can do with output formatting, look at the tests in `tests/Sabbe [0]=> object(Sabberworm\CSS\Property\Charset)#6 (1) { ["sCharset":"Sabberworm\CSS\Property\Charset":private]=> - object(Sabberworm\CSS\Value\String)#5 (1) { - ["sString":"Sabberworm\CSS\Value\String":private]=> + object(Sabberworm\CSS\Value\CSSString)#5 (1) { + ["sString":"Sabberworm\CSS\Value\CSSString":private]=> string(5) "utf-8" } } @@ -211,8 +211,8 @@ To see what you can do with output formatting, look at the tests in `tests/Sabbe ["sRule":"Sabberworm\CSS\Rule\Rule":private]=> string(11) "font-family" ["mValue":"Sabberworm\CSS\Rule\Rule":private]=> - object(Sabberworm\CSS\Value\String)#9 (1) { - ["sString":"Sabberworm\CSS\Value\String":private]=> + object(Sabberworm\CSS\Value\CSSString)#9 (1) { + ["sString":"Sabberworm\CSS\Value\CSSString":private]=> string(10) "CrassRoots" } ["bIsImportant":"Sabberworm\CSS\Rule\Rule":private]=> @@ -228,8 +228,8 @@ To see what you can do with output formatting, look at the tests in `tests/Sabbe ["mValue":"Sabberworm\CSS\Rule\Rule":private]=> object(Sabberworm\CSS\Value\URL)#11 (1) { ["oURL":"Sabberworm\CSS\Value\URL":private]=> - object(Sabberworm\CSS\Value\String)#12 (1) { - ["sString":"Sabberworm\CSS\Value\String":private]=> + object(Sabberworm\CSS\Value\CSSString)#12 (1) { + ["sString":"Sabberworm\CSS\Value\CSSString":private]=> string(15) "../media/cr.ttf" } } @@ -469,8 +469,8 @@ To see what you can do with output formatting, look at the tests in `tests/Sabbe [1]=> string(9) "Helvetica" [2]=> - object(Sabberworm\CSS\Value\String)#14 (1) { - ["sString":"Sabberworm\CSS\Value\String":private]=> + object(Sabberworm\CSS\Value\CSSString)#14 (1) { + ["sString":"Sabberworm\CSS\Value\CSSString":private]=> string(9) "Gill Sans" } [3]=> diff --git a/lib/Sabberworm/CSS/CSSList/CSSBlockList.php b/lib/Sabberworm/CSS/CSSList/CSSBlockList.php index 55a594f5..0d504b0f 100644 --- a/lib/Sabberworm/CSS/CSSList/CSSBlockList.php +++ b/lib/Sabberworm/CSS/CSSList/CSSBlockList.php @@ -52,7 +52,7 @@ protected function allValues($oElement, &$aResult, $sSearchString = null, $bSear } } } else { - //Non-List Value or String (CSS identifier) + //Non-List Value or CSSString (CSS identifier) $aResult[] = $oElement; } } diff --git a/lib/Sabberworm/CSS/Parser.php b/lib/Sabberworm/CSS/Parser.php index c1b5ca27..6a9ca081 100644 --- a/lib/Sabberworm/CSS/Parser.php +++ b/lib/Sabberworm/CSS/Parser.php @@ -17,7 +17,7 @@ use Sabberworm\CSS\Value\Size; use Sabberworm\CSS\Value\Color; use Sabberworm\CSS\Value\URL; -use Sabberworm\CSS\Value\String; +use Sabberworm\CSS\Value\CSSString; use Sabberworm\CSS\Rule\Rule; use Sabberworm\CSS\Parsing\UnexpectedTokenException; @@ -139,7 +139,7 @@ private function parseAtRule() { if ($sPrefix !== null && !is_string($sPrefix)) { throw new \Exception('Wrong namespace prefix '.$sPrefix); } - if (!($mUrl instanceof String || $mUrl instanceof URL)) { + if (!($mUrl instanceof CSSString || $mUrl instanceof URL)) { throw new \Exception('Wrong namespace url of invalid type '.$mUrl); } return new CSSNamespace($mUrl, $sPrefix); @@ -214,7 +214,7 @@ private function parseStringValue() { } $this->consume($sQuote); } - return new String($sResult); + return new CSSString($sResult); } private function parseCharacter($bIsForIdentifier) { diff --git a/lib/Sabberworm/CSS/Value/String.php b/lib/Sabberworm/CSS/Value/CSSString.php similarity index 93% rename from lib/Sabberworm/CSS/Value/String.php rename to lib/Sabberworm/CSS/Value/CSSString.php index c68847e5..c583efd5 100644 --- a/lib/Sabberworm/CSS/Value/String.php +++ b/lib/Sabberworm/CSS/Value/CSSString.php @@ -2,7 +2,7 @@ namespace Sabberworm\CSS\Value; -class String extends PrimitiveValue { +class CSSString extends PrimitiveValue { private $sString; diff --git a/lib/Sabberworm/CSS/Value/URL.php b/lib/Sabberworm/CSS/Value/URL.php index 62de1029..9ececd52 100644 --- a/lib/Sabberworm/CSS/Value/URL.php +++ b/lib/Sabberworm/CSS/Value/URL.php @@ -7,11 +7,11 @@ class URL extends PrimitiveValue { private $oURL; - public function __construct(String $oURL) { + public function __construct(CSSString $oURL) { $this->oURL = $oURL; } - public function setURL(String $oURL) { + public function setURL(CSSString $oURL) { $this->oURL = $oURL; }