Skip to content

Commit

Permalink
Fix more doc block errors in lib/
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Jun 28, 2014
1 parent a1ae31e commit 9172124
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 44 deletions.
18 changes: 8 additions & 10 deletions lib/Cake/Model/AclNode.php
Expand Up @@ -89,8 +89,8 @@ public function node($ref = null) {
)),
'order' => $db->name("{$type}.lft") . ' DESC'
);
$conditionsAfterJoin = array();

$conditionsAfterJoin = array();

foreach ($path as $i => $alias) {
$j = $i - 1;
Expand All @@ -103,20 +103,18 @@ public function node($ref = null) {
$db->name("{$type}{$i}.alias") . ' = ' . $db->value($alias, 'string')
)
);
// it will be better if this conditions will performs after join operation
$conditionsAfterJoin[] = $db->name("{$type}{$j}.id") . ' = ' . $db->name("{$type}{$i}.parent_id");
$conditionsAfterJoin[] = $db->name("{$type}{$i}.rght") . ' < ' . $db->name("{$type}{$j}.rght");
$conditionsAfterJoin[] = $db->name("{$type}{$i}.lft") . ' > ' . $db->name("{$type}{$j}.lft");

// it will be better if this conditions will performs after join operation
$conditionsAfterJoin[] = $db->name("{$type}{$j}.id") . ' = ' . $db->name("{$type}{$i}.parent_id");
$conditionsAfterJoin[] = $db->name("{$type}{$i}.rght") . ' < ' . $db->name("{$type}{$j}.rght");
$conditionsAfterJoin[] = $db->name("{$type}{$i}.lft") . ' > ' . $db->name("{$type}{$j}.lft");

$queryData['conditions'] = array('or' => array(
$db->name("{$type}.lft") . ' <= ' . $db->name("{$type}0.lft") . ' AND ' . $db->name("{$type}.rght") . ' >= ' . $db->name("{$type}0.rght"),
$db->name("{$type}.lft") . ' <= ' . $db->name("{$type}{$i}.lft") . ' AND ' . $db->name("{$type}.rght") . ' >= ' . $db->name("{$type}{$i}.rght"))
);
}

$queryData['conditions'] = array_merge($queryData['conditions'], $conditionsAfterJoin);

$queryData['conditions'] = array_merge($queryData['conditions'], $conditionsAfterJoin);
$result = $db->read($this, $queryData, -1);
$path = array_values($path);

