/
SettingsFactory.php
52 lines (46 loc) · 1.34 KB
/
SettingsFactory.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
namespace Swis\GoT\Settings;
use Swis\GoT\Parsers\Behat;
use Swis\GoT\Parsers\Codeception;
use Swis\GoT\Parsers\JavaScript\AvaTape;
use Swis\GoT\Parsers\JavaScript\JasmineJestMocha;
use Swis\GoT\Parsers\JavaScript\QUnit;
use Swis\GoT\Parsers\PhpUnit;
use Swis\GoT\Parsers\SCSS;
use Swis\GoT\Settings;
class SettingsFactory
{
/**
* @param bool $loadDefaultSettings Load default settings
* @return \Swis\GoT\Settings|\Swis\GoT\Settings\DefaultSettings
*/
public static function create($loadDefaultSettings = true)
{
$settings = new Settings();
if ($loadDefaultSettings === true) {
$settings->setAvailableParsers([
Behat::class,
Codeception::class,
PhpUnit::class,
AvaTape::class,
JasmineJestMocha::class,
QUnit::class,
SCSS::class,
]);
$settings->setSkipPaths([
'bower_components/',
'node_modules/',
'vendor/',
'libs/',
'tests/_support/',
'workbench/',
'tests/ExampleTest.php',
]);
$settings->setRepositoryStoragePath(rtrim(
sys_get_temp_dir(),
'/\\'
) . DIRECTORY_SEPARATOR);
}
return $settings;
}
}