@@ -10,7 +10,7 @@ class ApplicationDetector
1010{
1111 /**
1212 * Application detection configurations for each platform.
13- *
13+ *
1414 * @var array<string, array<string, array<string, string|array<string>>>>
1515 */
1616 protected array $ detectionConfig = [
@@ -114,7 +114,7 @@ class ApplicationDetector
114114
115115 /**
116116 * Project-specific detection patterns.
117- *
117+ *
118118 * @var array<string, array<string, string|array<string>>>
119119 */
120120 protected array $ projectDetectionConfig = [
@@ -147,15 +147,15 @@ class ApplicationDetector
147147
148148 /**
149149 * Detect installed applications on the current platform.
150- *
150+ *
151151 * @return array<string>
152152 */
153153 public function detectInstalled (): array
154154 {
155155 $ platform = $ this ->getPlatform ();
156156 $ detected = [];
157157
158- if (!isset ($ this ->detectionConfig [$ platform ])) {
158+ if (! isset ($ this ->detectionConfig [$ platform ])) {
159159 return [];
160160 }
161161
@@ -170,8 +170,7 @@ public function detectInstalled(): array
170170
171171 /**
172172 * Detect applications used in the current project.
173- *
174- * @param string $basePath
173+ *
175174 * @return array<string>
176175 */
177176 public function detectInProject (string $ basePath ): array
@@ -189,10 +188,8 @@ public function detectInProject(string $basePath): array
189188
190189 /**
191190 * Check if an application is installed based on its configuration.
192- *
193- * @param array<string, string|array<string>> $config
194- * @param string $platform
195- * @return bool
191+ *
192+ * @param array<string, string|array<string>> $config
196193 */
197194 protected function isAppInstalled (array $ config , string $ platform ): bool
198195 {
@@ -203,11 +200,11 @@ protected function isAppInstalled(array $config, string $platform): bool
203200 if ($ config ['type ' ] === 'directory ' && isset ($ config ['paths ' ])) {
204201 foreach ($ config ['paths ' ] as $ path ) {
205202 $ expandedPath = $ this ->expandPath ($ path , $ platform );
206-
203+
207204 // Handle wildcards
208205 if (strpos ($ expandedPath , '* ' ) !== false ) {
209206 $ matches = glob ($ expandedPath , GLOB_ONLYDIR );
210- if (!empty ($ matches )) {
207+ if (! empty ($ matches )) {
211208 return true ;
212209 }
213210 } elseif (is_dir ($ expandedPath )) {
@@ -221,24 +218,22 @@ protected function isAppInstalled(array $config, string $platform): bool
221218
222219 /**
223220 * Check if an application is used in the current project.
224- *
225- * @param array<string, string|array<string>> $config
226- * @param string $basePath
227- * @return bool
221+ *
222+ * @param array<string, string|array<string>> $config
228223 */
229224 protected function isAppUsedInProject (array $ config , string $ basePath ): bool
230225 {
231226 if ($ config ['type ' ] === 'directory ' && isset ($ config ['paths ' ])) {
232227 foreach ($ config ['paths ' ] as $ path ) {
233- if (is_dir ($ basePath . DIRECTORY_SEPARATOR . $ path )) {
228+ if (is_dir ($ basePath. DIRECTORY_SEPARATOR . $ path )) {
234229 return true ;
235230 }
236231 }
237232 }
238233
239234 if ($ config ['type ' ] === 'file ' && isset ($ config ['files ' ])) {
240235 foreach ($ config ['files ' ] as $ file ) {
241- if (file_exists ($ basePath . DIRECTORY_SEPARATOR . $ file )) {
236+ if (file_exists ($ basePath. DIRECTORY_SEPARATOR . $ file )) {
242237 return true ;
243238 }
244239 }
@@ -247,14 +242,14 @@ protected function isAppUsedInProject(array $config, string $basePath): bool
247242 if ($ config ['type ' ] === 'mixed ' ) {
248243 if (isset ($ config ['paths ' ])) {
249244 foreach ($ config ['paths ' ] as $ path ) {
250- if (is_dir ($ basePath . DIRECTORY_SEPARATOR . $ path )) {
245+ if (is_dir ($ basePath. DIRECTORY_SEPARATOR . $ path )) {
251246 return true ;
252247 }
253248 }
254249 }
255250 if (isset ($ config ['files ' ])) {
256251 foreach ($ config ['files ' ] as $ file ) {
257- if (file_exists ($ basePath . DIRECTORY_SEPARATOR . $ file )) {
252+ if (file_exists ($ basePath. DIRECTORY_SEPARATOR . $ file )) {
258253 return true ;
259254 }
260255 }
@@ -266,10 +261,6 @@ protected function isAppUsedInProject(array $config, string $basePath): bool
266261
267262 /**
268263 * Expand environment variables and user home directory in paths.
269- *
270- * @param string $path
271- * @param string $platform
272- * @return string
273264 */
274265 protected function expandPath (string $ path , string $ platform ): string
275266 {
@@ -293,8 +284,6 @@ protected function expandPath(string $path, string $platform): string
293284
294285 /**
295286 * Get the current platform identifier.
296- *
297- * @return string
298287 */
299288 protected function getPlatform (): string
300289 {
@@ -307,11 +296,8 @@ protected function getPlatform(): string
307296
308297 /**
309298 * Add custom detection configuration for an application.
310- *
311- * @param string $app
312- * @param array<string, array<string, string|array<string>>> $config
313- * @param string|null $platform
314- * @return void
299+ *
300+ * @param array<string, array<string, string|array<string>>> $config
315301 */
316302 public function addDetectionConfig (string $ app , array $ config , ?string $ platform = null ): void
317303 {
@@ -327,13 +313,11 @@ public function addDetectionConfig(string $app, array $config, ?string $platform
327313
328314 /**
329315 * Add custom project detection configuration for an application.
330- *
331- * @param string $app
332- * @param array<string, string|array<string>> $config
333- * @return void
316+ *
317+ * @param array<string, string|array<string>> $config
334318 */
335319 public function addProjectDetectionConfig (string $ app , array $ config ): void
336320 {
337321 $ this ->projectDetectionConfig [$ app ] = $ config ;
338322 }
339- }
323+ }
0 commit comments