Completed
Pull Request — master (#89)
by
unknown
62:49
created
Document/Translation.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -205,7 +205,7 @@
 block discarded – undo
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
     {
Please login to merge, or discard this patch.
Translation/TranslationManager.php 3 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -115,14 +115,14 @@
 block discarded – undo
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
             }
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
     }
253 253
 
254 254
     /**
255
-     * @param object $document
255
+     * @param null|\ReflectionClass $document
256 256
      */
257 257
     private function commitTranslation($document)
258 258
     {
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
      *
266 266
      * @param string $id
267 267
      *
268
-     * @return Translation
268
+     * @return null|\ReflectionClass
269 269
      *
270 270
      * @throws BadRequestHttpException
271 271
      */
Please login to merge, or discard this patch.
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -26,8 +26,6 @@
 block discarded – undo
26 26
 use Symfony\Component\EventDispatcher\EventDispatcherInterface;
27 27
 use Symfony\Component\HttpFoundation\Request;
28 28
 use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
29
-use Symfony\Component\PropertyAccess\PropertyAccess;
30
-use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
31 29
 
32 30
 /**
33 31
  * Handles translation objects by http requests.
Please login to merge, or discard this patch.
Service/Export.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@
 block discarded – undo
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(),
Please login to merge, or discard this patch.
Service/Import.php 2 patches
Spacing   +5 added lines, -6 removed lines patch added patch discarded remove patch
@@ -147,9 +147,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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();
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,6 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
DependencyInjection/ONGRTranslationsExtension.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Controller/ApiController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@
 block discarded – undo
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(
Please login to merge, or discard this patch.
Controller/ListController.php 1 patch
Unused Use Statements   -6 removed lines patch added patch discarded remove patch
@@ -11,13 +11,7 @@
 block discarded – undo
11 11
 
12 12
 namespace ONGR\TranslationsBundle\Controller;
13 13
 
14
-use ONGR\ElasticsearchBundle\Result\DocumentIterator;
15
-use ONGR\ElasticsearchBundle\Result\Result;
16
-use ONGR\ElasticsearchDSL\Aggregation\TermsAggregation;
17
-use ONGR\ElasticsearchBundle\Service\Repository;
18
-use ONGR\FilterManagerBundle\Filter\ViewData;
19 14
 use ONGR\FilterManagerBundle\Search\SearchResponse;
20
-use ONGR\TranslationsBundle\Document\Translation;
21 15
 use Symfony\Bundle\FrameworkBundle\Controller\Controller;
22 16
 use Symfony\Component\HttpFoundation\JsonResponse;
23 17
 use Symfony\Component\HttpFoundation\Request;
Please login to merge, or discard this patch.
Translation/HistoryManager.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@
 block discarded – undo
80 80
         $history->setLocale($locale);
81 81
         $history->setTranslation($id);
82 82
         $history->setMessage($message->getMessage());
83
-        $history->setId(sha1($id . $message->getMessage()));
83
+        $history->setId(sha1($id.$message->getMessage()));
84 84
         $history->setUpdatedAt($message->getUpdatedAt());
85 85
 
86 86
         $this->repository->getManager()->persist($history);
Please login to merge, or discard this patch.