Skip to content

Commit f907e70

Browse files
committed
Initial commit
1 parent ff4902f commit f907e70

24 files changed

+2329
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.DS_Store
2+
.idea
3+
vendor

.styleci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
preset: psr2
2+
3+
linting: true

bin/phpcs-diff

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env php
2+
<?php
3+
/**
4+
* phpcs-diff detects violations of a defined coding standard based on a git diff.
5+
*
6+
* @author Oliver Tappin <olivertappin@gmail.com>
7+
* @license https://github.com/olivertappin/phpcs-diff/blob/master/licence.txt BSD Licence
8+
*/
9+
10+
if (is_file(__DIR__ . '/../autoload.php') === true) {
11+
include_once __DIR__ . '/../autoload.php';
12+
} else {
13+
include_once 'vendor/autoload.php';
14+
}
15+
16+
$climate = new League\CLImate\CLImate();
17+
18+
$phpcsDiff = new PhpcsDiff\PhpcsDiff($argv, $climate);
19+
$phpcsDiff->run();
20+
exit($phpcsDiff->getExitCode());

composer.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "phpcs-diff",
3+
"description": "Detects violations of a defined coding standard based on a git diff.",
4+
"require": {
5+
"squizlabs/php_codesniffer": "*",
6+
"league/climate": "^3.4"
7+
},
8+
"require-dev": {
9+
"phpunit/phpunit": "^7.3"
10+
},
11+
"autoload": {
12+
"psr-4": {
13+
"PhpcsDiff\\": "src/"
14+
}
15+
},
16+
"autoload-dev": {
17+
"psr-4": {
18+
"PhpcsDiff\\Tests\\": "tests/"
19+
}
20+
},
21+
"scripts": {
22+
"test": "phpunit"
23+
}
24+
}

0 commit comments

Comments
 (0)