Completed
Pull Request — master (#6015)
by Javier
09:24
created
lib/Doctrine/ORM/Tools/EntityRepositoryGenerator.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -343,6 +343,9 @@
 block discarded – undo
343 343
         return implode("\n", $docblocks);
344 344
     }
345 345
 
346
+    /**
347
+     * @param string $type
348
+     */
346 349
     protected function generateDocblocksForMagicMethod(ClassMetadataInfo $metadata, $type, $fieldName, $typeHint = null)
347 350
     {
348 351
         $variableName = Inflector::camelize($fieldName);
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
         $code = $this->generateEntityRepositoryClass($fullClassName);
235 235
 
236 236
         $path = $outputDirectory . \DIRECTORY_SEPARATOR
237
-              . str_replace('\\', \DIRECTORY_SEPARATOR, $fullClassName) . '.php';
237
+                . str_replace('\\', \DIRECTORY_SEPARATOR, $fullClassName) . '.php';
238 238
         $dir = dirname($path);
239 239
 
240 240
         if ( ! is_dir($dir)) {
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
         $code = $this->generateEntityRepositoryClassWithMagicMethodDocblocks($metadata);
265 265
 
266 266
         $path = $outputDirectory . \DIRECTORY_SEPARATOR
267
-              . str_replace('\\', \DIRECTORY_SEPARATOR, $metadata->customRepositoryClassName) . '.php';
267
+                . str_replace('\\', \DIRECTORY_SEPARATOR, $metadata->customRepositoryClassName) . '.php';
268 268
         $dir = dirname($path);
269 269
 
270 270
         if ( ! is_dir($dir)) {
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
     {
203 203
         $namespace = $this->getClassNamespace($fullClassName);
204 204
 
205
-        return $namespace ? 'namespace ' . $namespace . ';' : '';
205
+        return $namespace ? 'namespace '.$namespace.';' : '';
206 206
     }
207 207
 
208 208
     /**
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
         $repositoryName = $this->repositoryName ?: 'Doctrine\ORM\EntityRepository';
218 218
 
219 219
         if ($namespace && $repositoryName[0] !== '\\') {
220
-            $repositoryName = '\\' . $repositoryName;
220
+            $repositoryName = '\\'.$repositoryName;
221 221
         }
222 222
 
223 223
         return $repositoryName;
@@ -233,8 +233,8 @@  discard block
 block discarded – undo
233 233
     {
234 234
         $code = $this->generateEntityRepositoryClass($fullClassName);
235 235
 
236
-        $path = $outputDirectory . \DIRECTORY_SEPARATOR
237
-              . str_replace('\\', \DIRECTORY_SEPARATOR, $fullClassName) . '.php';
236
+        $path = $outputDirectory.\DIRECTORY_SEPARATOR
237
+              . str_replace('\\', \DIRECTORY_SEPARATOR, $fullClassName).'.php';
238 238
         $dir = dirname($path);
239 239
 
240 240
         if ( ! is_dir($dir)) {
@@ -263,8 +263,8 @@  discard block
 block discarded – undo
263 263
     {
264 264
         $code = $this->generateEntityRepositoryClassWithMagicMethodDocblocks($metadata);
265 265
 
266
-        $path = $outputDirectory . \DIRECTORY_SEPARATOR
267
-              . str_replace('\\', \DIRECTORY_SEPARATOR, $metadata->customRepositoryClassName) . '.php';
266
+        $path = $outputDirectory.\DIRECTORY_SEPARATOR
267
+              . str_replace('\\', \DIRECTORY_SEPARATOR, $metadata->customRepositoryClassName).'.php';
268 268
         $dir = dirname($path);
269 269
 
270 270
         if ( ! is_dir($dir)) {
@@ -354,13 +354,13 @@  discard block
 block discarded – undo
354 354
         $variableType   = $typeHint ? $this->getType($typeHint) : null;
355 355
 
356 356
         if ($typeHint && ! isset($types[$typeHint])) {
357
-            $variableType   =  '\\' . ltrim($variableType, '\\');
358
-            $methodTypeHint =  '\\' . $typeHint . ' ';
357
+            $variableType   = '\\'.ltrim($variableType, '\\');
358
+            $methodTypeHint = '\\'.$typeHint.' ';
359 359
         }
360 360
 
361 361
         $replacements = [
362 362
             '<entity>'          => $this->getClassName($metadata),
363
-            '<arg1TypeHint>'        => $variableType ? ($variableType . ' ') : '',
363
+            '<arg1TypeHint>'        => $variableType ? ($variableType.' ') : '',
364 364
             '<arg1Name>'            => $variableName,
365 365
             '<fieldName>'           => ucfirst($fieldName),
366 366
         ];
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
         }
419 419
 
420 420
         foreach ($joinColumns as $joinColumn) {
421
-            if (isset($joinColumn['nullable']) && !$joinColumn['nullable']) {
421
+            if (isset($joinColumn['nullable']) && ! $joinColumn['nullable']) {
422 422
                 return false;
423 423
             }
424 424
         }
Please login to merge, or discard this patch.