Expand Down
14 changes: 7 additions & 7 deletions lib/Cake/Model/Datasource/DataSource.php
Expand Up @@ -89,7 +89,7 @@ public function __construct($config = array()) {
/**
* Caches/returns cached results for child instances
*
* @param mixed $data
* @param mixed $data Unused in this class.
* @return array Array of sources available in this datasource.
*/
public function listSources($data = null) {
Expand All @@ -116,7 +116,7 @@ public function listSources($data = null) {
/**
* Returns a Model description (metadata) or null if none found.
*
* @param Model|string $model
* @param Model|string $model The model to describe.
* @return array Array of Metadata for the $model
*/
public function describe($model) {
Expand Down Expand Up @@ -214,7 +214,7 @@ public function read(Model $Model, $queryData = array(), $recursive = null) {
* @param Model $Model Instance of the model class being updated
* @param array $fields Array of fields to be updated
* @param array $values Array of values to be update $fields to.
* @param mixed $conditions
* @param mixed $conditions The array of conditions to use.
* @return boolean Success
*/
public function update(Model $Model, $fields = null, $values = null, $conditions = null) {
Expand All @@ -237,7 +237,7 @@ public function delete(Model $Model, $conditions = null) {
/**
* Returns the ID generated from the previous INSERT operation.
*
* @param mixed $source
* @param mixed $source The source name.
* @return mixed Last ID key generated in previous INSERT
*/
public function lastInsertId($source = null) {
Expand All @@ -247,7 +247,7 @@ public function lastInsertId($source = null) {
/**
* Returns the number of rows returned by last operation.
*
* @param mixed $source
* @param mixed $source The source name.
* @return integer Number of rows returned by last operation
*/
public function lastNumRows($source = null) {
Expand All @@ -257,7 +257,7 @@ public function lastNumRows($source = null) {
/**
* Returns the number of rows affected by last query.
*
* @param mixed $source
* @param mixed $source The source name.
* @return integer Number of rows affected by last query.
*/
public function lastAffected($source = null) {
Expand Down Expand Up @@ -320,7 +320,7 @@ protected function _cacheDescription($object, $data = null) {
* @param array $data Array of data with values that will be inserted in placeholders.
* @param string $association Name of association model being replaced.
* @param Model $Model Model instance.
* @param array $stack
* @param array $stack The context stack.
* @return mixed String of query data with placeholders replaced, or false on failure.
*/
public function insertQueryData($query, $data, $association, Model $Model, $stack) {
Expand Down
20 changes: 10 additions & 10 deletions lib/Cake/Model/Datasource/Database/Sqlite.php
Expand Up @@ -135,7 +135,7 @@ public function enabled() {
/**
* Returns an array of tables in the database. If there are no tables, an error is raised and the application exits.
*
* @param mixed $data
* @param mixed $data Unused.
* @return array Array of table names in the database
*/
public function listSources($data = null) {
Expand Down Expand Up @@ -202,10 +202,10 @@ public function describe($model) {
/**
* Generates and executes an SQL UPDATE statement for given model, fields, and values.
*
* @param Model $model
* @param array $fields
* @param array $values
* @param mixed $conditions
* @param Model $model The model instance to update.
* @param array $fields The fields to update.
* @param array $values The values to set columns to.
* @param mixed $conditions array of conditions to use.
* @return array
*/
public function update(Model $model, $fields = array(), $values = null, $conditions = null) {
Expand Down Expand Up @@ -448,9 +448,9 @@ public function getEncoding() {
/**
* Removes redundant primary key indexes, as they are handled in the column def of the key.
*
* @param array $indexes
* @param string $table
* @return string
* @param array $indexes The indexes to build.
* @param string $table The table name.
* @return string The completed index.
*/
public function buildIndex($indexes, $table = null) {
$join = array();
Expand Down Expand Up @@ -526,8 +526,8 @@ public function index($model) {
/**
* Overrides DboSource::renderStatement to handle schema generation with SQLite-style indexes
*
* @param string $type
* @param array $data
* @param string $type The type of statement being rendered.
* @param array $data The data to convert to SQL.
* @return string
*/
public function renderStatement($type, $data) {
Expand Down
34 changes: 17 additions & 17 deletions lib/Cake/TestSuite/Reporter/CakeBaseReporter.php
Expand Up @@ -141,9 +141,9 @@ public function paintResult(PHPUnit_Framework_TestResult $result) {
/**
* An error occurred.
*
* @param PHPUnit_Framework_Test $test The test to add an error for.
* @param Exception $e The exception object to add.
* @param float $time The current time.
* @param PHPUnit_Framework_Test $test The test to add an error for.
* @param Exception $e The exception object to add.
* @param float $time The current time.
* @return void
*/
public function addError(PHPUnit_Framework_Test $test, Exception $e, $time) {
Expand All @@ -153,9 +153,9 @@ public function addError(PHPUnit_Framework_Test $test, Exception $e, $time) {
/**
* A failure occurred.
*
* @param PHPUnit_Framework_Test $test The test that failed
* @param PHPUnit_Framework_AssertionFailedError $e The assertion that failed.
* @param float $time The current time.
* @param PHPUnit_Framework_Test $test The test that failed
* @param PHPUnit_Framework_AssertionFailedError $e The assertion that failed.
* @param float $time The current time.
* @return void
*/
public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time) {
Expand All @@ -165,9 +165,9 @@ public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_Asser
/**
* Incomplete test.
*
* @param PHPUnit_Framework_Test $test The test that was incomplete.
* @param Exception $e The incomplete exception
* @param float $time The current time.
* @param PHPUnit_Framework_Test $test The test that was incomplete.
* @param Exception $e The incomplete exception
* @param float $time The current time.
* @return void
*/
public function addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, $time) {
Expand All @@ -177,9 +177,9 @@ public function addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, $t
/**
* Skipped test.
*
* @param PHPUnit_Framework_Test $test The test that failed.
* @param Exception $e The skip object.
* @param float $time The current time.
* @param PHPUnit_Framework_Test $test The test that failed.
* @param Exception $e The skip object.
* @param float $time The current time.
* @return void
*/
public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time) {
Expand All @@ -189,7 +189,7 @@ public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time
/**
* A test suite started.
*
* @param PHPUnit_Framework_TestSuite $suite The suite to start
* @param PHPUnit_Framework_TestSuite $suite The suite to start
* @return void
*/
public function startTestSuite(PHPUnit_Framework_TestSuite $suite) {
Expand All @@ -202,7 +202,7 @@ public function startTestSuite(PHPUnit_Framework_TestSuite $suite) {
/**
* A test suite ended.
*
* @param PHPUnit_Framework_TestSuite $suite The suite that ended.
* @param PHPUnit_Framework_TestSuite $suite The suite that ended.
* @return void
*/
public function endTestSuite(PHPUnit_Framework_TestSuite $suite) {
Expand All @@ -211,7 +211,7 @@ public function endTestSuite(PHPUnit_Framework_TestSuite $suite) {
/**
* A test started.
*
* @param PHPUnit_Framework_Test $test The test that started.
* @param PHPUnit_Framework_Test $test The test that started.
* @return void
*/
public function startTest(PHPUnit_Framework_Test $test) {
Expand All @@ -220,8 +220,8 @@ public function startTest(PHPUnit_Framework_Test $test) {
/**
* A test ended.
*
* @param PHPUnit_Framework_Test $test The test that ended
* @param float $time The current time.
* @param PHPUnit_Framework_Test $test The test that ended
* @param float $time The current time.
* @return void
*/
public function endTest(PHPUnit_Framework_Test $test, $time) {
Expand Down

0 comments on commit 9172124

Please sign in to comment.