@@ -308,6 +308,9 @@ |
||
308 | 308 | } |
309 | 309 | } |
310 | 310 | |
311 | + /** |
|
312 | + * @param string|null $className |
|
313 | + */ |
|
311 | 314 | private function buildArgumentsArray($serviceId, $className, array $tagAttributes = []): array |
312 | 315 | { |
313 | 316 | $arguments = [$serviceId]; |
@@ -239,14 +239,14 @@ discard block |
||
239 | 239 | } |
240 | 240 | } |
241 | 241 | $format = '%-'.$maxName.'s '; |
242 | - $format .= implode("", array_map(function ($length) { |
|
242 | + $format .= implode("", array_map(function($length) { |
|
243 | 243 | return "%-{$length}s "; |
244 | 244 | }, $maxTags)); |
245 | - $format .= '%s'; |
|
245 | + $format .= '%s'; |
|
246 | 246 | |
247 | 247 | // the title field needs extra space to make up for comment tags |
248 | 248 | $format1 = '%-'.($maxName + 19).'s '; |
249 | - $format1 .= implode("", array_map(function ($length) { |
|
249 | + $format1 .= implode("", array_map(function($length) { |
|
250 | 250 | return '%-'.($length + 19).'s '; |
251 | 251 | }, $maxTags)); |
252 | 252 | $format1 .= '%s'; |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | ' - %-30s (%s)', |
344 | 344 | $tagName, |
345 | 345 | implode(', ', array_map( |
346 | - function ($key, $value) { |
|
346 | + function($key, $value) { |
|
347 | 347 | return sprintf('<info>%s</info>: %s', $key, $value); |
348 | 348 | }, |
349 | 349 | array_keys($singleTagData), |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | private function outputTags(OutputInterface $output, bool $showPrivate = false): void |
455 | 455 | { |
456 | 456 | $container = $this->getContainer(); |
457 | - if (! $container instanceof ContainerBuilder) { |
|
457 | + if (!$container instanceof ContainerBuilder) { |
|
458 | 458 | return; |
459 | 459 | } |
460 | 460 | $tags = $container->findTags(); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | { |
38 | 38 | $prefix = $this->isStandaloneSculpin() ? '' : 'sculpin:'; |
39 | 39 | |
40 | - $this->setName($prefix . 'content:create'); |
|
40 | + $this->setName($prefix.'content:create'); |
|
41 | 41 | $this->setDescription('Create a new content type.'); |
42 | 42 | $this->setDefinition( |
43 | 43 | [ |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $boilerplate = $input->getOption('boilerplate'); |
80 | 80 | $taxonomies = $input->getOption('taxonomy'); |
81 | 81 | |
82 | - $output->writeln('Generating new content type: <info>' . $pluralType . '</info>'); |
|
82 | + $output->writeln('Generating new content type: <info>'.$pluralType.'</info>'); |
|
83 | 83 | |
84 | 84 | // TODO: Prompt the user with a preview before generating content |
85 | 85 | $output->writeln($this->getOutputMessage($pluralType, $singularType, $taxonomies)); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | // TODO: Write a yaml file to configure the content type (and recommend a wildcard include for types?) |
88 | 88 | |
89 | 89 | if ($boilerplate) { |
90 | - $output->writeln('Generating boilerplate for ' . $pluralType); |
|
90 | + $output->writeln('Generating boilerplate for '.$pluralType); |
|
91 | 91 | $boilerplateManifest = $this->generateBoilerplateManifest($pluralType, $singularType, $taxonomies); |
92 | 92 | |
93 | 93 | $fs = new Filesystem(); |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | } |
100 | 100 | |
101 | 101 | if ($fs->exists($filename)) { |
102 | - $output->writeln('Warning: ' . $filename . ' already exists at the target location. Skipping.'); |
|
102 | + $output->writeln('Warning: '.$filename.' already exists at the target location. Skipping.'); |
|
103 | 103 | continue; |
104 | 104 | } |
105 | 105 | |
@@ -120,33 +120,33 @@ discard block |
||
120 | 120 | $manifest = []; |
121 | 121 | |
122 | 122 | // ensure the content type storage folder exists |
123 | - $storageFolder = $rootDir . '/source/_' . $plural; |
|
123 | + $storageFolder = $rootDir.'/source/_'.$plural; |
|
124 | 124 | $manifest[$storageFolder] = static::DIRECTORY_FLAG; |
125 | 125 | |
126 | 126 | // content type index template |
127 | - $index = $rootDir . '/source/' . $plural . '.html'; |
|
127 | + $index = $rootDir.'/source/'.$plural.'.html'; |
|
128 | 128 | $manifest[$index] = $this->getIndexTemplate($plural, $singular); |
129 | 129 | |
130 | 130 | // ensure the views folder exists |
131 | - $storageFolder = $rootDir . '/source/_views'; |
|
131 | + $storageFolder = $rootDir.'/source/_views'; |
|
132 | 132 | $manifest[$storageFolder] = static::DIRECTORY_FLAG; |
133 | 133 | |
134 | 134 | // content type view template |
135 | - $index = $rootDir . '/source/_views/' . $singular . '.html'; |
|
135 | + $index = $rootDir.'/source/_views/'.$singular.'.html'; |
|
136 | 136 | $manifest[$index] = $this->getViewTemplate($plural, $taxonomies); |
137 | 137 | |
138 | 138 | foreach ($taxonomies as $taxonomy) { |
139 | 139 | $singularTaxonomy = Inflector::singularize($taxonomy); |
140 | 140 | // content taxonomy index template |
141 | - $index = $rootDir . '/source/' . $plural . '/' . $taxonomy . '.html'; |
|
141 | + $index = $rootDir.'/source/'.$plural.'/'.$taxonomy.'.html'; |
|
142 | 142 | $manifest[$index] = $this->getTaxonomyIndexTemplate($plural, $taxonomy, $singularTaxonomy); |
143 | 143 | |
144 | 144 | // content taxonomy directory |
145 | - $storageFolder = $rootDir . '/source/' . $plural . '/' . $taxonomy; |
|
145 | + $storageFolder = $rootDir.'/source/'.$plural.'/'.$taxonomy; |
|
146 | 146 | $manifest[$storageFolder] = static::DIRECTORY_FLAG; |
147 | 147 | |
148 | 148 | // content taxonomy view template(s) |
149 | - $index = $rootDir . '/source/' . $plural . '/' . $taxonomy . '/' . $singularTaxonomy . '.html'; |
|
149 | + $index = $rootDir.'/source/'.$plural.'/'.$taxonomy.'/'.$singularTaxonomy.'.html'; |
|
150 | 150 | $manifest[$index] = $this->getTaxonomyViewTemplate($plural, $singular, $singularTaxonomy); |
151 | 151 | } |
152 | 152 | |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | EOT; |
234 | 234 | |
235 | 235 | if ($taxonomies) { |
236 | - $output .= "\n" . ' <section class="taxonomies">' . "\n"; |
|
236 | + $output .= "\n".' <section class="taxonomies">'."\n"; |
|
237 | 237 | |
238 | 238 | foreach ($taxonomies as $taxonomy) { |
239 | 239 | $capitalTaxonomy = ucwords($taxonomy); |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | EOT; |
251 | 251 | } |
252 | 252 | |
253 | - $output .= "\n" . ' </section>' . "\n"; |
|
253 | + $output .= "\n".' </section>'."\n"; |
|
254 | 254 | } |
255 | 255 | |
256 | 256 | $output .= <<<EOT |
@@ -79,9 +79,9 @@ discard block |
||
79 | 79 | $subTitle = $input->getOption('subtitle'); |
80 | 80 | |
81 | 81 | $projectDir = $this->getContainer()->getParameter('sculpin.project_dir'); |
82 | - $output->writeln('Project Directory: <info>' . $projectDir . '</info>'); |
|
82 | + $output->writeln('Project Directory: <info>'.$projectDir.'</info>'); |
|
83 | 83 | |
84 | - $output->writeln('Initializing <info>./app</info> and <info>./source</info> for Sculpin' . "\n"); |
|
84 | + $output->writeln('Initializing <info>./app</info> and <info>./source</info> for Sculpin'."\n"); |
|
85 | 85 | |
86 | 86 | // Actions: |
87 | 87 | |
@@ -111,13 +111,13 @@ discard block |
||
111 | 111 | private function ensureCleanSlate(string $projectDir, OutputInterface $output): bool |
112 | 112 | { |
113 | 113 | $fs = new Filesystem(); |
114 | - if ($fs->exists($projectDir . '/app')) { |
|
114 | + if ($fs->exists($projectDir.'/app')) { |
|
115 | 115 | $output->writeln('<info>/app folder exists.</info>'); |
116 | 116 | |
117 | 117 | return false; |
118 | 118 | } |
119 | 119 | |
120 | - if ($fs->exists($projectDir . '/source')) { |
|
120 | + if ($fs->exists($projectDir.'/source')) { |
|
121 | 121 | $output->writeln('<info>/source folder exists.</info>'); |
122 | 122 | |
123 | 123 | return false; |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | } |
143 | 143 | |
144 | 144 | EOF; |
145 | - $this->createFile($projectDir . '/app/SculpinKernel.php', $contents); |
|
145 | + $this->createFile($projectDir.'/app/SculpinKernel.php', $contents); |
|
146 | 146 | |
147 | 147 | return true; |
148 | 148 | } |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | enabled: false |
156 | 156 | |
157 | 157 | EOF; |
158 | - $this->createFile($projectDir . '/app/config/sculpin_kernel.yml', $contents); |
|
158 | + $this->createFile($projectDir.'/app/config/sculpin_kernel.yml', $contents); |
|
159 | 159 | |
160 | 160 | return true; |
161 | 161 | } |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | url: '' |
174 | 174 | |
175 | 175 | EOF; |
176 | - $this->createFile($projectDir . '/app/config/sculpin_site.yml', $contents); |
|
176 | + $this->createFile($projectDir.'/app/config/sculpin_site.yml', $contents); |
|
177 | 177 | |
178 | 178 | return true; |
179 | 179 | } |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | $fs = new Filesystem(); |
184 | 184 | |
185 | 185 | $fs->dumpFile( |
186 | - $projectDir . '/source/index.md', |
|
186 | + $projectDir.'/source/index.md', |
|
187 | 187 | <<<EOF |
188 | 188 | --- |
189 | 189 | layout: default |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | ); |
196 | 196 | |
197 | 197 | $fs->dumpFile( |
198 | - $projectDir . '/source/_views/default.html', |
|
198 | + $projectDir.'/source/_views/default.html', |
|
199 | 199 | <<<EOF |
200 | 200 | <html> |
201 | 201 | <head><title>{{site.title}}</title></head> |
@@ -22,8 +22,8 @@ |
||
22 | 22 | final class Configuration implements ConfigurationInterface |
23 | 23 | { |
24 | 24 | /** |
25 | - * {@inheritdoc} |
|
26 | - */ |
|
25 | + * {@inheritdoc} |
|
26 | + */ |
|
27 | 27 | public function getConfigTreeBuilder(): TreeBuilder |
28 | 28 | { |
29 | 29 | $treeBuilder = new TreeBuilder; |
@@ -32,9 +32,9 @@ |
||
32 | 32 | * @var array |
33 | 33 | */ |
34 | 34 | private static $addPlaceholderRe = [ |
35 | - '/^({%\s+block\s+(\w+).+?%})$/m', // {% %} style code |
|
36 | - '/^({%\s+endblock\s+%})$/m', // {% %} style code |
|
37 | - '/^({{.+?}})$/m', // {{ }} style code |
|
35 | + '/^({%\s+block\s+(\w+).+?%})$/m', // {% %} style code |
|
36 | + '/^({%\s+endblock\s+%})$/m', // {% %} style code |
|
37 | + '/^({{.+?}})$/m', // {{ }} style code |
|
38 | 38 | ]; |
39 | 39 | |
40 | 40 | /** |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public function __construct(string $sourceDir, array $sourcePaths, array $paths, array $extensions) |
55 | 55 | { |
56 | - $mappedSourcePaths = array_map(function ($path) use ($sourceDir) { |
|
56 | + $mappedSourcePaths = array_map(function($path) use ($sourceDir) { |
|
57 | 57 | return $sourceDir.'/'.$path; |
58 | 58 | }, $sourcePaths); |
59 | 59 | |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | ); |
64 | 64 | |
65 | 65 | $this->filesystemLoader = new FilesystemLoader($allPaths); |
66 | - $this->extensions = array_map(function ($ext) { |
|
67 | - return $ext?'.'.$ext:$ext; |
|
66 | + $this->extensions = array_map(function($ext) { |
|
67 | + return $ext ? '.'.$ext : $ext; |
|
68 | 68 | }, $extensions); |
69 | 69 | } |
70 | 70 |