Skip to content

Commit

Permalink
Fix CS.
Browse files Browse the repository at this point in the history
  • Loading branch information
euromark committed Jul 6, 2014
1 parent 804ad32 commit 5cde784
Show file tree
Hide file tree
Showing 19 changed files with 85 additions and 87 deletions.
2 changes: 1 addition & 1 deletion src/Database/Expression/QueryExpression.php
Expand Up @@ -434,7 +434,7 @@ protected function _addConditions(array $conditions, array $types) {
if ($numericKey && empty($c)) { if ($numericKey && empty($c)) {
continue; continue;
} }

if (is_callable($c)) { if (is_callable($c)) {
$expr = new QueryExpression([], $typeMap); $expr = new QueryExpression([], $typeMap);
$c = $c($expr, $this); $c = $c($expr, $this);
Expand Down
34 changes: 17 additions & 17 deletions src/Routing/Router.php
Expand Up @@ -1149,23 +1149,23 @@ public static function prefix($name, $callback) {
} }


/** /**
* Add plugin routes. * Add plugin routes.
* *
* This method creates a scoped route collection that includes * This method creates a scoped route collection that includes
* relevant plugin information. * relevant plugin information.
* *
* The plugin name will be inflected to the underscore version to create * The plugin name will be inflected to the underscore version to create
* the routing path. If you want a custom path name, use the `path` option. * the routing path. If you want a custom path name, use the `path` option.
* *
* Routes connected in the scoped collection will have the correct path segment * Routes connected in the scoped collection will have the correct path segment
* prepended, and have a matching plugin routing key set. * prepended, and have a matching plugin routing key set.
* *
* @param string $path The path name to use for the prefix. * @param string $path The path name to use for the prefix.
* @param array|callable $options Either the options to use, or a callback. * @param array|callable $options Either the options to use, or a callback.
* @param callable $callback The callback to invoke that builds the plugin routes. * @param callable $callback The callback to invoke that builds the plugin routes.
* Only required when $options is defined. * Only required when $options is defined.
* @return void * @return void
*/ */
public static function plugin($name, $options = [], $callback = null) { public static function plugin($name, $options = [], $callback = null) {
if ($callback === null) { if ($callback === null) {
$callback = $options; $callback = $options;
Expand Down
34 changes: 17 additions & 17 deletions src/Routing/ScopedRouteCollection.php
Expand Up @@ -481,23 +481,23 @@ public function prefix($name, callable $callback) {
} }


/** /**
* Add plugin routes. * Add plugin routes.
* *
* This method creates a new scoped route collection that includes * This method creates a new scoped route collection that includes
* relevant plugin information. * relevant plugin information.
* *
* The plugin name will be inflected to the underscore version to create * The plugin name will be inflected to the underscore version to create
* the routing path. If you want a custom path name, use the `path` option. * the routing path. If you want a custom path name, use the `path` option.
* *
* Routes connected in the scoped collection will have the correct path segment * Routes connected in the scoped collection will have the correct path segment
* prepended, and have a matching plugin routing key set. * prepended, and have a matching plugin routing key set.
* *
* @param string $path The path name to use for the prefix. * @param string $path The path name to use for the prefix.
* @param array|callable $options Either the options to use, or a callback. * @param array|callable $options Either the options to use, or a callback.
* @param callable $callback The callback to invoke that builds the plugin routes. * @param callable $callback The callback to invoke that builds the plugin routes.
* Only required when $options is defined. * Only required when $options is defined.
* @return void * @return void
*/ */
public function plugin($name, $options = [], $callback = null) { public function plugin($name, $options = [], $callback = null) {
if ($callback === null) { if ($callback === null) {
$callback = $options; $callback = $options;
Expand Down
3 changes: 1 addition & 2 deletions tests/TestCase/Console/Command/Task/ModelTaskTest.php
Expand Up @@ -716,8 +716,7 @@ public function testBakeTableValidation() {
$this->assertContains("->add('email', 'valid', ['rule' => 'email'])", $result); $this->assertContains("->add('email', 'valid', ['rule' => 'email'])", $result);
$this->assertContains( $this->assertContains(
"->add('email', 'unique', ['rule' => 'validateUnique', 'provider' => 'table'])", "->add('email', 'unique', ['rule' => 'validateUnique', 'provider' => 'table'])",
$result) $result);
;
$this->assertContains("->allowEmpty('id', 'create')", $result); $this->assertContains("->allowEmpty('id', 'create')", $result);
$this->assertContains("->allowEmpty('email')", $result); $this->assertContains("->allowEmpty('email')", $result);
$this->assertContains("->validatePresence('name', 'create')", $result); $this->assertContains("->validatePresence('name', 'create')", $result);
Expand Down
46 changes: 23 additions & 23 deletions tests/TestCase/Database/ConnectionTest.php
Expand Up @@ -111,7 +111,7 @@ public function testDisabledDriver() {
* *
* @expectedException \Cake\Database\Error\MissingConnectionException * @expectedException \Cake\Database\Error\MissingConnectionException
* @return void * @return void
**/ */
public function testWrongCredentials() { public function testWrongCredentials() {
$config = ConnectionManager::config('test'); $config = ConnectionManager::config('test');
$this->skipIf(isset($config['dsn']), 'Datasource has dsn, skipping.'); $this->skipIf(isset($config['dsn']), 'Datasource has dsn, skipping.');
Expand All @@ -123,7 +123,7 @@ public function testWrongCredentials() {
* Tests creation of prepared statements * Tests creation of prepared statements
* *
* @return void * @return void
**/ */
public function testPrepare() { public function testPrepare() {
$sql = 'SELECT 1 + 1'; $sql = 'SELECT 1 + 1';
$result = $this->connection->prepare($sql); $result = $this->connection->prepare($sql);
Expand All @@ -141,7 +141,7 @@ public function testPrepare() {
* Tests executing a simple query using bound values * Tests executing a simple query using bound values
* *
* @return void * @return void
**/ */
public function testExecuteWithArguments() { public function testExecuteWithArguments() {
$sql = 'SELECT 1 + ?'; $sql = 'SELECT 1 + ?';
$statement = $this->connection->execute($sql, [1], array('integer')); $statement = $this->connection->execute($sql, [1], array('integer'));
Expand Down Expand Up @@ -169,7 +169,7 @@ public function testExecuteWithArguments() {
* Tests executing a query with params and associated types * Tests executing a query with params and associated types
* *
* @return void * @return void
**/ */
public function testExecuteWithArgumentsAndTypes() { public function testExecuteWithArgumentsAndTypes() {
$sql = "SELECT '2012-01-01' = ?"; $sql = "SELECT '2012-01-01' = ?";
$statement = $this->connection->execute($sql, [new \DateTime('2012-01-01')], ['date']); $statement = $this->connection->execute($sql, [new \DateTime('2012-01-01')], ['date']);
Expand All @@ -183,7 +183,7 @@ public function testExecuteWithArgumentsAndTypes() {
* *
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
* @return void * @return void
**/ */
public function testExecuteWithMissingType() { public function testExecuteWithMissingType() {
$sql = 'SELECT ?'; $sql = 'SELECT ?';
$statement = $this->connection->execute($sql, [new \DateTime('2012-01-01')], ['bar']); $statement = $this->connection->execute($sql, [new \DateTime('2012-01-01')], ['bar']);
Expand All @@ -193,7 +193,7 @@ public function testExecuteWithMissingType() {
* Tests executing a query with no params also works * Tests executing a query with no params also works
* *
* @return void * @return void
**/ */
public function testExecuteWithNoParams() { public function testExecuteWithNoParams() {
$sql = 'SELECT 1'; $sql = 'SELECT 1';
$statement = $this->connection->execute($sql); $statement = $this->connection->execute($sql);
Expand All @@ -207,7 +207,7 @@ public function testExecuteWithNoParams() {
* Tests it is possible to insert data into a table using matching types by key name * Tests it is possible to insert data into a table using matching types by key name
* *
* @return void * @return void
**/ */
public function testInsertWithMatchingTypes() { public function testInsertWithMatchingTypes() {
$data = ['id' => '3', 'title' => 'a title', 'body' => 'a body']; $data = ['id' => '3', 'title' => 'a title', 'body' => 'a body'];
$result = $this->connection->insert( $result = $this->connection->insert(
Expand All @@ -228,7 +228,7 @@ public function testInsertWithMatchingTypes() {
* Tests it is possible to insert data into a table using matching types by array position * Tests it is possible to insert data into a table using matching types by array position
* *
* @return void * @return void
**/ */
public function testInsertWithPositionalTypes() { public function testInsertWithPositionalTypes() {
$data = ['id' => '3', 'title' => 'a title', 'body' => 'a body']; $data = ['id' => '3', 'title' => 'a title', 'body' => 'a body'];
$result = $this->connection->insert( $result = $this->connection->insert(
Expand All @@ -249,7 +249,7 @@ public function testInsertWithPositionalTypes() {
* Tests an statement class can be reused for multiple executions * Tests an statement class can be reused for multiple executions
* *
* @return void * @return void
**/ */
public function testStatementReusing() { public function testStatementReusing() {
$total = $this->connection->execute('SELECT COUNT(*) AS total FROM things'); $total = $this->connection->execute('SELECT COUNT(*) AS total FROM things');
$result = $total->fetch('assoc'); $result = $total->fetch('assoc');
Expand All @@ -271,7 +271,7 @@ public function testStatementReusing() {
* Tests rows can be updated without specifying any conditions nor types * Tests rows can be updated without specifying any conditions nor types
* *
* @return void * @return void
**/ */
public function testUpdateWithoutConditionsNorTypes() { public function testUpdateWithoutConditionsNorTypes() {
$title = 'changed the title!'; $title = 'changed the title!';
$body = 'changed the body!'; $body = 'changed the body!';
Expand All @@ -285,7 +285,7 @@ public function testUpdateWithoutConditionsNorTypes() {
* Tests it is possible to use key => value conditions for update * Tests it is possible to use key => value conditions for update
* *
* @return void * @return void
**/ */
public function testUpdateWithConditionsNoTypes() { public function testUpdateWithConditionsNoTypes() {
$title = 'changed the title!'; $title = 'changed the title!';
$body = 'changed the body!'; $body = 'changed the body!';
Expand All @@ -299,7 +299,7 @@ public function testUpdateWithConditionsNoTypes() {
* Tests it is possible to use key => value and string conditions for update * Tests it is possible to use key => value and string conditions for update
* *
* @return void * @return void
**/ */
public function testUpdateWithConditionsCombinedNoTypes() { public function testUpdateWithConditionsCombinedNoTypes() {
$title = 'changed the title!'; $title = 'changed the title!';
$body = 'changed the body!'; $body = 'changed the body!';
Expand All @@ -313,7 +313,7 @@ public function testUpdateWithConditionsCombinedNoTypes() {
* Tests you can bind types to update values * Tests you can bind types to update values
* *
* @return void * @return void
**/ */
public function testUpdateWithTypes() { public function testUpdateWithTypes() {
$title = 'changed the title!'; $title = 'changed the title!';
$body = new \DateTime('2012-01-01'); $body = new \DateTime('2012-01-01');
Expand All @@ -332,7 +332,7 @@ public function testUpdateWithTypes() {
* Tests you can bind types to update values * Tests you can bind types to update values
* *
* @return void * @return void
**/ */
public function testUpdateWithConditionsAndTypes() { public function testUpdateWithConditionsAndTypes() {
$title = 'changed the title!'; $title = 'changed the title!';
$body = new \DateTime('2012-01-01'); $body = new \DateTime('2012-01-01');
Expand All @@ -349,7 +349,7 @@ public function testUpdateWithConditionsAndTypes() {
* Tests delete from table with no conditions * Tests delete from table with no conditions
* *
* @return void * @return void
**/ */
public function testDeleteNoConditions() { public function testDeleteNoConditions() {
$this->connection->delete('things'); $this->connection->delete('things');
$result = $this->connection->execute('SELECT * FROM things'); $result = $this->connection->execute('SELECT * FROM things');
Expand All @@ -360,7 +360,7 @@ public function testDeleteNoConditions() {
/** /**
* Tests delete from table with conditions * Tests delete from table with conditions
* @return void * @return void
**/ */
public function testDeleteWithConditions() { public function testDeleteWithConditions() {
$this->connection->delete('things', ['id' => '1-rest-is-ommited'], ['id' => 'integer']); $this->connection->delete('things', ['id' => '1-rest-is-ommited'], ['id' => 'integer']);
$result = $this->connection->execute('SELECT * FROM things'); $result = $this->connection->execute('SELECT * FROM things');
Expand All @@ -382,7 +382,7 @@ public function testDeleteWithConditions() {
* Tests that it is possible to use simple database transactions * Tests that it is possible to use simple database transactions
* *
* @return void * @return void
**/ */
public function testSimpleTransactions() { public function testSimpleTransactions() {
$this->connection->begin(); $this->connection->begin();
$this->connection->delete('things', ['id' => 1]); $this->connection->delete('things', ['id' => 1]);
Expand All @@ -403,7 +403,7 @@ public function testSimpleTransactions() {
* with early rollback algorithm * with early rollback algorithm
* *
* @return void * @return void
**/ */
public function testVirtualNestedTrasanction() { public function testVirtualNestedTrasanction() {
//starting 3 virtual transaction //starting 3 virtual transaction
$this->connection->begin(); $this->connection->begin();
Expand All @@ -426,7 +426,7 @@ public function testVirtualNestedTrasanction() {
* with early rollback algorithm * with early rollback algorithm
* *
* @return void * @return void
**/ */
public function testVirtualNestedTrasanction2() { public function testVirtualNestedTrasanction2() {
//starting 3 virtual transaction //starting 3 virtual transaction
$this->connection->begin(); $this->connection->begin();
Expand All @@ -447,7 +447,7 @@ public function testVirtualNestedTrasanction2() {
* with early rollback algorithm * with early rollback algorithm
* *
* @return void * @return void
**/ */


public function testVirtualNestedTrasanction3() { public function testVirtualNestedTrasanction3() {
//starting 3 virtual transaction //starting 3 virtual transaction
Expand All @@ -470,7 +470,7 @@ public function testVirtualNestedTrasanction3() {
* Tests that it is possible to real use nested transactions * Tests that it is possible to real use nested transactions
* *
* @return void * @return void
**/ */
public function testSavePoints() { public function testSavePoints() {
$this->skipIf(!$this->connection->useSavePoints(true)); $this->skipIf(!$this->connection->useSavePoints(true));


Expand Down Expand Up @@ -498,7 +498,7 @@ public function testSavePoints() {
* Tests that it is possible to real use nested transactions * Tests that it is possible to real use nested transactions
* *
* @return void * @return void
**/ */


public function testSavePoints2() { public function testSavePoints2() {
$this->skipIf(!$this->connection->useSavePoints(true)); $this->skipIf(!$this->connection->useSavePoints(true));
Expand Down Expand Up @@ -526,7 +526,7 @@ public function testSavePoints2() {
* Tests connection can quote values to be safely used in query strings * Tests connection can quote values to be safely used in query strings
* *
* @return void * @return void
**/ */
public function testQuote() { public function testQuote() {
$this->skipIf(!$this->connection->supportsQuoting()); $this->skipIf(!$this->connection->supportsQuoting());
$expected = "'2012-01-01'"; $expected = "'2012-01-01'";
Expand Down
Expand Up @@ -19,7 +19,7 @@
/** /**
* Tests FunctionExpression class * Tests FunctionExpression class
* *
**/ */
class FunctionExpressionTest extends \Cake\TestSuite\TestCase { class FunctionExpressionTest extends \Cake\TestSuite\TestCase {


/** /**
Expand Down
Expand Up @@ -22,7 +22,7 @@
/** /**
* Tests IdentifierExpression class * Tests IdentifierExpression class
* *
**/ */
class IdentifierExpressionTest extends TestCase { class IdentifierExpressionTest extends TestCase {


/** /**
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Database/Expression/TupleComparisonTest.php
Expand Up @@ -22,7 +22,7 @@
/** /**
* Tests TupleComparison class * Tests TupleComparison class
* *
**/ */
class TupleComparisonTest extends TestCase { class TupleComparisonTest extends TestCase {


/** /**
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Database/FunctionsBuilderTest.php
Expand Up @@ -19,7 +19,7 @@
/** /**
* Tests FunctionsBuilder class * Tests FunctionsBuilder class
* *
**/ */
class FunctionsBuilderTest extends \Cake\TestSuite\TestCase { class FunctionsBuilderTest extends \Cake\TestSuite\TestCase {


/** /**
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Database/Log/LoggedQueryTest.php
Expand Up @@ -19,7 +19,7 @@
/** /**
* Tests LoggedQuery class * Tests LoggedQuery class
* *
**/ */
class LoggedQueryTest extends \Cake\TestSuite\TestCase { class LoggedQueryTest extends \Cake\TestSuite\TestCase {


/** /**
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Database/Log/LoggingStatementTest.php
Expand Up @@ -20,7 +20,7 @@
/** /**
* Tests LoggingStatement class * Tests LoggingStatement class
* *
**/ */
class LoggingStatementTest extends \Cake\TestSuite\TestCase { class LoggingStatementTest extends \Cake\TestSuite\TestCase {


/** /**
Expand Down

0 comments on commit 5cde784

Please sign in to comment.