@@ -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; |
@@ -205,7 +205,7 @@ |
||
205 | 205 | } |
206 | 206 | |
207 | 207 | /** |
208 | - * @param Message[]|Collection $messages |
|
208 | + * @param Collection $messages |
|
209 | 209 | */ |
210 | 210 | public function setMessages(Collection $messages = null) |
211 | 211 | { |
@@ -32,7 +32,7 @@ |
||
32 | 32 | $configuration = new Configuration(); |
33 | 33 | $config = $this->processConfiguration($configuration, $configs); |
34 | 34 | |
35 | - $loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); |
|
35 | + $loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
|
36 | 36 | $loader->load('services.yml'); |
37 | 37 | $loader->load('filters_container.yml'); |
38 | 38 |
@@ -112,7 +112,7 @@ |
||
112 | 112 | { |
113 | 113 | $cwd = getcwd(); |
114 | 114 | if (substr($cwd, -3) === 'web') { |
115 | - chdir($cwd . DIRECTORY_SEPARATOR . '..'); |
|
115 | + chdir($cwd.DIRECTORY_SEPARATOR.'..'); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | return new JsonResponse( |
@@ -11,7 +11,6 @@ |
||
11 | 11 | |
12 | 12 | namespace ONGR\TranslationsBundle\Service; |
13 | 13 | |
14 | -use Elasticsearch\Common\Exceptions\BadRequest400Exception; |
|
15 | 14 | use ONGR\ElasticsearchBundle\Service\Manager; |
16 | 15 | use ONGR\TranslationsBundle\Document\Message; |
17 | 16 | use ONGR\TranslationsBundle\Document\Translation; |
@@ -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(); |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | /** |
110 | 110 | * @param string $id |
111 | 111 | * |
112 | - * @return Translation |
|
112 | + * @return null|\ReflectionClass |
|
113 | 113 | * |
114 | 114 | * @throws BadRequestHttpException |
115 | 115 | */ |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | * |
243 | 243 | * @param Request $request Http request object. |
244 | 244 | * |
245 | - * @return array |
|
245 | + * @return Translation |
|
246 | 246 | * |
247 | 247 | * @throws BadRequestHttpException |
248 | 248 | */ |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | } |
259 | 259 | |
260 | 260 | /** |
261 | - * @param object $document |
|
261 | + * @param null|\ReflectionClass $document |
|
262 | 262 | */ |
263 | 263 | private function commitTranslation($document) |
264 | 264 | { |
@@ -13,9 +13,7 @@ |
||
13 | 13 | |
14 | 14 | use Elasticsearch\Common\Exceptions\Missing404Exception; |
15 | 15 | use ONGR\ElasticsearchBundle\Result\DocumentIterator; |
16 | -use ONGR\ElasticsearchBundle\Result\Result; |
|
17 | 16 | use ONGR\ElasticsearchDSL\Aggregation\Bucketing\TermsAggregation; |
18 | -use ONGR\ElasticsearchDSL\Query\ExistsQuery; |
|
19 | 17 | use ONGR\ElasticsearchDSL\Query\MatchAllQuery; |
20 | 18 | use ONGR\ElasticsearchDSL\Query\TermsQuery; |
21 | 19 | use ONGR\ElasticsearchBundle\Service\Repository; |
@@ -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(), |
@@ -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 | )) { |