@@ -52,7 +52,7 @@ |
||
52 | 52 | } |
53 | 53 | |
54 | 54 | foreach ($data as $type => $extensions) { |
55 | - $data[$type] = array_filter($extensions, function ($var) { |
|
55 | + $data[$type] = array_filter($extensions, function($var) { |
|
56 | 56 | return strlen($var) > 0; |
57 | 57 | }); |
58 | 58 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | |
50 | 50 | if ($container->hasParameter($parameter)) { |
51 | 51 | $value = $container->getParameter($parameter); |
52 | - if (! is_array($value)) { |
|
52 | + if (!is_array($value)) { |
|
53 | 53 | $value = array($value); |
54 | 54 | } |
55 | 55 | |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $matcher = $this->matcher; |
69 | 69 | |
70 | 70 | return array_map( |
71 | - function ($path) use ($matcher) { |
|
71 | + function($path) use ($matcher) { |
|
72 | 72 | if ($matcher->isPattern($path)) { |
73 | 73 | return $path; |
74 | 74 | } |
@@ -90,7 +90,7 @@ |
||
90 | 90 | ); |
91 | 91 | |
92 | 92 | if ($watch) { |
93 | - $httpServer->addPeriodicTimer(1, function () use ($sculpin, $dataSource, $sourceSet, $consoleIo) { |
|
93 | + $httpServer->addPeriodicTimer(1, function() use ($sculpin, $dataSource, $sourceSet, $consoleIo) { |
|
94 | 94 | clearstatcache(); |
95 | 95 | $sourceSet->reset(); |
96 | 96 |
@@ -50,7 +50,7 @@ |
||
50 | 50 | $this->loop = new StreamSelectLoop; |
51 | 51 | $socketServer = new ReactSocketServer($this->loop); |
52 | 52 | $httpServer = new ReactHttpServer($socketServer); |
53 | - $httpServer->on("request", function ($request, $response) use ($repository, $docroot, $output) { |
|
53 | + $httpServer->on("request", function($request, $response) use ($repository, $docroot, $output) { |
|
54 | 54 | $path = $docroot.'/'.ltrim(rawurldecode($request->getPath()), '/'); |
55 | 55 | if (is_dir($path)) { |
56 | 56 | $path .= '/index.html'; |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $container->setParameter(self::generateId('types'), array_keys($config)); |
38 | 38 | |
39 | 39 | foreach ($config as $type => $setup) { |
40 | - if (! $setup['enabled']) { |
|
40 | + if (!$setup['enabled']) { |
|
41 | 41 | // We can skip any types that are not enabled. |
42 | 42 | continue; |
43 | 43 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $detectionTypes = is_array($setup['type']) ? $setup['type'] : array($setup['type']); |
50 | 50 | |
51 | 51 | $itemClassId = self::generateTypesId($type, 'item.class'); |
52 | - if (! $container->hasParameter($itemClassId)) { |
|
52 | + if (!$container->hasParameter($itemClassId)) { |
|
53 | 53 | $container->setParameter($itemClassId, 'Sculpin\Contrib\ProxySourceCollection\ProxySourceItem'); |
54 | 54 | } |
55 | 55 | |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | $collectionSorterId = self::generateTypesId($type, 'collection.sorter'); |
61 | 61 | |
62 | - if (! $container->hasDefinition($collectionSorterId)) { |
|
62 | + if (!$container->hasDefinition($collectionSorterId)) { |
|
63 | 63 | $collectionSorter = new Definition('Sculpin\Contrib\ProxySourceCollection\Sorter\DefaultSorter'); |
64 | 64 | $container->setDefinition($collectionSorterId, $collectionSorter); |
65 | 65 | } |
@@ -139,11 +139,11 @@ |
||
139 | 139 | if (0 === $i) { |
140 | 140 | $generatedSource->data()->set('pagination.previous_page', null); |
141 | 141 | } else { |
142 | - $generatedSource->data()->set('pagination.previous_page', $sources[$i-1]); |
|
142 | + $generatedSource->data()->set('pagination.previous_page', $sources[$i - 1]); |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | if ($i + 1 < count($sources)) { |
146 | - $generatedSource->data()->set('pagination.next_page', $sources[$i+1]); |
|
146 | + $generatedSource->data()->set('pagination.next_page', $sources[$i + 1]); |
|
147 | 147 | } else { |
148 | 148 | $generatedSource->data()->set('pagination.next_page', null); |
149 | 149 | } |
@@ -38,7 +38,7 @@ |
||
38 | 38 | $container->setParameter('sculpin_twig.view_paths', $config['view_paths']); |
39 | 39 | $container->setParameter('sculpin_twig.extensions', $config['extensions']); |
40 | 40 | |
41 | - if (! extension_loaded('intl')) { |
|
41 | + if (!extension_loaded('intl')) { |
|
42 | 42 | // Do not enable the intl Twig extension if the intl PHP extension is not installed. |
43 | 43 | $container->removeDefinition('sculpin_twig.extensions.intl'); |
44 | 44 | } |
@@ -43,22 +43,22 @@ |
||
43 | 43 | */ |
44 | 44 | public function __construct($sourceDir, array $sourcePaths, array $paths, array $extensions) |
45 | 45 | { |
46 | - $mappedSourcePaths = array_map(function ($path) use ($sourceDir) { |
|
46 | + $mappedSourcePaths = array_map(function($path) use ($sourceDir) { |
|
47 | 47 | return $sourceDir.'/'.$path; |
48 | 48 | }, $sourcePaths); |
49 | 49 | |
50 | 50 | $allPaths = array_merge( |
51 | - array_filter($mappedSourcePaths, function ($path) { |
|
51 | + array_filter($mappedSourcePaths, function($path) { |
|
52 | 52 | return file_exists($path); |
53 | 53 | }), |
54 | - array_filter($paths, function ($path) { |
|
54 | + array_filter($paths, function($path) { |
|
55 | 55 | return file_exists($path); |
56 | 56 | }) |
57 | 57 | ); |
58 | 58 | |
59 | 59 | $this->filesystemLoader = new FilesystemLoader($allPaths); |
60 | - $this->extensions = array_map(function ($ext) { |
|
61 | - return $ext?'.'.$ext:$ext; |
|
60 | + $this->extensions = array_map(function($ext) { |
|
61 | + return $ext ? '.'.$ext : $ext; |
|
62 | 62 | }, $extensions); |
63 | 63 | } |
64 | 64 |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | |
68 | 68 | return $blocks; |
69 | 69 | } catch (\Exception $e) { |
70 | - print ' [ ' . get_class($e) . ': ' . $e->getMessage() . " ]\n"; |
|
70 | + print ' [ '.get_class($e).': '.$e->getMessage()." ]\n"; |
|
71 | 71 | } |
72 | 72 | } |
73 | 73 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | return $this->twig->render($formatContext->templateId(), $data); |
97 | 97 | } catch (\Exception $e) { |
98 | - print ' [ ' . get_class($e) . ': ' . $e->getMessage() . " ]\n"; |
|
98 | + print ' [ '.get_class($e).': '.$e->getMessage()." ]\n"; |
|
99 | 99 | } |
100 | 100 | } |
101 | 101 | |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | if (!preg_match_all('/{%\s+block\s+(\w+)\s+%}(.*?){%\s+endblock\s+%}/si', $verbatim, $matches)) { |
121 | 121 | $template = '{% block content %}'.$template.'{% endblock %}'; |
122 | 122 | } |
123 | - $template = '{% extends "' . $layout . '" %}' . $template; |
|
123 | + $template = '{% extends "'.$layout.'" %}'.$template; |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | return $template; |