Merge pull request #3829 from cakephp/api-doc-fixes

API doc fixes
This commit is contained in:
ADmad 2014-06-29 11:51:41 +05:30
commit 153f530a01
5 changed files with 44 additions and 46 deletions

View file

@ -123,9 +123,9 @@ before_script:
}
}
}" > app/Config/database.php
script:
- sh -c "if [ '$PHPCS' = '1' ]; then phpcs -p --extensions=php --standard=CakePHP ./lib/Cake; elif [ '$DB' = 'mysql' ]; then ./lib/Cake/Console/cake test core AllTests --stderr; else ./lib/Cake/Console/cake test core AllDbRelated --stderr; fi"
- sh -c "if [ '$PHPCS' != '1' ]; then ./lib/Cake/Console/cake test core AllTests --stderr; fi"
- sh -c "if [ '$PHPCS' = '1' ]; then phpcs -p --extensions=php --standard=CakePHP ./lib/Cake; fi;"
notifications:
email: false

View file

@ -90,7 +90,7 @@ class AclNode extends Model {
'order' => $db->name("{$type}.lft") . ' DESC'
);
$conditionsAfterJoin = array();
$conditionsAfterJoin = array();
foreach ($path as $i => $alias) {
$j = $i - 1;
@ -104,19 +104,17 @@ class AclNode extends Model {
)
);
// 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);

View file

@ -89,7 +89,7 @@ class DataSource extends Object {
/**
* 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) {
@ -116,7 +116,7 @@ class DataSource extends Object {
/**
* 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) {
@ -214,7 +214,7 @@ class DataSource extends Object {
* @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) {
@ -237,7 +237,7 @@ class DataSource extends Object {
/**
* 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) {
@ -247,7 +247,7 @@ class DataSource extends Object {
/**
* 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) {
@ -257,7 +257,7 @@ class DataSource extends Object {
/**
* 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) {
@ -320,7 +320,7 @@ class DataSource extends Object {
* @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) {

View file

@ -135,7 +135,7 @@ class Sqlite extends DboSource {
/**
* 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) {
@ -202,10 +202,10 @@ class Sqlite extends DboSource {
/**
* 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) {
@ -448,9 +448,9 @@ class Sqlite extends DboSource {
/**
* 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();
@ -526,8 +526,8 @@ class Sqlite extends DboSource {
/**
* 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) {

View file

@ -141,9 +141,9 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
/**
* 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) {
@ -153,9 +153,9 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
/**
* 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) {
@ -165,9 +165,9 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
/**
* 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) {
@ -177,9 +177,9 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
/**
* 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) {
@ -189,7 +189,7 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
/**
* 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) {
@ -202,7 +202,7 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
/**
* 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) {
@ -211,7 +211,7 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
/**
* 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) {
@ -220,8 +220,8 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
/**
* 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) {