PluginProbe
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF / trunk
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF vtrunk
2.3.4 2.3.3 2.3.2 2.3.1 2.3.0 2.2.9 2.2.8 trunk 1.10 1.3.3 1.3.4 1.3.5 1.3.5.1 1.3.5.2 1.3.6 1.3.6.1 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.5 All 103 releases
← All changes | vendor/composer/installers/src/Composer/Installers/DokuWikiInstaller.php +19 -12 1.10 → trunk View file →
@@ -1,9 +1,11 @@
1 1 <?php
2 +
2 3 namespace Composer\Installers;
3 4
4 5 class DokuWikiInstaller extends BaseInstaller
5 6 {
7 + /** @var array<string, string> */
6 8 protected $locations = array(
7 9 'plugin' => 'lib/plugins/{$name}/',
8 10 'template' => 'lib/tpl/{$name}/',
9 11 );
@@ -10,17 +12,15 @@
10 12
11 13 /**
12 14 * Format package name.
13 15 *
14 - * For package type dokuwiki-plugin, cut off a trailing '-plugin',
16 + * For package type dokuwiki-plugin, cut off a trailing '-plugin',
15 17 * or leading dokuwiki_ if present.
16 - *
18 + *
17 19 * For package type dokuwiki-template, cut off a trailing '-template' if present.
18 - *
19 20 */
20 - public function inflectPackageVars($vars)
21 + public function inflectPackageVars(array $vars): array
21 22 {
22 -
23 23 if ($vars['type'] === 'dokuwiki-plugin') {
24 24 return $this->inflectPluginVars($vars);
25 25 }
26 26
@@ -30,21 +30,28 @@
30 30
31 31 return $vars;
32 32 }
33 33
34 - protected function inflectPluginVars($vars)
34 + /**
35 + * @param array<string, string> $vars
36 + * @return array<string, string>
37 + */
38 + protected function inflectPluginVars(array $vars): array
35 39 {
36 - $vars['name'] = preg_replace('/-plugin$/', '', $vars['name']);
37 - $vars['name'] = preg_replace('/^dokuwiki_?-?/', '', $vars['name']);
40 + $vars['name'] = $this->pregReplace('/-plugin$/', '', $vars['name']);
41 + $vars['name'] = $this->pregReplace('/^dokuwiki_?-?/', '', $vars['name']);
38 42
39 43 return $vars;
40 44 }
41 45
42 - protected function inflectTemplateVars($vars)
46 + /**
47 + * @param array<string, string> $vars
48 + * @return array<string, string>
49 + */
50 + protected function inflectTemplateVars(array $vars): array
43 51 {
44 - $vars['name'] = preg_replace('/-template$/', '', $vars['name']);
45 - $vars['name'] = preg_replace('/^dokuwiki_?-?/', '', $vars['name']);
52 + $vars['name'] = $this->pregReplace('/-template$/', '', $vars['name']);
53 + $vars['name'] = $this->pregReplace('/^dokuwiki_?-?/', '', $vars['name']);
46 54
47 55 return $vars;
48 56 }
49 -
50 57 }