@@ -60,7 +60,7 @@ |
||
60 | 60 | $domains = $input->getOption('domains'); |
61 | 61 | $export->export($domains); |
62 | 62 | |
63 | - $prettify = function ($array) { |
|
63 | + $prettify = function($array) { |
|
64 | 64 | return !empty($array) ? implode('</comment><info>`, `</info><comment>', $array) : 'all'; |
65 | 65 | }; |
66 | 66 |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | /** |
143 | 143 | * Sets tags. |
144 | 144 | * |
145 | - * @param Tag[]|Collection $tags |
|
145 | + * @param Collection $tags |
|
146 | 146 | */ |
147 | 147 | public function setTags(Collection $tags = null) |
148 | 148 | { |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | } |
203 | 203 | |
204 | 204 | /** |
205 | - * @param Message[]|Collection $messages |
|
205 | + * @param Collection $messages |
|
206 | 206 | */ |
207 | 207 | public function setMessages(Collection $messages = null) |
208 | 208 | { |
@@ -117,7 +117,7 @@ |
||
117 | 117 | public function getId() |
118 | 118 | { |
119 | 119 | if (!$this->id) { |
120 | - $this->setId(sha1($this->getDomain() . $this->getKey())); |
|
120 | + $this->setId(sha1($this->getDomain().$this->getKey())); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | return $this->id; |
@@ -31,7 +31,7 @@ |
||
31 | 31 | |
32 | 32 | /** |
33 | 33 | * @param Request $request |
34 | - * @param object $document |
|
34 | + * @param \ReflectionClass $document |
|
35 | 35 | */ |
36 | 36 | public function __construct(Request $request, $document) |
37 | 37 | { |
@@ -11,7 +11,6 @@ |
||
11 | 11 | |
12 | 12 | namespace ONGR\TranslationsBundle\Controller; |
13 | 13 | |
14 | -use ONGR\ElasticsearchBundle\Result\Result; |
|
15 | 14 | use ONGR\ElasticsearchBundle\Service\Repository; |
16 | 15 | use ONGR\FilterManagerBundle\Filter\ViewData; |
17 | 16 | use ONGR\FilterManagerBundle\Search\SearchResponse; |
@@ -36,7 +36,7 @@ |
||
36 | 36 | $part = trim($part); |
37 | 37 | |
38 | 38 | if (preg_match( |
39 | - '/^(?P<interval>' . Interval::getIntervalRegexp() . ')\s*(?P<message> . *?)$/x', |
|
39 | + '/^(?P<interval>'.Interval::getIntervalRegexp().')\s*(?P<message> . *?)$/x', |
|
40 | 40 | $part, |
41 | 41 | $matches |
42 | 42 | )) { |
@@ -115,14 +115,14 @@ |
||
115 | 115 | |
116 | 116 | if (array_key_exists('properties', $content)) { |
117 | 117 | foreach ($content['properties'] as $property) { |
118 | - $search->setSource($content['name'] . '.' . $property); |
|
118 | + $search->setSource($content['name'].'.'.$property); |
|
119 | 119 | } |
120 | 120 | } |
121 | 121 | |
122 | 122 | if (array_key_exists('findBy', $content)) { |
123 | 123 | foreach ($content['findBy'] as $field => $value) { |
124 | 124 | $search->addQuery( |
125 | - new TermsQuery($content['name'] . '.' . $field, is_array($value) ? $value : [$value]), |
|
125 | + new TermsQuery($content['name'].'.'.$field, is_array($value) ? $value : [$value]), |
|
126 | 126 | 'must' |
127 | 127 | ); |
128 | 128 | } |
@@ -126,7 +126,7 @@ |
||
126 | 126 | foreach ($messages as $key => $message) { |
127 | 127 | if ($message->getStatus() === Message::DIRTY) { |
128 | 128 | $path = sprintf( |
129 | - '%s' . DIRECTORY_SEPARATOR . '%s.%s.%s', |
|
129 | + '%s'.DIRECTORY_SEPARATOR.'%s.%s.%s', |
|
130 | 130 | $translation->getPath(), |
131 | 131 | $translation->getDomain(), |
132 | 132 | $message->getLocale(), |
@@ -147,9 +147,8 @@ discard block |
||
147 | 147 | public function importBundlesTranslationFiles($bundles, $isBundle = false) |
148 | 148 | { |
149 | 149 | foreach ($bundles as $bundle) { |
150 | - $dir = $isBundle? |
|
151 | - dir($bundle->getPath())->path : |
|
152 | - dirname((new \ReflectionClass($bundle))->getFilename()); |
|
150 | + $dir = $isBundle ? |
|
151 | + dir($bundle->getPath())->path : dirname((new \ReflectionClass($bundle))->getFilename()); |
|
153 | 152 | |
154 | 153 | $this->importBundleTranslationFiles($dir); |
155 | 154 | } |
@@ -180,7 +179,7 @@ discard block |
||
180 | 179 | $dirs = []; |
181 | 180 | foreach ($classes as $namespace => $translationDir) { |
182 | 181 | $reflection = new \ReflectionClass($namespace); |
183 | - $dirs[] = dirname($reflection->getFilename()) . $translationDir; |
|
182 | + $dirs[] = dirname($reflection->getFilename()).$translationDir; |
|
184 | 183 | } |
185 | 184 | |
186 | 185 | $finder = $this->getFinder(); |
@@ -203,12 +202,12 @@ discard block |
||
203 | 202 | $finder = null; |
204 | 203 | |
205 | 204 | if (preg_match('#^win#i', PHP_OS)) { |
206 | - $path = preg_replace('#' . preg_quote(DIRECTORY_SEPARATOR, '#') . '#', '/', $path); |
|
205 | + $path = preg_replace('#'.preg_quote(DIRECTORY_SEPARATOR, '#').'#', '/', $path); |
|
207 | 206 | } else { |
208 | 207 | $path = str_replace('\\', '/', $path); |
209 | 208 | } |
210 | 209 | |
211 | - $dir = $path . '/Resources/translations'; |
|
210 | + $dir = $path.'/Resources/translations'; |
|
212 | 211 | |
213 | 212 | if (is_dir($dir)) { |
214 | 213 | $finder = $this->getFinder(); |
@@ -80,7 +80,7 @@ |
||
80 | 80 | $newDocument->setLocale($locale); |
81 | 81 | $newDocument->setMessage($oldMessage); |
82 | 82 | $newDocument->setDomain($domain); |
83 | - $newDocument->setId(sha1($document->getId() . $oldMessage)); |
|
83 | + $newDocument->setId(sha1($document->getId().$oldMessage)); |
|
84 | 84 | $newDocument->setCreatedAt(new \DateTime()); |
85 | 85 | |
86 | 86 | return $newDocument; |