@@ -144,9 +144,7 @@ discard block |
||
144 | 144 | * |
145 | 145 | * @param string $daonamespace |
146 | 146 | * @param string $beannamespace |
147 | - * @param int $keepSupport |
|
148 | 147 | * @param int $storeInUtc |
149 | - * @param int $castDatesToDateTime |
|
150 | 148 | * @param string $selfedit |
151 | 149 | * |
152 | 150 | * @throws \Mouf\MoufException |
@@ -183,6 +181,9 @@ discard block |
||
183 | 181 | |
184 | 182 | protected $errorMsg; |
185 | 183 | |
184 | + /** |
|
185 | + * @param string $msg |
|
186 | + */ |
|
186 | 187 | private function displayErrorMsg($msg) |
187 | 188 | { |
188 | 189 | $this->errorMsg = $msg; |
@@ -60,6 +60,9 @@ discard block |
||
60 | 60 | |
61 | 61 | private $innerResultIterator; |
62 | 62 | |
63 | + /** |
|
64 | + * @param integer $offset |
|
65 | + */ |
|
63 | 66 | public function __construct(ResultIterator $parentResult, $magicSql, array $parameters, $limit, $offset, array $columnDescriptors, $objectStorage, $className, TDBMService $tdbmService, MagicQuery $magicQuery, $mode) |
64 | 67 | { |
65 | 68 | $this->parentResult = $parentResult; |
@@ -108,7 +111,7 @@ discard block |
||
108 | 111 | } |
109 | 112 | |
110 | 113 | /** |
111 | - * @return int |
|
114 | + * @return double |
|
112 | 115 | */ |
113 | 116 | public function getCurrentPage() |
114 | 117 | { |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | */ |
113 | 113 | public function getCurrentPage() |
114 | 114 | { |
115 | - return floor($this->offset / $this->limit) + 1; |
|
115 | + return floor($this->offset/$this->limit)+1; |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | /** |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | */ |
252 | 252 | public function jsonSerialize() |
253 | 253 | { |
254 | - return array_map(function (AbstractTDBMObject $item) { |
|
254 | + return array_map(function(AbstractTDBMObject $item) { |
|
255 | 255 | return $item->jsonSerialize(); |
256 | 256 | }, $this->toArray()); |
257 | 257 | } |
@@ -66,6 +66,13 @@ discard block |
||
66 | 66 | |
67 | 67 | private $mode; |
68 | 68 | |
69 | + /** |
|
70 | + * @param string $magicSql |
|
71 | + * @param string $magicSqlCount |
|
72 | + * @param WeakrefObjectStorage $objectStorage |
|
73 | + * @param string|null $className |
|
74 | + * @param integer $mode |
|
75 | + */ |
|
69 | 76 | public function __construct($magicSql, $magicSqlCount, array $parameters, array $columnDescriptors, $objectStorage, $className, TDBMService $tdbmService, MagicQuery $magicQuery, $mode) |
70 | 77 | { |
71 | 78 | $this->magicSql = $magicSql; |
@@ -147,6 +154,7 @@ discard block |
||
147 | 154 | |
148 | 155 | /** |
149 | 156 | * @param int $offset |
157 | + * @param integer $limit |
|
150 | 158 | * |
151 | 159 | * @return PageIterator |
152 | 160 | */ |
@@ -241,7 +241,7 @@ |
||
241 | 241 | */ |
242 | 242 | public function jsonSerialize() |
243 | 243 | { |
244 | - return array_map(function (AbstractTDBMObject $item) { |
|
244 | + return array_map(function(AbstractTDBMObject $item) { |
|
245 | 245 | return $item->jsonSerialize(); |
246 | 246 | }, $this->toArray()); |
247 | 247 | } |
@@ -777,7 +777,7 @@ discard block |
||
777 | 777 | * This is used internally by TDBM to add an object to the list of objects that have been |
778 | 778 | * created/updated but not saved yet. |
779 | 779 | * |
780 | - * @param AbstractTDBMObject $myObject |
|
780 | + * @param DbRow $myObject |
|
781 | 781 | */ |
782 | 782 | public function _addToToSaveObjectList(DbRow $myObject) |
783 | 783 | { |
@@ -1441,7 +1441,7 @@ discard block |
||
1441 | 1441 | } |
1442 | 1442 | |
1443 | 1443 | /** |
1444 | - * @param $table |
|
1444 | + * @param string $table |
|
1445 | 1445 | * @param array $primaryKeys |
1446 | 1446 | * @param array $additionalTablesFetch |
1447 | 1447 | * @param bool $lazy Whether to perform lazy loading on this object or not. |
@@ -1616,7 +1616,7 @@ discard block |
||
1616 | 1616 | * @param $pivotTableName |
1617 | 1617 | * @param AbstractTDBMObject $bean |
1618 | 1618 | * |
1619 | - * @return AbstractTDBMObject[] |
|
1619 | + * @return ResultIterator |
|
1620 | 1620 | */ |
1621 | 1621 | public function _getRelatedBeans($pivotTableName, AbstractTDBMObject $bean) |
1622 | 1622 | { |
@@ -1201,7 +1201,7 @@ discard block |
||
1201 | 1201 | sort($tables); |
1202 | 1202 | |
1203 | 1203 | return $this->fromCache($this->cachePrefix.'_linkbetweeninheritedtables_'.implode('__split__', $tables), |
1204 | - function () use ($tables) { |
|
1204 | + function() use ($tables) { |
|
1205 | 1205 | return $this->_getLinkBetweenInheritedTablesWithoutCache($tables); |
1206 | 1206 | }); |
1207 | 1207 | } |
@@ -1249,7 +1249,7 @@ discard block |
||
1249 | 1249 | */ |
1250 | 1250 | public function _getRelatedTablesByInheritance($table) |
1251 | 1251 | { |
1252 | - return $this->fromCache($this->cachePrefix.'_relatedtables_'.$table, function () use ($table) { |
|
1252 | + return $this->fromCache($this->cachePrefix.'_relatedtables_'.$table, function() use ($table) { |
|
1253 | 1253 | return $this->_getRelatedTablesByInheritanceWithoutCache($table); |
1254 | 1254 | }); |
1255 | 1255 | } |
@@ -1509,7 +1509,7 @@ discard block |
||
1509 | 1509 | $objects = $this->findObjects($mainTable, $filterString, $parameters, null, $additionalTablesFetch, self::MODE_ARRAY, $className); |
1510 | 1510 | $page = $objects->take(0, 2); |
1511 | 1511 | $count = $page->count(); |
1512 | - if ($count > 1) { |
|
1512 | + if ($count>1) { |
|
1513 | 1513 | throw new DuplicateRowException("Error while querying an object for table '$mainTable': More than 1 row have been returned, but we should have received at most one."); |
1514 | 1514 | } elseif ($count === 0) { |
1515 | 1515 | return; |
@@ -1626,7 +1626,7 @@ discard block |
||
1626 | 1626 | $remoteTable = $remoteFk->getForeignTableName(); |
1627 | 1627 | |
1628 | 1628 | $primaryKeys = $this->getPrimaryKeyValues($bean); |
1629 | - $columnNames = array_map(function ($name) use ($pivotTableName) { return $pivotTableName.'.'.$name; }, $localFk->getLocalColumns()); |
|
1629 | + $columnNames = array_map(function($name) use ($pivotTableName) { return $pivotTableName.'.'.$name; }, $localFk->getLocalColumns()); |
|
1630 | 1630 | |
1631 | 1631 | $filter = array_combine($columnNames, $primaryKeys); |
1632 | 1632 | |
@@ -1647,7 +1647,7 @@ discard block |
||
1647 | 1647 | $table1 = $fks[0]->getForeignTableName(); |
1648 | 1648 | $table2 = $fks[1]->getForeignTableName(); |
1649 | 1649 | |
1650 | - $beanTables = array_map(function (DbRow $dbRow) { return $dbRow->_getDbTableName(); }, $bean->_getDbRows()); |
|
1650 | + $beanTables = array_map(function(DbRow $dbRow) { return $dbRow->_getDbTableName(); }, $bean->_getDbRows()); |
|
1651 | 1651 | |
1652 | 1652 | if (in_array($table1, $beanTables)) { |
1653 | 1653 | return [$fks[0], $fks[1]]; |
@@ -43,7 +43,6 @@ discard block |
||
43 | 43 | /** |
44 | 44 | * Constructor. |
45 | 45 | * |
46 | - * @param Connection $dbConnection The connection to the database. |
|
47 | 46 | */ |
48 | 47 | public function __construct(SchemaAnalyzer $schemaAnalyzer, Schema $schema, TDBMSchemaAnalyzer $tdbmSchemaAnalyzer) |
49 | 48 | { |
@@ -100,6 +99,9 @@ discard block |
||
100 | 99 | * Generates in one method call the daos and the beans for one table. |
101 | 100 | * |
102 | 101 | * @param $tableName |
102 | + * @param string $daonamespace |
|
103 | + * @param string $beannamespace |
|
104 | + * @param boolean $storeInUtc |
|
103 | 105 | */ |
104 | 106 | public function generateDaoAndBean(Table $table, $daonamespace, $beannamespace, ClassNameMapper $classNameMapper, $storeInUtc) |
105 | 107 | { |
@@ -140,7 +142,7 @@ discard block |
||
140 | 142 | /** |
141 | 143 | * Returns the name of the base bean class from the table name. |
142 | 144 | * |
143 | - * @param $tableName |
|
145 | + * @param string $tableName |
|
144 | 146 | * |
145 | 147 | * @return string |
146 | 148 | */ |
@@ -152,7 +154,7 @@ discard block |
||
152 | 154 | /** |
153 | 155 | * Returns the name of the base DAO class from the table name. |
154 | 156 | * |
155 | - * @param $tableName |
|
157 | + * @param string $tableName |
|
156 | 158 | * |
157 | 159 | * @return string |
158 | 160 | */ |
@@ -223,9 +225,10 @@ discard block |
||
223 | 225 | /** |
224 | 226 | * Writes the PHP bean DAO with simple functions to create/get/save objects. |
225 | 227 | * |
226 | - * @param string $fileName The file that will be written (without the directory) |
|
227 | 228 | * @param string $className The name of the class |
228 | - * @param string $tableName The name of the table |
|
229 | + * @param string $table The name of the table |
|
230 | + * @param string $baseClassName |
|
231 | + * @param string $beanClassName |
|
229 | 232 | */ |
230 | 233 | public function generateDao($className, $baseClassName, $beanClassName, Table $table, $daonamespace, $beannamespace, ClassNameMapper $classNameMapper) |
231 | 234 | { |
@@ -468,6 +471,8 @@ discard block |
||
468 | 471 | * Generates the factory bean. |
469 | 472 | * |
470 | 473 | * @param Table[] $tableList |
474 | + * @param string $daoFactoryClassName |
|
475 | + * @param string $daoNamespace |
|
471 | 476 | */ |
472 | 477 | private function generateFactory(array $tableList, $daoFactoryClassName, $daoNamespace, ClassNameMapper $classNameMapper) |
473 | 478 | { |
@@ -76,11 +76,11 @@ discard block |
||
76 | 76 | |
77 | 77 | // Remove all beans and daos from junction tables |
78 | 78 | $junctionTables = $this->schemaAnalyzer->detectJunctionTables(); |
79 | - $junctionTableNames = array_map(function (Table $table) { |
|
79 | + $junctionTableNames = array_map(function(Table $table) { |
|
80 | 80 | return $table->getName(); |
81 | 81 | }, $junctionTables); |
82 | 82 | |
83 | - $tableList = array_filter($tableList, function (Table $table) use ($junctionTableNames) { |
|
83 | + $tableList = array_filter($tableList, function(Table $table) use ($junctionTableNames) { |
|
84 | 84 | return !in_array($table->getName(), $junctionTableNames); |
85 | 85 | }); |
86 | 86 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | // Ok, let's return the list of all tables. |
94 | 94 | // These will be used by the calling script to create Mouf instances. |
95 | 95 | |
96 | - return array_map(function (Table $table) { return $table->getName(); }, $tableList); |
|
96 | + return array_map(function(Table $table) { return $table->getName(); }, $tableList); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | /** |
@@ -558,7 +558,7 @@ discard block |
||
558 | 558 | $pos = strpos($str, ' '); |
559 | 559 | } |
560 | 560 | $before = substr($str, 0, $pos); |
561 | - $after = substr($str, $pos + 1); |
|
561 | + $after = substr($str, $pos+1); |
|
562 | 562 | $str = $before.strtoupper(substr($after, 0, 1)).substr($after, 1); |
563 | 563 | } |
564 | 564 |
@@ -126,14 +126,14 @@ |
||
126 | 126 | if (strpos($daonamespace, '\\') === 0) { |
127 | 127 | $daonamespace = substr($daonamespace, 1); |
128 | 128 | } |
129 | - if (strpos($daonamespace, '\\') === strlen($daonamespace) - 1) { |
|
130 | - $daonamespace = substr($daonamespace, 0, strlen($daonamespace) - 1); |
|
129 | + if (strpos($daonamespace, '\\') === strlen($daonamespace)-1) { |
|
130 | + $daonamespace = substr($daonamespace, 0, strlen($daonamespace)-1); |
|
131 | 131 | } |
132 | 132 | if (strpos($beannamespace, '\\') === 0) { |
133 | 133 | $beannamespace = substr($beannamespace, 1); |
134 | 134 | } |
135 | - if (strpos($beannamespace, '\\') === strlen($beannamespace) - 1) { |
|
136 | - $beannamespace = substr($beannamespace, 0, strlen($beannamespace) - 1); |
|
135 | + if (strpos($beannamespace, '\\') === strlen($beannamespace)-1) { |
|
136 | + $beannamespace = substr($beannamespace, 0, strlen($beannamespace)-1); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | $tdbmService = new InstanceProxy($name); |
@@ -124,7 +124,7 @@ |
||
124 | 124 | public function getIncomingForeignKeys($tableName) |
125 | 125 | { |
126 | 126 | $junctionTables = $this->schemaAnalyzer->detectJunctionTables(); |
127 | - $junctionTableNames = array_map(function (Table $table) { return $table->getName(); }, $junctionTables); |
|
127 | + $junctionTableNames = array_map(function(Table $table) { return $table->getName(); }, $junctionTables); |
|
128 | 128 | $childrenRelationships = $this->schemaAnalyzer->getChildrenRelationships($tableName); |
129 | 129 | |
130 | 130 | $fks = []; |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | echo 'Then, pass the $hint variable to your getObjects function.'; |
42 | 42 | echo '</div>'; |
43 | 43 | |
44 | - $global_height_px += $height_px + 10; |
|
44 | + $global_height_px += $height_px+10; |
|
45 | 45 | ++$i; |
46 | 46 | } |
47 | 47 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | $possible_sub_paths = self::getAllPossiblePathsRec($sub_table_paths); |
62 | 62 | $return_table_paths = array(); |
63 | 63 | foreach ($table_path['paths'] as $path) { |
64 | - if (count($possible_sub_paths) > 0) { |
|
64 | + if (count($possible_sub_paths)>0) { |
|
65 | 65 | foreach ($possible_sub_paths as $possible_sub_path) { |
66 | 66 | $return_table_paths[] = array_merge(array(array('paths' => array($path))), $possible_sub_path); |
67 | 67 | } |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | */ |
92 | 92 | public function getConstructorProperties() |
93 | 93 | { |
94 | - $constructorProperties = array_filter($this->beanPropertyDescriptors, function (AbstractBeanPropertyDescriptor $property) { |
|
94 | + $constructorProperties = array_filter($this->beanPropertyDescriptors, function(AbstractBeanPropertyDescriptor $property) { |
|
95 | 95 | return $property->isCompulsory(); |
96 | 96 | }); |
97 | 97 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | */ |
106 | 106 | public function getExposedProperties() |
107 | 107 | { |
108 | - $exposedProperties = array_filter($this->beanPropertyDescriptors, function (AbstractBeanPropertyDescriptor $property) { |
|
108 | + $exposedProperties = array_filter($this->beanPropertyDescriptors, function(AbstractBeanPropertyDescriptor $property) { |
|
109 | 109 | return $property->getTable()->getName() == $this->table->getName(); |
110 | 110 | }); |
111 | 111 | |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | $fksByMethodName = []; |
272 | 272 | |
273 | 273 | foreach ($fksByTable as $tableName => $fksForTable) { |
274 | - if (count($fksForTable) > 1) { |
|
274 | + if (count($fksForTable)>1) { |
|
275 | 275 | foreach ($fksForTable as $fk) { |
276 | 276 | $methodName = 'get'.TDBMDaoGenerator::toCamelCase($fk->getLocalTableName()).'By'; |
277 | 277 | |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | |
386 | 386 | $finalDescs = []; |
387 | 387 | foreach ($descs as $descArray) { |
388 | - if (count($descArray) > 1) { |
|
388 | + if (count($descArray)>1) { |
|
389 | 389 | foreach ($descArray as $desc) { |
390 | 390 | $desc['name'] = TDBMDaoGenerator::toCamelCase($desc['remoteFK']->getForeignTableName()).'By'.TDBMDaoGenerator::toCamelCase($desc['table']->getName()); |
391 | 391 | $finalDescs[] = $desc; |