Skip to content

Commit 41f85e8

Browse files
committed
feat: add support for PHP 8.2
1 parent 6583c4e commit 41f85e8

File tree

5 files changed

+32
-5
lines changed

5 files changed

+32
-5
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
version: 2
22
updates:
33
- package-ecosystem: composer
4+
versioning-strategy: widen
45
directory: "/"
56
schedule:
67
interval: weekly
78
day: friday
89
time: "04:00"
9-
versioning-strategy: increase
1010
- package-ecosystem: github-actions
1111
directory: "/"
1212
schedule:

.github/workflows/continuous-integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ jobs:
1313
strategy:
1414
matrix:
1515
include:
16-
- php-versions: "7.4"
1716
- php-versions: "8.0"
1817
- php-versions: "8.1"
18+
- php-versions: "8.2"
1919
stable: true
2020

2121
runs-on: ubuntu-latest

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
</p>
44

55
[![Continuous integration](https://github.com/neilime/php-css-lint/workflows/Continuous%20integration/badge.svg)](https://github.com/neilime/php-css-lint/actions?query=workflow%3A%22Continuous+integration%22)
6-
[![codecov](https://codecov.io/gh/neilime/php-css-lint/branch/master/graph/badge.svg?token=eMuwgNub7Z)](https://codecov.io/gh/neilime/php-css-lint)
6+
[![codecov](https://codecov.io/gh/neilime/php-css-lint/branch/main/graph/badge.svg?token=eMuwgNub7Z)](https://codecov.io/gh/neilime/php-css-lint)
77
[![Latest Stable Version](https://poser.pugx.org/neilime/php-css-lint/v/stable)](https://packagist.org/packages/neilime/php-css-lint)
88
[![Total Downloads](https://poser.pugx.org/neilime/php-css-lint/downloads)](https://packagist.org/packages/neilime/php-css-lint)
99
[![License](https://poser.pugx.org/neilime/php-css-lint/license)](https://packagist.org/packages/neilime/php-css-lint)
@@ -49,7 +49,7 @@
4949

5050
## Setup
5151

52-
`PHP_VERSION` is the version of php to use during the development. Example: `8.1`
52+
`PHP_VERSION` is the version of php to use during the development. Example: `8.2`
5353

5454
```sh
5555
make build-php PHP_VERSION

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@
2323
"issues": "https://github.com/neilime/php-css-lint/issues"
2424
},
2525
"require": {
26-
"php": "^7.4 || ^8",
26+
"php": ">=8.0",
2727
"ext-json": "*"
2828
},
2929
"require-dev": {
30+
"mikey179/vfsstream": "^1.6",
3031
"pcov/clobber": "^2.0",
3132
"phpstan/extension-installer": "^1.1",
3233
"phpstan/phpstan": "^0.12",

tests/TestSuite/LinterTest.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
namespace TestSuite;
44

5+
use org\bovigo\vfs\vfsStream;
6+
use org\bovigo\vfs\vfsStreamDirectory;
7+
use org\bovigo\vfs\vfsStreamFile;
8+
59
class LinterTest extends \PHPUnit\Framework\TestCase
610
{
711
/**
@@ -14,6 +18,11 @@ class LinterTest extends \PHPUnit\Framework\TestCase
1418
*/
1519
protected $phpVersion;
1620

21+
/**
22+
* @var vfsStreamDirectory
23+
*/
24+
private $root;
25+
1726
protected function setUp(): void
1827
{
1928
$this->linter = new \CssLint\Linter();
@@ -23,6 +32,8 @@ protected function setUp(): void
2332
} else {
2433
$this->phpVersion = '7';
2534
}
35+
36+
$this->root = vfsStream::setup('testDir');
2637
}
2738

2839
public function testConstructWithCustomCssLintProperties()
@@ -157,6 +168,21 @@ public function testLintFileWithUnknownFilePathParam()
157168
$this->linter->lintFile('wrong');
158169
}
159170

171+
public function testLintFileWithUnreadableFilePathParam()
172+
{
173+
$this->expectException(\InvalidArgumentException::class);
174+
$this->expectExceptionMessage('Argument "$sFilePath" "vfs://testDir/foo.txt" is not a readable file path');
175+
176+
$testFile = new vfsStreamFile('foo.txt', 0000);
177+
$this->root->addChild($testFile);
178+
179+
$fileToLint = $testFile->url();
180+
181+
$this->assertFileIsNotReadable($fileToLint);
182+
183+
$this->linter->lintFile($fileToLint);
184+
}
185+
160186
public function testLintBootstrapCssFile()
161187
{
162188
$this->assertTrue(

0 commit comments

Comments
 (0)