PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / 2.15.3
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder v2.15.3
3.3.1 V-3.3.0 3.2.2 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 V3.0.3 V3.0.2 -3.0.1 V_3.0.0 1.1.1 1.1.8 1.2 1.3 1.4 1.4.18 1.5.2 1.9 2.0 2.10.0 2.10.1 All 138 releases
bit-form / vendor / typisttech / imposter / src / ProjectConfig.php

ProjectConfig.php in Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder 2.15.3, at vendor/typisttech/imposter/src/ProjectConfig.php

62 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare(strict_types=1);
4
5 namespace TypistTech\Imposter;
6
7 use UnexpectedValueException;
8
9 class ProjectConfig extends Config implements ProjectConfigInterface
10 {
11 /**
12 * @var string[]
13 */
14 protected const DEFAULT_EXCLUDES = ['typisttech/imposter'];
15
16 /**
17 * @var string[]
18 */
19 private $extraExcludes = [];
20
21 /**
22 * @return string[]
23 */
24 public function getExcludes(): array
25 {
26 $extra = $this->get('extra');
27 $excludes = $extra['imposter']['excludes'] ?? [];
28
29 return array_merge(static::DEFAULT_EXCLUDES, $excludes, $this->extraExcludes);
30 }
31
32 public function getImposterNamespace(): string
33 {
34 $extra = $this->get('extra');
35
36 if (empty($extra['imposter']['namespace'])) {
37 throw new UnexpectedValueException('Imposter namespace is empty');
38 }
39
40 return $extra['imposter']['namespace'];
41 }
42
43 public function getVendorDir(): string
44 {
45 $config = $this->get('config');
46 $vendorDir = $config['vendor-dir'] ?? 'vendor';
47
48 return StringUtil::addTrailingSlash($this->packageDir . $vendorDir);
49 }
50
51 /**
52 * @param string[] $extraExcludes
53 *
54 * @return void
55 */
56
57 public function setExtraExcludes(array $extraExcludes)
58 {
59 $this->extraExcludes = $extraExcludes;
60 }
61 }
62