Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for PHP 8.2 #74

Merged
merged 1 commit into from
Dec 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
version: 2
updates:
- package-ecosystem: composer
versioning-strategy: widen
directory: "/"
schedule:
interval: weekly
day: friday
time: "04:00"
versioning-strategy: increase
- package-ecosystem: github-actions
directory: "/"
schedule:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
strategy:
matrix:
include:
- php-versions: "7.4"
- php-versions: "8.0"
- php-versions: "8.1"
- php-versions: "8.2"
stable: true

runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</p>

[![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)
[![codecov](https://codecov.io/gh/neilime/php-css-lint/branch/master/graph/badge.svg?token=eMuwgNub7Z)](https://codecov.io/gh/neilime/php-css-lint)
[![codecov](https://codecov.io/gh/neilime/php-css-lint/branch/main/graph/badge.svg?token=eMuwgNub7Z)](https://codecov.io/gh/neilime/php-css-lint)
[![Latest Stable Version](https://poser.pugx.org/neilime/php-css-lint/v/stable)](https://packagist.org/packages/neilime/php-css-lint)
[![Total Downloads](https://poser.pugx.org/neilime/php-css-lint/downloads)](https://packagist.org/packages/neilime/php-css-lint)
[![License](https://poser.pugx.org/neilime/php-css-lint/license)](https://packagist.org/packages/neilime/php-css-lint)
Expand Down Expand Up @@ -49,7 +49,7 @@

## Setup

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

```sh
make build-php PHP_VERSION
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@
"issues": "https://github.com/neilime/php-css-lint/issues"
},
"require": {
"php": "^7.4 || ^8",
"php": ">=8.0",
"ext-json": "*"
},
"require-dev": {
"mikey179/vfsstream": "^1.6",
"pcov/clobber": "^2.0",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^0.12",
Expand Down
26 changes: 26 additions & 0 deletions tests/TestSuite/LinterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

namespace TestSuite;

use org\bovigo\vfs\vfsStream;
use org\bovigo\vfs\vfsStreamDirectory;
use org\bovigo\vfs\vfsStreamFile;

class LinterTest extends \PHPUnit\Framework\TestCase
{
/**
Expand All @@ -14,6 +18,11 @@ class LinterTest extends \PHPUnit\Framework\TestCase
*/
protected $phpVersion;

/**
* @var vfsStreamDirectory
*/
private $root;

protected function setUp(): void
{
$this->linter = new \CssLint\Linter();
Expand All @@ -23,6 +32,8 @@ protected function setUp(): void
} else {
$this->phpVersion = '7';
}

$this->root = vfsStream::setup('testDir');
}

public function testConstructWithCustomCssLintProperties()
Expand Down Expand Up @@ -157,6 +168,21 @@ public function testLintFileWithUnknownFilePathParam()
$this->linter->lintFile('wrong');
}

public function testLintFileWithUnreadableFilePathParam()
{
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Argument "$sFilePath" "vfs://testDir/foo.txt" is not a readable file path');

$testFile = new vfsStreamFile('foo.txt', 0000);
$this->root->addChild($testFile);

$fileToLint = $testFile->url();

$this->assertFileIsNotReadable($fileToLint);

$this->linter->lintFile($fileToLint);
}

public function testLintBootstrapCssFile()
{
$this->assertTrue(
Expand Down