Skip to content

Commit be46205

Browse files
committed
Move drupal standards to count as built in standards
1 parent 045be0a commit be46205

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

README.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,12 @@ Currently works primarly against Drupal
77

88
## Installation
99

10-
### Phar (recommended)
11-
12-
You may get dependency conflicts when using composer, so a phar installation is often easiest.
13-
1410
```
1511
wget https://github.com/smmccabe/phpdebt/releases/download/1.0.1/phpdebt.phar
1612
chmod +x phpdebt.phar
1713
sudo mv phpdebt.phar /usr/local/bin/phpdebt
1814
```
1915

20-
### Composer
21-
22-
```
23-
composer require smmccabe/phpdebt
24-
```
25-
2616
## Usage and Examples
2717

2818
Against a whole project

build.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
cp vendor/drupal/coder/coder_sniffer/Drupal/ vendor/squizlabs/php_codesniffer/src/Standards/ -r
4+
cp vendor/drupal/coder/coder_sniffer/DrupalPractice/ vendor/squizlabs/php_codesniffer/src/Standards/ -r
5+
./vendor/bin/phar-composer build .

src/index.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function phpMD($path, $type) {
4444

4545
$runner->config = new Config();
4646
$runner->config->files = [$path];
47-
$runner->config->standards = ['./vendor/drupal/coder/coder_sniffer/Drupal'];
47+
$runner->config->standards = ['Drupal'];
4848
$runner->config->extensions = [
4949
'php' => 'PHP',
5050
'module' => 'PHP',
@@ -63,7 +63,8 @@ function phpMD($path, $type) {
6363
print "phpcs Drupal: " . $faults . "\n";
6464
$standards_faults += $faults;
6565

66-
$runner->config->standards = ['./vendor/drupal/coder/coder_sniffer/DrupalPractice'];
66+
$runner->config->standards = ['DrupalPractice'];
67+
$runner->init();
6768
$faults = $runner->run();
6869
print "phpcs DrupalPractice: " . $faults . "\n";
6970
$standards_faults += $faults;

0 commit comments

Comments
 (0)