Skip to content

Commit

Permalink
Merge pull request #12 from janlam7/phpcs-tool-9
Browse files Browse the repository at this point in the history
Update phpcs-tool to 9.1.0 with Hostnet-Level-1
  • Loading branch information
janlam7 authored May 4, 2022
2 parents 8ee49f8 + 539b94d commit 2b546ca
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 27 deletions.
49 changes: 25 additions & 24 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,29 @@ name: CI
on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
php-versions: ['7.3', '7.4', '8.0']
name: PHP ${{ matrix.php-versions }}
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: composer install
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: phpunit
run: php vendor/bin/phpunit
test:
runs-on: ubuntu-latest

strategy:
matrix:
php-versions: ['7.3', '7.4', '8.0']
name: PHP ${{ matrix.php-versions }}
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: composer install
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: phpunit
run: php vendor/bin/phpunit
- name: phpcs
run: php vendor/bin/phpcs
8 changes: 7 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"symfony/http-kernel": "^4.4||^5.0"
},
"require-dev": {
"hostnet/phpcs-tool": "^8.3.17",
"hostnet/phpcs-tool": "^9.1.0",
"phpunit/phpunit": "^9.5.6",
"symfony/framework-bundle": "^4.4||^5.0",
"symfony/twig-bundle": "^4.4||^5.0",
Expand All @@ -26,6 +26,12 @@
"Hostnet\\Bundle\\FinancialTwigExtensionBundle\\": "test/"
}
},
"config": {
"allow-plugins": {
"hostnet/*": true,
"dealerdirect/phpcodesniffer-composer-installer": false
}
},
"archive": {
"exclude": [
"/test"
Expand Down
4 changes: 4 additions & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0"?>
<ruleset name="financial-twig-extension-bundle PHPCS">
<rule ref="Hostnet-Level-1"/>
</ruleset>
4 changes: 2 additions & 2 deletions test/Functional/Fixtures/TestKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ public function registerContainerConfiguration(LoaderInterface $loader)
$loader->load(__DIR__ . '/config/config.yml');
}

public function getLogDir()
public function getLogDir(): string
{
return __DIR__ . '/../../../var/log';
}

public function getCacheDir()
public function getCacheDir(): string
{
return __DIR__ . '/../../../var/cache';
}
Expand Down

0 comments on commit 2b546ca

Please sign in to comment.