Skip to content

Commit 1d1c320

Browse files
authored
Merge branch 'master' into types
2 parents d8c4a6c + ccaa842 commit 1d1c320

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
}
2828
},
2929
"require": {
30-
"php": "^7.2"
30+
"php": "^7.2",
31+
"ext-json": "*"
3132
},
3233
"require-dev": {
3334
"phpunit/phpunit": "^7 || ^8.2"

composer.lock

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/CssLint/Linter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ protected function lintPropertyNameChar(string $sChar): ?bool
365365
// Check if property name exists
366366
$sPropertyName = trim($this->getContextContent());
367367

368-
if (!$this->getCssLintProperties()->propertyExists($sPropertyName)) {
368+
if (!$this->getCssLintProperties()::propertyExists($sPropertyName)) {
369369
$this->addError('Unknown CSS property "' . $sPropertyName . '"');
370370
}
371371
$this->setContext(self::CONTEXT_PROPERTY_CONTENT);

src/CssLint/Properties.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Properties
99
* List of existing constructor prefix
1010
* @var array
1111
*/
12-
protected $constructors = array(
12+
protected static $constructors = array(
1313
'ms', 'moz', 'webkit', 'o',
1414
);
1515

@@ -18,7 +18,7 @@ class Properties
1818
* https://www.w3.org/Style/CSS/all-properties.en.html
1919
* @var array
2020
*/
21-
protected $standards = array(
21+
protected static $standards = array(
2222
'align-content' => '',
2323
'align-items' => '',
2424
'align-self' => '',
@@ -451,7 +451,7 @@ class Properties
451451
* List of non standards properties
452452
* @var array
453453
*/
454-
protected $nonStandards = array(
454+
protected static $nonStandards = array(
455455
'font-smoothing' => '',
456456
'interpolation-mode' => '',
457457
'osx-font-smoothing' => '',
@@ -464,18 +464,18 @@ class Properties
464464
* @param string $sProperty
465465
* @return boolean
466466
*/
467-
public function propertyExists(string $sProperty): bool
467+
public static function propertyExists(string $sProperty): bool
468468
{
469-
if (isset($this->standards[$sProperty])) {
469+
if (isset(static::$standards[$sProperty])) {
470470
return true;
471471
}
472472

473-
$sPropertyWithoutConstructor = preg_replace('/^(-(' . join('|', $this->constructors) . ')-)/', '', $sProperty);
473+
$sPropertyWithoutConstructor = preg_replace('/^(-(' . join('|', static::$constructors) . ')-)/', '', $sProperty);
474474
if ($sPropertyWithoutConstructor !== $sProperty) {
475-
if (isset($this->standards[$sPropertyWithoutConstructor])) {
475+
if (isset(static::$standards[$sPropertyWithoutConstructor])) {
476476
return true;
477477
}
478-
if (isset($this->nonStandards[$sPropertyWithoutConstructor])) {
478+
if (isset(static::$nonStandards[$sPropertyWithoutConstructor])) {
479479
return true;
480480
}
481481
}

0 commit comments

Comments
 (0)