1 | <?php |
||
30 | final class PhpstormProjectConfigure implements ActionInterface, VarAwareInterface, EventAwareInterface |
||
31 | { |
||
32 | use VarAwareTrait, |
||
33 | FilesystemAwareTrait, |
||
34 | EventAwareTrait; |
||
35 | |||
36 | const IDEA_PATH = '.idea'; |
||
37 | const COMPOSER_PROJECT_PATH = 'composer'; |
||
38 | |||
39 | /** |
||
40 | * {@inheritdoc} |
||
41 | */ |
||
42 | 2 | public function execute() |
|
43 | { |
||
44 | 2 | if ($this->canExecute()) { |
|
45 | 1 | $this->markSourceDirectories(); |
|
46 | } |
||
47 | 2 | } |
|
48 | |||
49 | /** |
||
50 | * {@inheritdoc} |
||
51 | */ |
||
52 | 2 | public function canExecute(): bool |
|
56 | |||
57 | /** |
||
58 | * @return void |
||
59 | * @throws RuntimeException |
||
60 | */ |
||
61 | 1 | private function markSourceDirectories() |
|
92 | |||
93 | /** |
||
94 | * @return string |
||
95 | */ |
||
96 | 2 | private function getIdeaDirectory(): string |
|
100 | |||
101 | /** |
||
102 | * @return string |
||
103 | */ |
||
104 | 1 | private function getProjectFile(): string |
|
108 | |||
109 | /** |
||
110 | * @param string $name Config name |
||
111 | * |
||
112 | * @return string |
||
113 | */ |
||
114 | 1 | private function getIdeaConfigFile(string $name): string |
|
118 | |||
119 | /** |
||
120 | * @return string |
||
121 | */ |
||
122 | 1 | private function getNamespace(): string |
|
126 | |||
127 | /** |
||
128 | * @param string $variable |
||
129 | * |
||
130 | * @return string |
||
131 | */ |
||
132 | 1 | private function fixNamespaceVariable(string $variable): string |
|
136 | |||
137 | /** |
||
138 | * @return string |
||
139 | */ |
||
140 | 1 | private function getTestsNamespace(): string |
|
144 | |||
145 | /** |
||
146 | * {@inheritdoc} |
||
147 | */ |
||
148 | 4 | public function getPriority(): int |
|
152 | } |
||
153 |