Skip to content

Commit

Permalink
add composer script
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilex Ng committed Jan 18, 2018
1 parent 8886835 commit 7540f58
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 4 deletions.
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/tests export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/phpunit.xml export-ignore
/changelog.md export-ignore
/readme.md export-ignore
/docs export-ignore
13 changes: 13 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

$finder = PhpCsFixer\Finder::create()
->in(__DIR__.'/src')
->in(__DIR__.'/tests')
;

return PhpCsFixer\Config::create()
->setRules([
'@PSR2' => true,
])
->setFinder($finder)
->setCacheFile(__DIR__.'/cache/.php_cs.cache');
16 changes: 16 additions & 0 deletions .sami
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

use Sami\Sami;
use Symfony\Component\Finder\Finder;

$srcDir = __DIR__ . '/src';
$iterator = Finder::create()
->files()
->name('*.php')
->in($srcDir);

$options = [
'build_dir' => __DIR__ . '/docs',
'cache_dir' => __DIR__ . '/cache/sami_doc',
];
return new Sami($iterator, $options);
17 changes: 13 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
"license": "MIT",
"autoload": {
"psr-4": {
"Ilex\\ChangeLog\\": "src/ChangeLog"
"Ilex\\ChangeLog\\": "src"
}
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.10",
"squizlabs/php_codesniffer": "^3.2"
"squizlabs/php_codesniffer": "3.1.1",
"phpunit/phpunit": "^6.5"
},
"config": {
"sort-packages": true
Expand All @@ -25,8 +26,16 @@
"@phpcs",
"@test"
],
"cs-fix": "php-cs-fixer fix src --rules=@PSR2",
"phpcs": "phpcs --standard=PSR2 src",
"dev":[
"clear",
"@cs-fix",
"@phpcs",
"@test-dev"
],
"cs-fix": "php-cs-fixer fix",
"phpcs": "phpcs --standard=PSR2 src tests",
"docs" : "@php ./sami.phar update .sami",
"test-dev" : "phpunit --coverage-text",
"test": "phpunit"
},
"scripts-descriptions": {
Expand Down

0 comments on commit 7540f58

Please sign in to comment.