Skip to content

Commit

Permalink
PHP 7.3 compatibility (#117)
Browse files Browse the repository at this point in the history
* Improve typehint & match styleguide

* fix: checkbox with bracket name notation

* build: update correct versions

* syntax: remove typed properties for 7.3 compliance
  • Loading branch information
g105b authored Nov 13, 2021
1 parent 22065a0 commit 7f073ba
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
path: /tmp/composer-cache
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}

- uses: php-actions/composer@v5
- uses: php-actions/composer@v6

- name: Archive build
run: mkdir /tmp/github-actions/ && tar -cvf /tmp/github-actions/build.tar ./
Expand All @@ -40,9 +40,9 @@ jobs:
run: tar -xvf /tmp/github-actions/build.tar ./

- name: PHP Unit tests
uses: php-actions/phpunit@v2
uses: php-actions/phpunit@v3
with:
php_version: 8.0
php_version: 7.3
php_extensions: xdebug
configuration: test/phpunit/phpunit.xml
bootstrap: vendor/autoload.php
Expand All @@ -61,6 +61,6 @@ jobs:
run: tar -xvf /tmp/github-actions/build.tar ./

- name: PHP Static Analysis
uses: php-actions/phpstan@v2
uses: php-actions/phpstan@v3
with:
path: src/
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "library",

"require": {
"php": ">=7.4"
"php": ">=7.3"
},

"require-dev": {
Expand All @@ -26,7 +26,7 @@
"Gt\\CssXPath\\Test\\": "./test/phpunit"
}
},

"authors": [
{
"name": "Greg Bowler",
Expand All @@ -35,7 +35,7 @@
"role": "Developer"
}
],

"funding": [
{
"type": "github",
Expand Down
6 changes: 4 additions & 2 deletions src/Translator.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ class Translator {
const EQUALS_STARTS_WITH_OR_STARTS_WITH_HYPHENATED = "|=";
const EQUALS_STARTS_WITH = "^=";

protected string $cssSelector;
protected string $prefix;
/** @var string */
protected $cssSelector;
/** @var string */
protected $prefix;

public function __construct(string $cssSelector, string $prefix = ".//") {
$this->cssSelector = $cssSelector;
Expand Down

0 comments on commit 7f073ba

Please sign in to comment.