Completed
Push — master ( c928d4...502244 )
by Viacheslav
12:21 queued 07:59
created
src/Database/Entity.php 2 patches
Doc Comments   +7 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 
57 57
     /**
58 58
      * @param Table|null $table
59
-     * @return static
59
+     * @return Definition\Columns
60 60
      */
61 61
     public static function columns(Table $table = null)
62 62
     {
@@ -183,6 +183,9 @@  discard block
 block discarded – undo
183 183
 
184 184
     private $originalData;
185 185
 
186
+    /**
187
+     * @param Entity $object
188
+     */
186 189
     static function fromArray(array $row, $object = null, $source = null)
187 190
     {
188 191
         if (is_null($object)) {
@@ -335,6 +338,9 @@  discard block
 block discarded – undo
335 338
         }
336 339
     }
337 340
 
341
+    /**
342
+     * @param string $class
343
+     */
338 344
     private static function getDatabase($class)
339 345
     {
340 346
         if (isset(self::$databases[$class])) {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
     public static function table($alias = null)
32 32
     {
33 33
         $className = get_called_class();
34
-        $tableKey = $className . ($alias ? ':' . $alias : '');
34
+        $tableKey = $className.($alias ? ':'.$alias : '');
35 35
         $table = &self::$tables[$tableKey];
36 36
         if (null !== $table) {
37 37
             return $table;
Please login to merge, or discard this patch.
src/Sql/AlterTable.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,6 @@
 block discarded – undo
7 7
 use Yaoi\Database\Definition\ForeignKey;
8 8
 use Yaoi\Database\Definition\Index;
9 9
 use Yaoi\Database\Definition\Table;
10
-use YaoiTests\Helper\Entity\User;
11 10
 
12 11
 class AlterTable extends Batch
13 12
 {
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
         $this->after = $after;
26 26
 
27 27
         $this->bindDatabase($before->database());
28
-        $alterExpression = new SimpleExpression('ALTER TABLE ?' . PHP_EOL, new Symbol($this->after->schemaName));
28
+        $alterExpression = new SimpleExpression('ALTER TABLE ?'.PHP_EOL, new Symbol($this->after->schemaName));
29 29
         $this->alterLines = new SimpleExpression();
30
-        $this->alterLines->setOpComma(',' . PHP_EOL);
30
+        $this->alterLines->setOpComma(','.PHP_EOL);
31 31
         $this->add($alterExpression);
32 32
 
33 33
         $this->processColumns();
@@ -48,13 +48,13 @@  discard block
 block discarded – undo
48 48
             $afterTypeString = $afterColumn->getTypeString();
49 49
 
50 50
             if (!isset($beforeColumns[$columnName])) {
51
-                $this->alterLines->commaExpr('ADD COLUMN ? ' . $afterTypeString, new Symbol($afterColumn->schemaName));
51
+                $this->alterLines->commaExpr('ADD COLUMN ? '.$afterTypeString, new Symbol($afterColumn->schemaName));
52 52
             } else {
53 53
                 $beforeColumn = $beforeColumns[$columnName];
54 54
                 $beforeColumn->setFlag(Column::IS_REFLECTED);
55 55
                 if ($beforeColumn->getTypeString() !== $afterTypeString) {
56 56
                     //var_dump('MODIFY:' . $beforeColumn->schemaName, $beforeColumn->getTypeString(), $afterTypeString);
57
-                    $this->alterLines->commaExpr('MODIFY COLUMN ? ' . $afterTypeString, new Symbol($afterColumn->schemaName));
57
+                    $this->alterLines->commaExpr('MODIFY COLUMN ? '.$afterTypeString, new Symbol($afterColumn->schemaName));
58 58
                 }
59 59
                 unset($beforeColumns[$columnName]);
60 60
             }
Please login to merge, or discard this patch.
src/Sql/Symbol.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
 
24 24
 
25 25
     /**
26
-     * @param array|Columns $columns
26
+     * @param Column[] $columns
27 27
      * @return array|Symbol[]
28 28
      */
29 29
     public static function prepareColumns($columns) {
Please login to merge, or discard this patch.
src/Database/Definition/Table.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
             $columns = array();
61 61
             /** @var Column $column */
62 62
             foreach ($this->columns->getArray() as $column) {
63
-                $columns [$column->schemaName]= $column;
63
+                $columns [$column->schemaName] = $column;
64 64
             }
65 65
             return $columns;
66 66
         }
@@ -88,10 +88,10 @@  discard block
 block discarded – undo
88 88
         /** @var Column $column */
89 89
         $index = new Index($columns);
90 90
         $index->setType(Index::TYPE_PRIMARY);
91
-        $this->indexes [Index::TYPE_PRIMARY]= $index;
91
+        $this->indexes [Index::TYPE_PRIMARY] = $index;
92 92
 
93 93
         foreach ($columns as $column) {
94
-            $this->primaryKey [$column->schemaName]= $column;
94
+            $this->primaryKey [$column->schemaName] = $column;
95 95
         }
96 96
         return $this;
97 97
     }
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
             return $this;
112 112
         }
113 113
 
114
-        $this->indexes [$index->getName()]= $index;
114
+        $this->indexes [$index->getName()] = $index;
115 115
 
116 116
         return $this;
117 117
     }
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
     private $foreignKeys = array();
161 161
     public function addForeignKey(ForeignKey $foreignKey) {
162 162
         //$foreignKey->getReferencedTable()->dependentTables [$this->schemaName]= $this;
163
-        $this->foreignKeys [$foreignKey->getName()]= $foreignKey;
163
+        $this->foreignKeys [$foreignKey->getName()] = $foreignKey;
164 164
         foreach ($foreignKey->getLocalColumns() as $column) {
165 165
             $this->columnForeignKeys[$column->propertyName] = $foreignKey;
166 166
         }
Please login to merge, or discard this patch.
src/Database/Definition/Columns.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@
 block discarded – undo
75 75
     public function __get($name)
76 76
     {
77 77
         if (!isset($this->_arrayOfColumnData[$name])) {
78
-            throw new Exception('Unknown column ' . $name);
78
+            throw new Exception('Unknown column '.$name);
79 79
         }
80 80
         return $this->_arrayOfColumnData[$name];
81 81
     }
Please login to merge, or discard this patch.