Passed
Push — develop ( 3ec3b4...7073d3 )
by nguereza
01:54
created
src/Relation/PrimaryKey.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -55,8 +55,7 @@  discard block
 block discarded – undo
55 55
  * @package Platine\Orm\Relation
56 56
  * @template TEntity as Entity
57 57
  */
58
-class PrimaryKey
59
-{
58
+class PrimaryKey {
60 59
     /**
61 60
      *
62 61
      * @var array<int, string>
@@ -73,8 +72,7 @@  discard block
 block discarded – undo
73 72
      * Create new instance
74 73
      * @param string ...$columns
75 74
      */
76
-    public function __construct(string ...$columns)
77
-    {
75
+    public function __construct(string ...$columns) {
78 76
         $this->columns = $columns;
79 77
         $this->composite = count($columns) > 1;
80 78
     }
@@ -104,8 +102,7 @@  discard block
 block discarded – undo
104 102
      *
105 103
      * @return mixed|array<string, mixed>|null
106 104
      */
107
-    public function getValue(array $columns, bool $map = false)
108
-    {
105
+    public function getValue(array $columns, bool $map = false) {
109 106
         if (!$this->composite && !$map) {
110 107
             return isset($columns[$this->columns[0]])
111 108
                     ? $columns[$this->columns[0]]
@@ -130,8 +127,7 @@  discard block
 block discarded – undo
130 127
      *
131 128
      * @return mixed|array<string, mixed>|null
132 129
      */
133
-    public function getValueFromDataMapper(DataMapper $mapper, bool $map = false)
134
-    {
130
+    public function getValueFromDataMapper(DataMapper $mapper, bool $map = false) {
135 131
         return $this->getValue($mapper->getRawColumns(), $map);
136 132
     }
137 133
 
@@ -141,8 +137,7 @@  discard block
 block discarded – undo
141 137
      * @param bool $map
142 138
      * @return mixed|array<string, mixed>|null
143 139
      */
144
-    public function getValueFromEntity(Entity $entity, bool $map = false)
145
-    {
140
+    public function getValueFromEntity(Entity $entity, bool $map = false) {
146 141
         $columns = Proxy::instance()->getEntityColumns($entity);
147 142
         return $this->getValue($columns, $map);
148 143
     }
Please login to merge, or discard this patch.
src/Relation/ForeignKey.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -50,8 +50,7 @@  discard block
 block discarded – undo
50 50
  * @class ForeignKey
51 51
  * @package Platine\Orm\Relation
52 52
  */
53
-class ForeignKey
54
-{
53
+class ForeignKey {
55 54
     /**
56 55
      *
57 56
      * @var array<string, string>
@@ -68,8 +67,7 @@  discard block
 block discarded – undo
68 67
      * Create new instance
69 68
      * @param array<string, string> $columns
70 69
      */
71
-    public function __construct(array $columns)
72
-    {
70
+    public function __construct(array $columns) {
73 71
         $this->columns = $columns;
74 72
         $this->composite = count($columns) > 1;
75 73
     }
@@ -99,8 +97,7 @@  discard block
 block discarded – undo
99 97
      *
100 98
      * @return mixed|array<string, mixed>|null
101 99
      */
102
-    public function getValue(array $columns, bool $map = false)
103
-    {
100
+    public function getValue(array $columns, bool $map = false) {
104 101
         if (!$map && !$this->composite) {
105 102
             $column = array_keys($this->columns);
106 103
 
@@ -127,8 +124,7 @@  discard block
 block discarded – undo
127 124
      *
128 125
      * @return mixed|array<string, mixed>|null
129 126
      */
130
-    public function getInverseValue(array $columns, bool $map = false)
131
-    {
127
+    public function getInverseValue(array $columns, bool $map = false) {
132 128
         if (!$map && !$this->composite) {
133 129
             $column = array_values($this->columns);
134 130
 
@@ -154,8 +150,7 @@  discard block
 block discarded – undo
154 150
      *
155 151
      * @return mixed|array<string, mixed>|null
156 152
      */
157
-    public function extractValue(array $columns, bool $map = false)
158
-    {
153
+    public function extractValue(array $columns, bool $map = false) {
159 154
         if (!$map && !$this->composite) {
160 155
             $column = array_values($this->columns);
161 156
 
Please login to merge, or discard this patch.
src/EntityManager.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -58,8 +58,7 @@  discard block
 block discarded – undo
58 58
  * @package Platine\Orm
59 59
  * @template TEntity as Entity
60 60
  */
61
-class EntityManager
62
-{
61
+class EntityManager {
63 62
     /**
64 63
      * The connection
65 64
      * @var Connection
@@ -82,8 +81,7 @@  discard block
 block discarded – undo
82 81
      * Create new instance
83 82
      * @param Connection $connection
84 83
      */
85
-    public function __construct(Connection $connection)
86
-    {
84
+    public function __construct(Connection $connection) {
87 85
         $this->connection = $connection;
88 86
         $this->dateFormat = $connection->getDriver()->getDateFormat();
89 87
     }
Please login to merge, or discard this patch.
src/Entity.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -199,9 +199,9 @@
 block discarded – undo
199 199
     }
200 200
 
201 201
         /**
202
-     * Map the entity information
203
-     * @param EntityMapperInterface<TEntity> $mapper
204
-     */
202
+         * Map the entity information
203
+         * @param EntityMapperInterface<TEntity> $mapper
204
+         */
205 205
     abstract public static function mapEntity(EntityMapperInterface $mapper): void;
206 206
 
207 207
     /**
Please login to merge, or discard this patch.
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -58,8 +58,7 @@  discard block
 block discarded – undo
58 58
  * @package Platine\Orm
59 59
  * @template TEntity as Entity
60 60
  */
61
-abstract class Entity implements JsonSerializable
62
-{
61
+abstract class Entity implements JsonSerializable {
63 62
     /**
64 63
      * The instance of data mapper
65 64
      * @var DataMapper<TEntity> |null
@@ -103,8 +102,7 @@  discard block
 block discarded – undo
103 102
      * Convert entity to JSON array
104 103
      * @return array<string, mixed>
105 104
      */
106
-    public function jsonSerialize()
107
-    {
105
+    public function jsonSerialize() {
108 106
         $rawColumns = $this->mapper()->getRawColumns();
109 107
         $data = [];
110 108
         foreach ($rawColumns as $name => $value) {
@@ -125,8 +123,7 @@  discard block
 block discarded – undo
125 123
      * @param string $name
126 124
      * @return mixed
127 125
      */
128
-    public function __get(string $name)
129
-    {
126
+    public function __get(string $name) {
130 127
         if ($this->mapper()->hasRelation($name)) {
131 128
             return $this->mapper()->getRelated($name);
132 129
         }
@@ -147,8 +144,7 @@  discard block
 block discarded – undo
147 144
      * @param mixed $value
148 145
      * @return void
149 146
      */
150
-    public function __set(string $name, $value)
151
-    {
147
+    public function __set(string $name, $value) {
152 148
         if ($this->mapper()->hasRelation($name)) {
153 149
             if (is_array($value)) {
154 150
                 foreach ($value as $entity) {
@@ -167,8 +163,7 @@  discard block
 block discarded – undo
167 163
      * @param string $name
168 164
      * @return bool
169 165
      */
170
-    public function __isset(string $name)
171
-    {
166
+    public function __isset(string $name) {
172 167
         return $this->mapper()->hasRelation($name)
173 168
                 || $this->mapper()->hasColumn($name);
174 169
     }
@@ -178,8 +173,7 @@  discard block
 block discarded – undo
178 173
      * @param string $name
179 174
      * @return bool
180 175
      */
181
-    public function __unset(string $name)
182
-    {
176
+    public function __unset(string $name) {
183 177
         $this->mapper()->clearColumn($name, true);
184 178
     }
185 179
 
Please login to merge, or discard this patch.
src/Mapper/Proxy.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -60,8 +60,7 @@  discard block
 block discarded – undo
60 60
  * @package Platine\Orm\Mapper
61 61
  * @template TEntity as Entity
62 62
  */
63
-class Proxy
64
-{
63
+class Proxy {
65 64
     /**
66 65
      * The Entity data mapper arguments property
67 66
      * @var ReflectionProperty
@@ -78,8 +77,7 @@  discard block
 block discarded – undo
78 77
      * Create new instance
79 78
      * @throws ReflectionException
80 79
      */
81
-    private function __construct()
82
-    {
80
+    private function __construct() {
83 81
         $reflection = new ReflectionClass(Entity::class);
84 82
 
85 83
         $this->dataMapperArgs = $reflection->getProperty('dataMapperArgs');
Please login to merge, or discard this patch.
src/Mapper/EntityMapperInterface.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,8 +53,7 @@
 block discarded – undo
53 53
  * @package Platine\Orm\Mapper
54 54
  * @template TEntity as \Platine\Orm\Entity
55 55
  */
56
-interface EntityMapperInterface
57
-{
56
+interface EntityMapperInterface {
58 57
     /**
59 58
      * The name of the entity
60 59
      * @param string $name
Please login to merge, or discard this patch.
src/Mapper/DataMapperInterface.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,8 +53,7 @@
 block discarded – undo
53 53
  * @package Platine\Orm\Mapper
54 54
  * @template TEntity as Entity
55 55
  */
56
-interface DataMapperInterface
57
-{
56
+interface DataMapperInterface {
58 57
     /**
59 58
      * Whether the record is new
60 59
      * @return bool
Please login to merge, or discard this patch.