Skip to content

Commit d8c4a6c

Browse files
authored
Merge branch 'master' into types
2 parents 788a723 + d62ac24 commit d8c4a6c

File tree

5 files changed

+27
-13
lines changed

5 files changed

+27
-13
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "neilime/php-css-lint",
33
"type": "library",
4-
"description": "Powerfull & memory efficiant CSS linter for PHP",
4+
"description": "Powerful & memory efficient CSS linter for PHP",
55
"keywords": ["CSS", "lint", "linter", "syntax", "validation"],
66
"homepage": "https://neilime.github.io/php-css-lint/",
77
"license": "MIT",

composer.lock

Lines changed: 5 additions & 5 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: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Linter
1818
protected $cssLintProperties;
1919

2020
/**
21-
* Errors occured during the lint process
21+
* Errors occurred during the lint process
2222
* @var array
2323
*/
2424
protected $errors = array();
@@ -54,7 +54,7 @@ class Linter
5454
protected $previousChar;
5555

5656
/**
57-
* Tells if the linter is parsing a nested selecter. Ex: @media, @keyframes...
57+
* Tells if the linter is parsing a nested selector. Ex: @media, @keyframes...
5858
* @var boolean
5959
*/
6060
protected $nestedSelector = false;
@@ -108,7 +108,7 @@ public function lintFile(string $sFilePath): bool
108108

109109
$rFileHandle = fopen($sFilePath, 'r');
110110
if ($rFileHandle === false) {
111-
throw new \RuntimeException('An error occured while opening file "' . $sFilePath . '"');
111+
throw new \RuntimeException('An error occurred while opening file "' . $sFilePath . '"');
112112
}
113113

114114
$this->initLint();
@@ -121,7 +121,7 @@ public function lintFile(string $sFilePath): bool
121121
}
122122

123123
if (!feof($rFileHandle)) {
124-
throw new \RuntimeException('An error occured while reading file "' . $sFilePath . '"');
124+
throw new \RuntimeException('An error occurred while reading file "' . $sFilePath . '"');
125125
}
126126
fclose($rFileHandle);
127127

@@ -609,7 +609,7 @@ protected function addError($sError): Linter
609609
}
610610

611611
/**
612-
* Return the errors occured during the lint process
612+
* Return the errors occurred during the lint process
613613
* @return array
614614
*/
615615
public function getErrors(): ?array

src/CssLint/Properties.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class Properties
66
{
77

88
/**
9-
* List of exsiting constructor prefix
9+
* List of existing constructor prefix
1010
* @var array
1111
*/
1212
protected $constructors = array(

tests/TestSuite/LinterTest.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,21 @@ public function testLintStringWithWrongSelectorUnexpectedToken()
9393
), $this->linter->getErrors());
9494
}
9595

96-
public function testLintFileWithUnkownFilePathParam()
96+
public function testLintStringWithWrongTypeParam()
97+
{
98+
$this->expectException(\InvalidArgumentException::class);
99+
$this->expectExceptionMessage('Argument "$sString" expects a string, "boolean" given');
100+
$this->linter->lintString(false);
101+
}
102+
103+
public function testLintFileWithWrongTypeParam()
104+
{
105+
$this->expectException(\InvalidArgumentException::class);
106+
$this->expectExceptionMessage('Argument "$sFilePath" expects a string, "boolean" given');
107+
$this->linter->lintFile(false);
108+
}
109+
110+
public function testLintFileWithUnknownFilePathParam()
97111
{
98112
$this->expectException(\InvalidArgumentException::class);
99113
$this->expectExceptionMessage('Argument "$sFilePath" "wrong" is not an existing file path');

0 commit comments

Comments
 (0)