@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | { |
| 36 | 36 | error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE); |
| 37 | 37 | } |
| 38 | - $whoops->pushHandler(function () { |
|
| 38 | + $whoops->pushHandler(function() { |
|
| 39 | 39 | Response::create('Uh oh, something broke internally.', Response::HTTP_INTERNAL_SERVER_ERROR)->send(); |
| 40 | 40 | }); |
| 41 | 41 | } |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | /** |
| 61 | 61 | * Routes |
| 62 | 62 | */ |
| 63 | -$dispatcher = FastRoute\simpleDispatcher(function (FastRoute\RouteCollector $r) { |
|
| 63 | +$dispatcher = FastRoute\simpleDispatcher(function(FastRoute\RouteCollector $r) { |
|
| 64 | 64 | $routes = require __DIR__ . '/routes.php'; |
| 65 | 65 | foreach ($routes as $route) { |
| 66 | 66 | $r->addRoute($route[0], $route[1], $route[2]); |
@@ -4,20 +4,20 @@ |
||
| 4 | 4 | $serviceContainer->checkVersion('2.0.0-dev'); |
| 5 | 5 | $serviceContainer->setAdapterClass('default', 'mysql'); |
| 6 | 6 | $manager = new \Propel\Runtime\Connection\ConnectionManagerSingle(); |
| 7 | -$manager->setConfiguration(array ( |
|
| 7 | +$manager->setConfiguration(array( |
|
| 8 | 8 | 'classname' => 'Propel\\Runtime\\Connection\\ProfilerConnectionWrapper', |
| 9 | 9 | 'dsn' => getenv('DB_CONN'), |
| 10 | 10 | 'user' => getenv('DB_USER'), |
| 11 | 11 | 'password' => getenv('DB_PASS'), |
| 12 | 12 | 'attributes' => |
| 13 | - array ( |
|
| 13 | + array( |
|
| 14 | 14 | 'ATTR_EMULATE_PREPARES' => false, |
| 15 | 15 | ), |
| 16 | 16 | 'settings' => |
| 17 | - array ( |
|
| 17 | + array( |
|
| 18 | 18 | 'charset' => 'utf8', |
| 19 | 19 | 'queries' => |
| 20 | - array ( |
|
| 20 | + array( |
|
| 21 | 21 | 'utf8' => 'SET NAMES utf8 COLLATE utf8_unicode_ci, COLLATION_CONNECTION = utf8_unicode_ci, COLLATION_DATABASE = utf8_unicode_ci, COLLATION_SERVER = utf8_unicode_ci', |
| 22 | 22 | ), |
| 23 | 23 | ), |
@@ -97,12 +97,12 @@ discard block |
||
| 97 | 97 | * first dimension keys are the type constants |
| 98 | 98 | * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id' |
| 99 | 99 | */ |
| 100 | - protected static $fieldNames = array ( |
|
| 101 | - self::TYPE_PHPNAME => array('Id', 'CreatedAt', 'UpdatedAt', ), |
|
| 102 | - self::TYPE_CAMELNAME => array('id', 'createdAt', 'updatedAt', ), |
|
| 103 | - self::TYPE_COLNAME => array(TaskTableMap::COL_ID, TaskTableMap::COL_CREATED_AT, TaskTableMap::COL_UPDATED_AT, ), |
|
| 104 | - self::TYPE_FIELDNAME => array('id', 'created_at', 'updated_at', ), |
|
| 105 | - self::TYPE_NUM => array(0, 1, 2, ) |
|
| 100 | + protected static $fieldNames = array( |
|
| 101 | + self::TYPE_PHPNAME => array('Id', 'CreatedAt', 'UpdatedAt',), |
|
| 102 | + self::TYPE_CAMELNAME => array('id', 'createdAt', 'updatedAt',), |
|
| 103 | + self::TYPE_COLNAME => array(TaskTableMap::COL_ID, TaskTableMap::COL_CREATED_AT, TaskTableMap::COL_UPDATED_AT,), |
|
| 104 | + self::TYPE_FIELDNAME => array('id', 'created_at', 'updated_at',), |
|
| 105 | + self::TYPE_NUM => array(0, 1, 2,) |
|
| 106 | 106 | ); |
| 107 | 107 | |
| 108 | 108 | /** |
@@ -111,12 +111,12 @@ discard block |
||
| 111 | 111 | * first dimension keys are the type constants |
| 112 | 112 | * e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0 |
| 113 | 113 | */ |
| 114 | - protected static $fieldKeys = array ( |
|
| 115 | - self::TYPE_PHPNAME => array('Id' => 0, 'CreatedAt' => 1, 'UpdatedAt' => 2, ), |
|
| 116 | - self::TYPE_CAMELNAME => array('id' => 0, 'createdAt' => 1, 'updatedAt' => 2, ), |
|
| 117 | - self::TYPE_COLNAME => array(TaskTableMap::COL_ID => 0, TaskTableMap::COL_CREATED_AT => 1, TaskTableMap::COL_UPDATED_AT => 2, ), |
|
| 118 | - self::TYPE_FIELDNAME => array('id' => 0, 'created_at' => 1, 'updated_at' => 2, ), |
|
| 119 | - self::TYPE_NUM => array(0, 1, 2, ) |
|
| 114 | + protected static $fieldKeys = array( |
|
| 115 | + self::TYPE_PHPNAME => array('Id' => 0, 'CreatedAt' => 1, 'UpdatedAt' => 2,), |
|
| 116 | + self::TYPE_CAMELNAME => array('id' => 0, 'createdAt' => 1, 'updatedAt' => 2,), |
|
| 117 | + self::TYPE_COLNAME => array(TaskTableMap::COL_ID => 0, TaskTableMap::COL_CREATED_AT => 1, TaskTableMap::COL_UPDATED_AT => 2,), |
|
| 118 | + self::TYPE_FIELDNAME => array('id' => 0, 'created_at' => 1, 'updated_at' => 2,), |
|
| 119 | + self::TYPE_NUM => array(0, 1, 2,) |
|
| 120 | 120 | ); |
| 121 | 121 | |
| 122 | 122 | /** |
@@ -395,8 +395,8 @@ discard block |
||
| 395 | 395 | $criteria = $criteria->buildCriteria(); // build Criteria from Task object |
| 396 | 396 | } |
| 397 | 397 | |
| 398 | - if ($criteria->containsKey(TaskTableMap::COL_ID) && $criteria->keyContainsValue(TaskTableMap::COL_ID) ) { |
|
| 399 | - throw new PropelException('Cannot insert a value for auto-increment primary key ('.TaskTableMap::COL_ID.')'); |
|
| 398 | + if ($criteria->containsKey(TaskTableMap::COL_ID) && $criteria->keyContainsValue(TaskTableMap::COL_ID)) { |
|
| 399 | + throw new PropelException('Cannot insert a value for auto-increment primary key (' . TaskTableMap::COL_ID . ')'); |
|
| 400 | 400 | } |
| 401 | 401 | |
| 402 | 402 | |
@@ -405,7 +405,7 @@ discard block |
||
| 405 | 405 | |
| 406 | 406 | // use transaction because $criteria could contain info |
| 407 | 407 | // for more than one table (I guess, conceivably) |
| 408 | - return $con->transaction(function () use ($con, $query) { |
|
| 408 | + return $con->transaction(function() use ($con, $query) { |
|
| 409 | 409 | return $query->doInsert($con); |
| 410 | 410 | }); |
| 411 | 411 | } |
@@ -524,7 +524,7 @@ discard block |
||
| 524 | 524 | |
| 525 | 525 | // use transaction because $criteria could contain info |
| 526 | 526 | // for more than one table or we could emulating ON DELETE CASCADE, etc. |
| 527 | - return $con->transaction(function () use ($con) { |
|
| 527 | + return $con->transaction(function() use ($con) { |
|
| 528 | 528 | $affectedRows = 0; // initialize var to track total num of affected rows |
| 529 | 529 | $affectedRows += parent::doDeleteAll($con); |
| 530 | 530 | // Because this db requires some delete cascade/set null emulation, we have to |
@@ -559,7 +559,7 @@ discard block |
||
| 559 | 559 | |
| 560 | 560 | // use transaction because $criteria could contain info |
| 561 | 561 | // for more than one table or we could emulating ON DELETE CASCADE, etc. |
| 562 | - return $con->transaction(function () use ($con, $criteria) { |
|
| 562 | + return $con->transaction(function() use ($con, $criteria) { |
|
| 563 | 563 | $affectedRows = 0; // initialize var to track total num of affected rows |
| 564 | 564 | |
| 565 | 565 | UserTableMap::removeInstanceFromPool($criteria); |
@@ -524,7 +524,7 @@ discard block |
||
| 524 | 524 | |
| 525 | 525 | // use transaction because $criteria could contain info |
| 526 | 526 | // for more than one table or we could emulating ON DELETE CASCADE, etc. |
| 527 | - return $con->transaction(function () use ($con) { |
|
| 527 | + return $con->transaction(function() use ($con) { |
|
| 528 | 528 | $affectedRows = 0; // initialize var to track total num of affected rows |
| 529 | 529 | $affectedRows += parent::doDeleteAll($con); |
| 530 | 530 | // Because this db requires some delete cascade/set null emulation, we have to |
@@ -559,7 +559,7 @@ discard block |
||
| 559 | 559 | |
| 560 | 560 | // use transaction because $criteria could contain info |
| 561 | 561 | // for more than one table or we could emulating ON DELETE CASCADE, etc. |
| 562 | - return $con->transaction(function () use ($con, $criteria) { |
|
| 562 | + return $con->transaction(function() use ($con, $criteria) { |
|
| 563 | 563 | $affectedRows = 0; // initialize var to track total num of affected rows |
| 564 | 564 | |
| 565 | 565 | UserTableMap::removeInstanceFromPool($criteria); |
@@ -711,7 +711,7 @@ discard block |
||
| 711 | 711 | $con = Propel::getServiceContainer()->getWriteConnection(UserTableMap::DATABASE_NAME); |
| 712 | 712 | } |
| 713 | 713 | |
| 714 | - $con->transaction(function () use ($con) { |
|
| 714 | + $con->transaction(function() use ($con) { |
|
| 715 | 715 | $deleteQuery = ChildUserQuery::create() |
| 716 | 716 | ->filterByPrimaryKey($this->getPrimaryKey()); |
| 717 | 717 | $ret = $this->preDelete($con); |
@@ -746,7 +746,7 @@ discard block |
||
| 746 | 746 | $con = Propel::getServiceContainer()->getWriteConnection(UserTableMap::DATABASE_NAME); |
| 747 | 747 | } |
| 748 | 748 | |
| 749 | - return $con->transaction(function () use ($con) { |
|
| 749 | + return $con->transaction(function() use ($con) { |
|
| 750 | 750 | $isInsert = $this->isNew(); |
| 751 | 751 | $ret = $this->preSave($con); |
| 752 | 752 | if ($isInsert) { |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | public function getUpSQL() |
| 39 | 39 | { |
| 40 | - return array ( |
|
| 40 | + return array( |
|
| 41 | 41 | 'default' => ' |
| 42 | 42 | # This is a fix for InnoDB in MySQL >= 4.1.x |
| 43 | 43 | # It "suspends judgement" for fkey relationships until are tables are set. |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | */ |
| 68 | 68 | public function getDownSQL() |
| 69 | 69 | { |
| 70 | - return array ( |
|
| 70 | + return array( |
|
| 71 | 71 | 'default' => ' |
| 72 | 72 | # This is a fix for InnoDB in MySQL >= 4.1.x |
| 73 | 73 | # It "suspends judgement" for fkey relationships until are tables are set. |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | public function findById($id) |
| 30 | 30 | { |
| 31 | 31 | if (!$User = UserQuery::create()->findPk($id)) { |
| 32 | - throw new \InvalidArgumentException(sprintf('User with ID %d does not exist',$id)); |
|
| 32 | + throw new \InvalidArgumentException(sprintf('User with ID %d does not exist', $id)); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | return $User; |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | |
| 62 | 62 | if (!$Model->save()) { |
| 63 | - throw new \DomainException(sprintf('User not save',$id)); |
|
| 63 | + throw new \DomainException(sprintf('User not save', $id)); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | return true; |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | * |
| 71 | 71 | * @return \Models\User\Models\User\User $User |
| 72 | 72 | */ |
| 73 | - public function build(){ |
|
| 73 | + public function build() { |
|
| 74 | 74 | return new User; |
| 75 | 75 | } |
| 76 | 76 | |
@@ -117,12 +117,12 @@ discard block |
||
| 117 | 117 | * first dimension keys are the type constants |
| 118 | 118 | * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id' |
| 119 | 119 | */ |
| 120 | - protected static $fieldNames = array ( |
|
| 121 | - self::TYPE_PHPNAME => array('Id', 'Name', 'Email', 'Password', 'RememberToken', 'CreatedAt', 'UpdatedAt', ), |
|
| 122 | - self::TYPE_CAMELNAME => array('id', 'name', 'email', 'password', 'rememberToken', 'createdAt', 'updatedAt', ), |
|
| 123 | - self::TYPE_COLNAME => array(UserTableMap::COL_ID, UserTableMap::COL_NAME, UserTableMap::COL_EMAIL, UserTableMap::COL_PASSWORD, UserTableMap::COL_REMEMBER_TOKEN, UserTableMap::COL_CREATED_AT, UserTableMap::COL_UPDATED_AT, ), |
|
| 124 | - self::TYPE_FIELDNAME => array('id', 'name', 'email', 'password', 'remember_token', 'created_at', 'updated_at', ), |
|
| 125 | - self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, ) |
|
| 120 | + protected static $fieldNames = array( |
|
| 121 | + self::TYPE_PHPNAME => array('Id', 'Name', 'Email', 'Password', 'RememberToken', 'CreatedAt', 'UpdatedAt',), |
|
| 122 | + self::TYPE_CAMELNAME => array('id', 'name', 'email', 'password', 'rememberToken', 'createdAt', 'updatedAt',), |
|
| 123 | + self::TYPE_COLNAME => array(UserTableMap::COL_ID, UserTableMap::COL_NAME, UserTableMap::COL_EMAIL, UserTableMap::COL_PASSWORD, UserTableMap::COL_REMEMBER_TOKEN, UserTableMap::COL_CREATED_AT, UserTableMap::COL_UPDATED_AT,), |
|
| 124 | + self::TYPE_FIELDNAME => array('id', 'name', 'email', 'password', 'remember_token', 'created_at', 'updated_at',), |
|
| 125 | + self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6,) |
|
| 126 | 126 | ); |
| 127 | 127 | |
| 128 | 128 | /** |
@@ -131,12 +131,12 @@ discard block |
||
| 131 | 131 | * first dimension keys are the type constants |
| 132 | 132 | * e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0 |
| 133 | 133 | */ |
| 134 | - protected static $fieldKeys = array ( |
|
| 135 | - self::TYPE_PHPNAME => array('Id' => 0, 'Name' => 1, 'Email' => 2, 'Password' => 3, 'RememberToken' => 4, 'CreatedAt' => 5, 'UpdatedAt' => 6, ), |
|
| 136 | - self::TYPE_CAMELNAME => array('id' => 0, 'name' => 1, 'email' => 2, 'password' => 3, 'rememberToken' => 4, 'createdAt' => 5, 'updatedAt' => 6, ), |
|
| 137 | - self::TYPE_COLNAME => array(UserTableMap::COL_ID => 0, UserTableMap::COL_NAME => 1, UserTableMap::COL_EMAIL => 2, UserTableMap::COL_PASSWORD => 3, UserTableMap::COL_REMEMBER_TOKEN => 4, UserTableMap::COL_CREATED_AT => 5, UserTableMap::COL_UPDATED_AT => 6, ), |
|
| 138 | - self::TYPE_FIELDNAME => array('id' => 0, 'name' => 1, 'email' => 2, 'password' => 3, 'remember_token' => 4, 'created_at' => 5, 'updated_at' => 6, ), |
|
| 139 | - self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, ) |
|
| 134 | + protected static $fieldKeys = array( |
|
| 135 | + self::TYPE_PHPNAME => array('Id' => 0, 'Name' => 1, 'Email' => 2, 'Password' => 3, 'RememberToken' => 4, 'CreatedAt' => 5, 'UpdatedAt' => 6,), |
|
| 136 | + self::TYPE_CAMELNAME => array('id' => 0, 'name' => 1, 'email' => 2, 'password' => 3, 'rememberToken' => 4, 'createdAt' => 5, 'updatedAt' => 6,), |
|
| 137 | + self::TYPE_COLNAME => array(UserTableMap::COL_ID => 0, UserTableMap::COL_NAME => 1, UserTableMap::COL_EMAIL => 2, UserTableMap::COL_PASSWORD => 3, UserTableMap::COL_REMEMBER_TOKEN => 4, UserTableMap::COL_CREATED_AT => 5, UserTableMap::COL_UPDATED_AT => 6,), |
|
| 138 | + self::TYPE_FIELDNAME => array('id' => 0, 'name' => 1, 'email' => 2, 'password' => 3, 'remember_token' => 4, 'created_at' => 5, 'updated_at' => 6,), |
|
| 139 | + self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6,) |
|
| 140 | 140 | ); |
| 141 | 141 | |
| 142 | 142 | /** |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | public function getBehaviors() |
| 182 | 182 | { |
| 183 | 183 | return array( |
| 184 | - 'validate' => array('rule5' => array ('column' => 'email','validator' => 'Email',), ), |
|
| 184 | + 'validate' => array('rule5' => array('column' => 'email', 'validator' => 'Email',),), |
|
| 185 | 185 | ); |
| 186 | 186 | } // getBehaviors() |
| 187 | 187 | |
@@ -440,8 +440,8 @@ discard block |
||
| 440 | 440 | $criteria = $criteria->buildCriteria(); // build Criteria from User object |
| 441 | 441 | } |
| 442 | 442 | |
| 443 | - if ($criteria->containsKey(UserTableMap::COL_ID) && $criteria->keyContainsValue(UserTableMap::COL_ID) ) { |
|
| 444 | - throw new PropelException('Cannot insert a value for auto-increment primary key ('.UserTableMap::COL_ID.')'); |
|
| 443 | + if ($criteria->containsKey(UserTableMap::COL_ID) && $criteria->keyContainsValue(UserTableMap::COL_ID)) { |
|
| 444 | + throw new PropelException('Cannot insert a value for auto-increment primary key (' . UserTableMap::COL_ID . ')'); |
|
| 445 | 445 | } |
| 446 | 446 | |
| 447 | 447 | |
@@ -450,7 +450,7 @@ discard block |
||
| 450 | 450 | |
| 451 | 451 | // use transaction because $criteria could contain info |
| 452 | 452 | // for more than one table (I guess, conceivably) |
| 453 | - return $con->transaction(function () use ($con, $query) { |
|
| 453 | + return $con->transaction(function() use ($con, $query) { |
|
| 454 | 454 | return $query->doInsert($con); |
| 455 | 455 | }); |
| 456 | 456 | } |