Skip to content
Snippets Groups Projects
Commit 4caabb58 authored by Demian Katz's avatar Demian Katz
Browse files

Smarter caching of php-cs-fixer results.

parent b34d21cd
Branches
Tags
No related merge requests found
...@@ -3,8 +3,7 @@ ...@@ -3,8 +3,7 @@
ChangeLog ChangeLog
\#* \#*
.\#* .\#*
.php_cs.cache .php_cs_cache
.php_cs_template.cache
TAGS TAGS
*~ *~
/downloads /downloads
...@@ -14,4 +13,4 @@ composer.phar ...@@ -14,4 +13,4 @@ composer.phar
import/solrmarc.log import/solrmarc.log
node_modules node_modules
public/swagger-ui public/swagger-ui
.vagrant .vagrant
\ No newline at end of file
...@@ -17,6 +17,7 @@ before_script: ...@@ -17,6 +17,7 @@ before_script:
cache: cache:
directories: directories:
- downloads - downloads
- .php_cs_cache
- $HOME/.composer/cache/files - $HOME/.composer/cache/files
script: script:
......
...@@ -65,6 +65,12 @@ $rules = [ ...@@ -65,6 +65,12 @@ $rules = [
'visibility_required' => true, 'visibility_required' => true,
]; ];
$cacheDir = __DIR__ . '/../.php_cs_cache';
if (!is_dir($cacheDir)) {
mkdir($cacheDir);
}
return PhpCsFixer\Config::create() return PhpCsFixer\Config::create()
->setCacheFile($cacheDir . '/.code.cache')
->setRules($rules) ->setRules($rules)
->setFinder($finder); ->setFinder($finder);
...@@ -62,7 +62,12 @@ $rules = [ ...@@ -62,7 +62,12 @@ $rules = [
'visibility_required' => true, 'visibility_required' => true,
]; ];
$cacheDir = __DIR__ . '/../.php_cs_cache';
if (!is_dir($cacheDir)) {
mkdir($cacheDir);
}
return PhpCsFixer\Config::create() return PhpCsFixer\Config::create()
->setCacheFile(__DIR__ . '/../.php_cs_template.cache') ->setCacheFile($cacheDir . '/.template.cache')
->setRules($rules) ->setRules($rules)
->setFinder($finder); ->setFinder($finder);
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment