Skip to content

Commit b2e79c5

Browse files
committed
add some phpcs fixes
1 parent 7817de4 commit b2e79c5

File tree

3 files changed

+44
-3
lines changed

3 files changed

+44
-3
lines changed

.github/workflows/phpcs.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: PHP_CodeSniffer
2+
on: push
3+
jobs:
4+
phpcs:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- name: Checkout
8+
uses: actions/checkout@v2
9+
- name: Setup PHP
10+
uses: shivammathur/setup-php@v2
11+
with:
12+
php-version: '7.4'
13+
coverage: none
14+
tools: composer, cs2pr
15+
- name: Get Composer cache directory
16+
id: composer-cache
17+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
18+
- name: Setup cache
19+
uses: pat-s/always-upload-cache@v1.1.4
20+
with:
21+
path: ${{ steps.composer-cache.outputs.dir }}
22+
# Use the hash of composer.json as the key for your cache if you do not commit composer.lock.
23+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
24+
#key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
25+
restore-keys: ${{ runner.os }}-composer-
26+
- name: Install dependencies
27+
run: composer install --prefer-dist --no-progress
28+
- name: Detect coding standard violations
29+
run: ./vendor/bin/phpcs -n -q

composer.json

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "NodeInfo and NodeInfo2 for WordPress!",
44
"require": {
55
"php": ">=5.6.0",
6-
"composer/installers": "~1.0"
6+
"composer/installers": "^1.0 || ^2.0"
77
},
88
"type": "wordpress-plugin",
99
"license": "MIT",
@@ -17,7 +17,19 @@
1717
"installer-name": "nodeinfo"
1818
},
1919
"require-dev": {
20-
"phpunit/phpunit": "5.5.*"
20+
"phpunit/phpunit": "^5.7.21 || ^6.5 || ^7.5 || ^8",
21+
"phpcompatibility/php-compatibility": "*",
22+
"phpcompatibility/phpcompatibility-wp": "*",
23+
"squizlabs/php_codesniffer": "3.*",
24+
"wp-coding-standards/wpcs": "*",
25+
"yoast/phpunit-polyfills": "^1.0",
26+
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.1"
27+
},
28+
"config": {
29+
"allow-plugins": true
30+
},
31+
"allow-plugins": {
32+
"composer/installers": true
2133
},
2234
"scripts": {
2335
"test": [

includes/class-nodeinfo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function generate_metadata() {
9898
$metadata['generator'] = array(
9999
'name' => 'NodeInfo WordPress-Plugin',
100100
'version' => nodeinfo_version(),
101-
'repository' => 'https://github.com/pfefferle/wordpress-nodeinfo/'
101+
'repository' => 'https://github.com/pfefferle/wordpress-nodeinfo/',
102102
);
103103

104104
$this->metadata = apply_filters( 'nodeinfo_data_metadata', $metadata, $this->version );

0 commit comments

Comments
 (0)