Completed
Pull Request — master (#14)
by Pavel
03:24
created
EntityManager.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,6 @@
 block discarded – undo
7 7
 use Bankiru\Api\Doctrine\Proxy\ApiCollection;
8 8
 use Bankiru\Api\Doctrine\Proxy\ProxyFactory;
9 9
 use Bankiru\Api\Doctrine\Utility\IdentifierFixer;
10
-use Doctrine\Common\Collections\AbstractLazyCollection;
11 10
 use Doctrine\Common\Persistence\ObjectRepository;
12 11
 use Doctrine\Common\Proxy\Proxy;
13 12
 
Please login to merge, or discard this patch.
EntityRepository.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -3,8 +3,6 @@
 block discarded – undo
3 3
 namespace Bankiru\Api\Doctrine;
4 4
 
5 5
 use Bankiru\Api\Doctrine\Mapping\ApiMetadata;
6
-use Bankiru\Api\Doctrine\Proxy\ApiCollection;
7
-use Doctrine\Common\Collections\Collection;
8 6
 use Doctrine\Common\Persistence\ObjectRepository;
9 7
 use ScayTrase\Api\Rpc\RpcClientInterface;
10 8
 
Please login to merge, or discard this patch.
Cache/KeyStrategyInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,5 +24,5 @@
 block discarded – undo
24 24
      *
25 25
      * @return string
26 26
      */
27
-    public function getEntityKey(ApiMetadata $metadata,array $identifier);
27
+    public function getEntityKey(ApiMetadata $metadata, array $identifier);
28 28
 }
Please login to merge, or discard this patch.
Mapping/Driver/YmlMetadataDriver.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -87,8 +87,7 @@
 block discarded – undo
87 87
             if (array_key_exists('entityPath', $element['client'])) {
88 88
                 $pathSeparator  =
89 89
                     array_key_exists('entityPathSeparator', $element['client']) ?
90
-                        $element['client']['entityPathSeparator'] :
91
-                        null;
90
+                        $element['client']['entityPathSeparator'] : null;
92 91
                 $methodProvider = new EntityMethodProvider($element['client']['entityPath'], $pathSeparator);
93 92
             }
94 93
 
Please login to merge, or discard this patch.
Mapping/EntityMetadata.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -491,7 +491,7 @@
 block discarded – undo
491 491
         }
492 492
 
493 493
         // Fetch mode. Default fetch mode to LAZY, if not set.
494
-        if ( ! isset($mapping['fetch'])) {
494
+        if (!isset($mapping['fetch'])) {
495 495
             $mapping['fetch'] = self::FETCH_LAZY;
496 496
         }
497 497
 
Please login to merge, or discard this patch.
Proxy/ApiCollection.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
         return array_udiff_assoc(
205 205
             $this->snapshot,
206 206
             $this->collection->toArray(),
207
-            function ($a, $b) {
207
+            function($a, $b) {
208 208
                 return $a === $b ? 0 : 1;
209 209
             }
210 210
         );
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
         return array_udiff_assoc(
222 222
             $this->collection->toArray(),
223 223
             $this->snapshot,
224
-            function ($a, $b) {
224
+            function($a, $b) {
225 225
                 return $a === $b ? 0 : 1;
226 226
             }
227 227
         );
Please login to merge, or discard this patch.
Rpc/SearchArgumentsTransformer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
                 /** @var EntityMetadata $target */
45 45
                 $target = $this->manager->getClassMetadata($mapping['target']);
46 46
 
47
-                $converter = function ($value) use ($target) {
47
+                $converter = function($value) use ($target) {
48 48
                     if (!is_object($value)) {
49 49
                         return $value;
50 50
                     }
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
                     $values = $converter($values);
71 71
                 }
72 72
             } else {
73
-                $caster = function ($value) use ($field) {
73
+                $caster = function($value) use ($field) {
74 74
                     $type = $this->manager
75 75
                         ->getConfiguration()
76 76
                         ->getTypeRegistry()->get($this->metadata->getTypeOfField($field));
Please login to merge, or discard this patch.
UnitOfWork.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1683,7 +1683,7 @@  discard block
 block discarded – undo
1683 1683
         $class               = $this->em->getClassMetadata(get_class($entity));
1684 1684
         $associationMappings = array_filter(
1685 1685
             $class->associationMappings,
1686
-            function ($assoc) {
1686
+            function($assoc) {
1687 1687
                 return $assoc['isCascadeRefresh'];
1688 1688
             }
1689 1689
         );
@@ -1722,7 +1722,7 @@  discard block
 block discarded – undo
1722 1722
         $class               = $this->em->getClassMetadata(get_class($entity));
1723 1723
         $associationMappings = array_filter(
1724 1724
             $class->associationMappings,
1725
-            function ($assoc) {
1725
+            function($assoc) {
1726 1726
                 return $assoc['isCascadeDetach'];
1727 1727
             }
1728 1728
         );
@@ -1762,7 +1762,7 @@  discard block
 block discarded – undo
1762 1762
         $class               = $this->manager->getClassMetadata(get_class($entity));
1763 1763
         $associationMappings = array_filter(
1764 1764
             $class->getAssociationMappings(),
1765
-            function ($assoc) {
1765
+            function($assoc) {
1766 1766
                 return $assoc['isCascadeMerge'];
1767 1767
             }
1768 1768
         );
@@ -1800,11 +1800,11 @@  discard block
 block discarded – undo
1800 1800
         $class               = $this->em->getClassMetadata(get_class($entity));
1801 1801
         $associationMappings = array_filter(
1802 1802
             $class->associationMappings,
1803
-            function ($assoc) {
1803
+            function($assoc) {
1804 1804
                 return $assoc['isCascadeRemove'];
1805 1805
             }
1806 1806
         );
1807
-        $entitiesToCascade   = [];
1807
+        $entitiesToCascade = [];
1808 1808
         foreach ($associationMappings as $assoc) {
1809 1809
             if ($entity instanceof Proxy && !$entity->__isInitialized__) {
1810 1810
                 $entity->__load();
Please login to merge, or discard this patch.
Tests/CollectionLoadingTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
         foreach ($entities as $entity) {
46 46
             self::assertInternalType('int', $entity->getId());
47 47
             self::assertInstanceOf(SubEntity::class, $entity);
48
-            self::assertEquals('test-payload-'.$entity->getId(), $entity->getPayload());
48
+            self::assertEquals('test-payload-' . $entity->getId(), $entity->getPayload());
49 49
             self::assertEquals('sub-payload', $entity->getSubPayload());
50 50
 
51 51
             if (null !== $entity->getStringPayload()) {
Please login to merge, or discard this patch.