mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Docblock fixes
This commit is contained in:
parent
6670997283
commit
72d6ca636f
56 changed files with 191 additions and 74 deletions
|
@ -108,7 +108,7 @@ class Cache {
|
|||
* @see app/Config/core.php for configuration settings
|
||||
* @param string $name Name of the configuration
|
||||
* @param array $settings Optional associative array of settings passed to the engine
|
||||
* @return array(engine, settings) on success, false on failure
|
||||
* @return array array(engine, settings) on success, false on failure
|
||||
* @throws CacheException
|
||||
*/
|
||||
public static function config($name = null, $settings = array()) {
|
||||
|
|
|
@ -213,7 +213,7 @@ class RedisEngine extends CacheEngine {
|
|||
/**
|
||||
* Disconnects from the redis server
|
||||
*
|
||||
* @return voind
|
||||
* @return void
|
||||
**/
|
||||
public function __destruct() {
|
||||
if (!$this->settings['persistent']) {
|
||||
|
|
|
@ -100,7 +100,7 @@ class CommandListShell extends AppShell {
|
|||
* @param string $type
|
||||
* @param array $shells
|
||||
* @param array $shellList
|
||||
* @return array
|
||||
* @return void
|
||||
*/
|
||||
protected function _appendShells($type, $shells, &$shellList) {
|
||||
foreach ($shells as $shell) {
|
||||
|
|
|
@ -168,6 +168,7 @@ class PluginTask extends AppShell {
|
|||
/**
|
||||
* Update the app's bootstrap.php file.
|
||||
*
|
||||
* @param string $plugin Name of plugin
|
||||
* @return void
|
||||
*/
|
||||
protected function _modifyBootstrap($plugin) {
|
||||
|
@ -184,7 +185,7 @@ class PluginTask extends AppShell {
|
|||
* find and change $this->path to the user selection
|
||||
*
|
||||
* @param array $pathOptions
|
||||
* @return string plugin path
|
||||
* @return void
|
||||
*/
|
||||
public function findPath($pathOptions) {
|
||||
$valid = false;
|
||||
|
|
|
@ -338,7 +338,7 @@ class TestShell extends Shell {
|
|||
* @param string $category
|
||||
* @param boolean $throwOnMissingFile
|
||||
* @access protected
|
||||
* @return array(type, case)
|
||||
* @return array array(type, case)
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function _mapFileToCase($file, $category, $throwOnMissingFile = true) {
|
||||
|
|
|
@ -93,7 +93,7 @@ class ConsoleErrorHandler {
|
|||
/**
|
||||
* Wrapper for exit(), used for testing.
|
||||
*
|
||||
* @param $code int The exit code.
|
||||
* @param int $code The exit code.
|
||||
*/
|
||||
protected function _stop($code = 0) {
|
||||
exit($code);
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
* @package Cake.Console
|
||||
*/
|
||||
class ConsoleOutput {
|
||||
|
||||
/**
|
||||
* Raw output constant - no modification of output text.
|
||||
*/
|
||||
|
@ -73,7 +74,7 @@ class ConsoleOutput {
|
|||
/**
|
||||
* The current output type. Manipulated with ConsoleOutput::outputAs();
|
||||
*
|
||||
* @var integer.
|
||||
* @var integer
|
||||
*/
|
||||
protected $_outputAs = self::COLOR;
|
||||
|
||||
|
|
|
@ -174,7 +174,7 @@ class HelpFormatter {
|
|||
* Get the help as an xml string.
|
||||
*
|
||||
* @param boolean $string Return the SimpleXml object or a string. Defaults to true.
|
||||
* @return mixed. See $string
|
||||
* @return string|SimpleXmlElement See $string
|
||||
*/
|
||||
public function xml($string = true) {
|
||||
$parser = $this->_parser;
|
||||
|
|
|
@ -31,10 +31,18 @@ App::uses('File', 'Utility');
|
|||
class Shell extends Object {
|
||||
|
||||
/**
|
||||
* Output constants for making verbose and quiet shells.
|
||||
* Output constant making verbose shells.
|
||||
*/
|
||||
const VERBOSE = 2;
|
||||
|
||||
/**
|
||||
* Output constant for making normal shells.
|
||||
*/
|
||||
const NORMAL = 1;
|
||||
|
||||
/**
|
||||
* Output constants for making quiet shells.
|
||||
*/
|
||||
const QUIET = 0;
|
||||
|
||||
/**
|
||||
|
|
|
@ -156,7 +156,7 @@ class Component extends Object {
|
|||
* @param string|array $url Either the string or url array that is being redirected to.
|
||||
* @param integer $status The status code of the redirect
|
||||
* @param boolean $exit Will the script exit.
|
||||
* @return array|null Either an array or null.
|
||||
* @return array|void Either an array or null.
|
||||
* @link @link http://book.cakephp.org/2.0/en/controllers/components.html#Component::beforeRedirect
|
||||
*/
|
||||
public function beforeRedirect(Controller $controller, $url, $status = null, $exit = true) {
|
||||
|
|
|
@ -25,7 +25,14 @@
|
|||
*/
|
||||
class PhpAcl extends Object implements AclInterface {
|
||||
|
||||
/**
|
||||
* Constant for deny
|
||||
*/
|
||||
const DENY = false;
|
||||
|
||||
/**
|
||||
* Constant for allow
|
||||
*/
|
||||
const ALLOW = true;
|
||||
|
||||
/**
|
||||
|
@ -206,6 +213,11 @@ class PhpAco {
|
|||
'*' => '.*',
|
||||
);
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param array $rules Rules array
|
||||
*/
|
||||
public function __construct(array $rules = array()) {
|
||||
foreach (array('allow', 'deny') as $type) {
|
||||
if (empty($rules[$type])) {
|
||||
|
@ -219,6 +231,7 @@ class PhpAco {
|
|||
/**
|
||||
* return path to the requested ACO with allow and deny rules attached on each level
|
||||
*
|
||||
* @param string $aco ACO string
|
||||
* @return array
|
||||
*/
|
||||
public function path($aco) {
|
||||
|
@ -263,6 +276,10 @@ class PhpAco {
|
|||
/**
|
||||
* allow/deny ARO access to ARO
|
||||
*
|
||||
* @param string $aro ARO string
|
||||
* @param string $aco ACO string
|
||||
* @param string $action Action string
|
||||
* @param string $type access type
|
||||
* @return void
|
||||
*/
|
||||
public function access($aro, $aco, $action, $type = 'deny') {
|
||||
|
@ -349,8 +366,6 @@ class PhpAro {
|
|||
/**
|
||||
* role to resolve to when a provided ARO is not listed in
|
||||
* the internal tree
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const DEFAULT_ROLE = 'Role/default';
|
||||
|
||||
|
@ -385,6 +400,13 @@ class PhpAro {
|
|||
*/
|
||||
protected $_tree = array();
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param array $aro
|
||||
* @param array $map
|
||||
* @param array $aliases
|
||||
*/
|
||||
public function __construct(array $aro = array(), array $map = array(), array $aliases = array()) {
|
||||
if (!empty($map)) {
|
||||
$this->map = $map;
|
||||
|
|
|
@ -64,7 +64,7 @@ class FormAuthenticate extends BaseAuthenticate {
|
|||
*
|
||||
* @param CakeRequest $request The request that contains login information.
|
||||
* @param CakeResponse $response Unused response object.
|
||||
* @return mixed. False on login failure. An array of User data on success.
|
||||
* @return mixed False on login failure. An array of User data on success.
|
||||
*/
|
||||
public function authenticate(CakeRequest $request, CakeResponse $response) {
|
||||
$userModel = $this->settings['userModel'];
|
||||
|
|
|
@ -38,6 +38,9 @@ App::uses('BaseAuthenticate', 'Controller/Component/Auth');
|
|||
*/
|
||||
class AuthComponent extends Component {
|
||||
|
||||
/**
|
||||
* Constant for 'all'
|
||||
*/
|
||||
const ALL = 'all';
|
||||
|
||||
/**
|
||||
|
|
|
@ -447,7 +447,6 @@ class CookieComponent extends Component {
|
|||
* Encrypts $value using public $type method in Security class
|
||||
*
|
||||
* @param string $value Value to encrypt
|
||||
* @return string encrypted string
|
||||
* @return string Encoded values
|
||||
*/
|
||||
protected function _encrypt($value) {
|
||||
|
|
|
@ -748,7 +748,7 @@ class RequestHandlerComponent extends Component {
|
|||
*
|
||||
* @param array|string $type The type string or array with format `array('type' => 'viewClass')` to map one or more
|
||||
* @param array $viewClass The viewClass to be used for the type without `View` appended
|
||||
* @return array]string Returns viewClass when only string $type is set, else array with viewClassMap
|
||||
* @return array|string Returns viewClass when only string $type is set, else array with viewClassMap
|
||||
*/
|
||||
public function viewClassMap($type = null, $viewClass = null) {
|
||||
if (!$viewClass && is_string($type) && isset($this->_viewClassMap[$type])) {
|
||||
|
|
|
@ -56,7 +56,7 @@ class ComponentCollection extends ObjectCollection implements CakeEventListener
|
|||
/**
|
||||
* Get the controller associated with the collection.
|
||||
*
|
||||
* @return Controller.
|
||||
* @return Controller Controller instance
|
||||
*/
|
||||
public function getController() {
|
||||
return $this->_Controller;
|
||||
|
|
|
@ -745,7 +745,7 @@ class Controller extends Object implements CakeEventListener {
|
|||
* or an absolute URL
|
||||
* @param integer $status Optional HTTP status code (eg: 404)
|
||||
* @param boolean $exit If true, exit() will be called after the redirect
|
||||
* @return mixed void if $exit = false. Terminates script if $exit = true
|
||||
* @return void
|
||||
* @link http://book.cakephp.org/2.0/en/controllers.html#Controller::redirect
|
||||
*/
|
||||
public function redirect($url, $status = null, $exit = true) {
|
||||
|
@ -853,9 +853,8 @@ class Controller extends Object implements CakeEventListener {
|
|||
* setAction('action_with_parameters', $parameter1);
|
||||
* }}}
|
||||
*
|
||||
* @param string $action The new action to be 'redirected' to
|
||||
* @param mixed Any other parameters passed to this method will be passed as
|
||||
* parameters to the new action.
|
||||
* @param string $action The new action to be 'redirected' to.
|
||||
* Any other parameters passed to this method will be passed as parameters to the new action.
|
||||
* @return mixed Returns the return value of the called action
|
||||
*/
|
||||
public function setAction($action) {
|
||||
|
@ -997,7 +996,7 @@ class Controller extends Object implements CakeEventListener {
|
|||
* @param string|array $url Relative string or array-based URL to redirect to after the time expires
|
||||
* @param integer $pause Time to show the message
|
||||
* @param string $layout Layout you want to use, defaults to 'flash'
|
||||
* @return void Renders flash layout
|
||||
* @return void
|
||||
* @link http://book.cakephp.org/2.0/en/controllers.html#Controller::flash
|
||||
*/
|
||||
public function flash($message, $url, $pause = 1, $layout = 'flash') {
|
||||
|
|
|
@ -199,7 +199,7 @@ class Scaffold {
|
|||
* Renders an add or edit action for scaffolded model.
|
||||
*
|
||||
* @param string $action Action (add or edit)
|
||||
* @return mixed A rendered view with a form to edit or add a record in the Models database table
|
||||
* @return void
|
||||
*/
|
||||
protected function _scaffoldForm($action = 'edit') {
|
||||
$this->controller->viewVars['scaffoldFields'] = array_merge(
|
||||
|
@ -351,7 +351,7 @@ class Scaffold {
|
|||
* `public $scaffold;` is placed in the controller's class definition.
|
||||
*
|
||||
* @param CakeRequest $request Request object for scaffolding
|
||||
* @return mixed A rendered view of scaffold action, or showing the error
|
||||
* @return void
|
||||
* @throws MissingActionException When methods are not scaffolded.
|
||||
* @throws MissingDatabaseException When the database connection is undefined.
|
||||
*/
|
||||
|
|
|
@ -88,6 +88,7 @@ class ExceptionRenderer {
|
|||
* code error depending on the code used to construct the error.
|
||||
*
|
||||
* @param Exception $exception Exception
|
||||
* @return mixed Return void or value returned by controller's `appError()` function
|
||||
*/
|
||||
public function __construct(Exception $exception) {
|
||||
$this->controller = $this->_getController($exception);
|
||||
|
|
|
@ -163,6 +163,7 @@ class CakeEventManager {
|
|||
* Removes a listener from the active listeners.
|
||||
*
|
||||
* @param callback|CakeEventListener $callable any valid PHP callback type or an instance of CakeEventListener
|
||||
* @param string $eventKey The event unique identifier name with which the callback has been associated
|
||||
* @return void
|
||||
*/
|
||||
public function detach($callable, $eventKey = null) {
|
||||
|
|
|
@ -17,9 +17,6 @@
|
|||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||
*/
|
||||
|
||||
/**
|
||||
* Included libraries.
|
||||
*/
|
||||
App::uses('CakePlugin', 'Core');
|
||||
App::uses('L10n', 'I18n');
|
||||
App::uses('Multibyte', 'I18n');
|
||||
|
@ -90,6 +87,11 @@ class I18n {
|
|||
'LC_ALL', 'LC_COLLATE', 'LC_CTYPE', 'LC_MONETARY', 'LC_NUMERIC', 'LC_TIME', 'LC_MESSAGES'
|
||||
);
|
||||
|
||||
/**
|
||||
* Escape string
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_escape = null;
|
||||
|
||||
/**
|
||||
|
|
|
@ -358,7 +358,7 @@ class CakeLog {
|
|||
*
|
||||
* @see BaseLog
|
||||
* @param string $streamName Key name of a configured stream to get.
|
||||
* @return $mixed instance of BaseLog or false if not found
|
||||
* @return mixed instance of BaseLog or false if not found
|
||||
*/
|
||||
public static function stream($streamName) {
|
||||
if (empty(self::$_Collection)) {
|
||||
|
|
|
@ -36,6 +36,7 @@ abstract class BaseLog implements CakeLogInterface {
|
|||
/**
|
||||
* __construct method
|
||||
*
|
||||
* @param array $config Configuration array
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($config = array()) {
|
||||
|
|
|
@ -214,7 +214,6 @@ class TranslateBehavior extends ModelBehavior {
|
|||
* Appends a join for translated fields.
|
||||
*
|
||||
* @param Model $Model The model being worked on.
|
||||
* @param object $joinTable The jointable object.
|
||||
* @param array $query The query array to append a join to.
|
||||
* @param string $field The field name being joined.
|
||||
* @param string $aliasField The aliased field name being joined.
|
||||
|
@ -466,6 +465,7 @@ class TranslateBehavior extends ModelBehavior {
|
|||
* Prepares the data to be saved for translated records.
|
||||
* Add blank fields, and populates data for multi-locale saves.
|
||||
*
|
||||
* @param Model $Model Model instance
|
||||
* @param array $data The sparse data that was provided.
|
||||
* @return array The fully populated data to save.
|
||||
*/
|
||||
|
@ -625,6 +625,7 @@ class TranslateBehavior extends ModelBehavior {
|
|||
/**
|
||||
* Update runtime setting for a given field.
|
||||
*
|
||||
* @param Model $Model Model instance
|
||||
* @param string $field The field to update.
|
||||
*/
|
||||
protected function _removeField(Model $Model, $field) {
|
||||
|
|
|
@ -64,7 +64,7 @@ class DboSource extends DataSource {
|
|||
* Whether or not to cache the results of DboSource::name() and DboSource::conditions()
|
||||
* into the memory cache. Set to false to disable the use of the memory cache.
|
||||
*
|
||||
* @var boolean.
|
||||
* @var boolean
|
||||
*/
|
||||
public $cacheMethods = true;
|
||||
|
||||
|
@ -2937,7 +2937,7 @@ class DboSource extends DataSource {
|
|||
*
|
||||
* @param string $table The name of the table to update.
|
||||
* @param string $column The column to use when reseting the sequence value.
|
||||
* @return boolean success.
|
||||
* @return boolean|void success.
|
||||
*/
|
||||
public function resetSequence($table, $column) {
|
||||
}
|
||||
|
|
|
@ -2144,8 +2144,7 @@ class Model extends Object implements CakeEventListener {
|
|||
*
|
||||
* @param array $data Record data to validate. This should be a numerically-indexed array
|
||||
* @param array $options Options to use when validating record data (see above), See also $options of validates().
|
||||
* @return boolean True on success, or false on failure.
|
||||
* @return mixed If atomic: True on success, or false on failure.
|
||||
* @return boolean|array If atomic: True on success, or false on failure.
|
||||
* Otherwise: array similar to the $data array passed, but values are set to true/false
|
||||
* depending on whether each record validated successfully.
|
||||
*/
|
||||
|
@ -3427,6 +3426,8 @@ class Model extends Object implements CakeEventListener {
|
|||
/**
|
||||
* Retunrs an instance of a model validator for this class
|
||||
*
|
||||
* @param ModelValidator Model validator instance.
|
||||
* If null a new ModelValidator instance will be made using current model object
|
||||
* @return ModelValidator
|
||||
*/
|
||||
public function validator($instance = null) {
|
||||
|
|
|
@ -203,7 +203,6 @@ class ModelValidator implements ArrayAccess, IteratorAggregate, Countable {
|
|||
*
|
||||
* @param array $data Record data to validate. This should be a numerically-indexed array
|
||||
* @param array $options Options to use when validating record data (see above), See also $options of validates().
|
||||
* @return boolean True on success, or false on failure.
|
||||
* @return mixed If atomic: True on success, or false on failure.
|
||||
* Otherwise: array similar to the $data array passed, but values are set to true/false
|
||||
* depending on whether each record validated successfully.
|
||||
|
|
|
@ -158,7 +158,8 @@ class CakeValidationRule {
|
|||
/**
|
||||
* Checks whether the field failed the `field should be present` validation
|
||||
*
|
||||
* @param array $data data to check rule against
|
||||
* @param string $field Field name
|
||||
* @param array $data Data to check rule against
|
||||
* @return boolean
|
||||
*/
|
||||
public function checkRequired($field, &$data) {
|
||||
|
@ -174,6 +175,7 @@ class CakeValidationRule {
|
|||
/**
|
||||
* Checks if the allowEmpty key applies
|
||||
*
|
||||
* @param string $field Field name
|
||||
* @param array $data data to check rule against
|
||||
* @return boolean
|
||||
*/
|
||||
|
@ -245,8 +247,9 @@ class CakeValidationRule {
|
|||
* If called with no parameters it will return whether this rule
|
||||
* is configured for update operations or not.
|
||||
*
|
||||
* @param boolean $exists Boolean to indicate if records exists
|
||||
* @return boolean
|
||||
**/
|
||||
*/
|
||||
public function isUpdate($exists = null) {
|
||||
if ($exists === null) {
|
||||
return $this->_recordExists;
|
||||
|
@ -257,6 +260,9 @@ class CakeValidationRule {
|
|||
/**
|
||||
* Dispatches the validation rule to the given validator method
|
||||
*
|
||||
* @param string $field Field name
|
||||
* @param array $data Data array
|
||||
* @param array $methods Methods list
|
||||
* @return boolean True if the rule could be dispatched, false otherwise
|
||||
*/
|
||||
public function process($field, &$data, &$methods) {
|
||||
|
@ -286,7 +292,7 @@ class CakeValidationRule {
|
|||
* and it will set isUpdate() to false
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
public function reset() {
|
||||
$this->_valid = true;
|
||||
$this->_recordExists = false;
|
||||
|
@ -295,8 +301,9 @@ class CakeValidationRule {
|
|||
/**
|
||||
* Returns passed options for this rule
|
||||
*
|
||||
* @param string|integer $key Array index
|
||||
* @return array
|
||||
**/
|
||||
*/
|
||||
public function getOptions($key) {
|
||||
if (!isset($this->_passedOptions[$key])) {
|
||||
return null;
|
||||
|
@ -328,6 +335,8 @@ class CakeValidationRule {
|
|||
/**
|
||||
* Parses the rule and sets the rule and ruleParams
|
||||
*
|
||||
* @param string $field Field name
|
||||
* @param array $data Data array
|
||||
* @return void
|
||||
*/
|
||||
protected function _parseRule($field, &$data) {
|
||||
|
|
|
@ -94,6 +94,7 @@ class CakeValidationSet implements ArrayAccess, IteratorAggregate, Countable {
|
|||
/**
|
||||
* Sets the list of methods to use for validation
|
||||
*
|
||||
* @param array $methods Methods list
|
||||
* @return void
|
||||
**/
|
||||
public function setMethods(&$methods) {
|
||||
|
@ -114,6 +115,8 @@ class CakeValidationSet implements ArrayAccess, IteratorAggregate, Countable {
|
|||
* Runs all validation rules in this set and returns a list of
|
||||
* validation errors
|
||||
*
|
||||
* @param array $data Data array
|
||||
* @param boolean $isUpdate Is record being updated or created
|
||||
* @return array list of validation errors for this field
|
||||
*/
|
||||
public function validate($data, $isUpdate = false) {
|
||||
|
|
|
@ -764,6 +764,7 @@ class CakeRequest implements ArrayAccess {
|
|||
* Provides a read accessor for `$this->query`. Allows you
|
||||
* to use a syntax similar to `CakeSession` for reading url query data.
|
||||
*
|
||||
* @param string $name Query string variable name
|
||||
* @return mixed The value being read
|
||||
*/
|
||||
public function query($name) {
|
||||
|
|
|
@ -1057,7 +1057,8 @@ class CakeResponse {
|
|||
* Sets the protocol to be used when sending the response. Defaults to HTTP/1.1
|
||||
* If called with no arguments, it will return the current configured protocol
|
||||
*
|
||||
* @return string protocol to be used for sending response
|
||||
* @param string protocol to be used for sending response
|
||||
* @return string protocol currently set
|
||||
*/
|
||||
public function protocol($protocol = null) {
|
||||
if ($protocol !== null) {
|
||||
|
@ -1070,7 +1071,8 @@ class CakeResponse {
|
|||
* Sets the Content-Length header for the response
|
||||
* If called with no arguments returns the last Content-Length set
|
||||
*
|
||||
* @return int
|
||||
* @param integer $bytes Number of bytes
|
||||
* @return integer|null
|
||||
*/
|
||||
public function length($bytes = null) {
|
||||
if ($bytes !== null) {
|
||||
|
@ -1092,6 +1094,7 @@ class CakeResponse {
|
|||
* the Last-Modified etag response header before calling this method. Otherwise
|
||||
* a comparison will not be possible.
|
||||
*
|
||||
* @param CakeRequest $request Request object
|
||||
* @return boolean whether the response was marked as not modified or not.
|
||||
*/
|
||||
public function checkNotModified(CakeRequest $request) {
|
||||
|
@ -1136,7 +1139,7 @@ class CakeResponse {
|
|||
* If the method is called with an array as argument, it will set the cookie
|
||||
* configuration to the cookie container.
|
||||
*
|
||||
* @param $options Either null to get all cookies, string for a specific cookie
|
||||
* @param array $options Either null to get all cookies, string for a specific cookie
|
||||
* or array to set cookie.
|
||||
*
|
||||
* ### Options (when setting a configuration)
|
||||
|
|
|
@ -34,7 +34,7 @@ abstract class AbstractTransport {
|
|||
/**
|
||||
* Send mail
|
||||
*
|
||||
* @params CakeEmail $email
|
||||
* @param CakeEmail $email
|
||||
* @return array
|
||||
*/
|
||||
abstract public function send(CakeEmail $email);
|
||||
|
|
|
@ -33,6 +33,7 @@ App::import('I18n', 'Multibyte');
|
|||
* @package Cake.Network.Email
|
||||
*/
|
||||
class CakeEmail {
|
||||
|
||||
/**
|
||||
* Default X-Mailer
|
||||
*
|
||||
|
@ -85,7 +86,7 @@ class CakeEmail {
|
|||
/**
|
||||
* The sender email
|
||||
*
|
||||
* @var array();
|
||||
* @var array
|
||||
*/
|
||||
protected $_sender = array();
|
||||
|
||||
|
@ -1109,7 +1110,6 @@ class CakeEmail {
|
|||
/**
|
||||
* Apply the config to an instance
|
||||
*
|
||||
* @param CakeEmail $obj CakeEmail
|
||||
* @param array $config
|
||||
* @return void
|
||||
* @throws ConfigureException When configuration file cannot be found, or is missing
|
||||
|
|
|
@ -184,7 +184,7 @@ class Router {
|
|||
/**
|
||||
* Validates that the passed route class exists and is a subclass of CakeRoute
|
||||
*
|
||||
* @param $routeClass
|
||||
* @param string $routeClass Route class name
|
||||
* @return string
|
||||
* @throws RouterException
|
||||
*/
|
||||
|
|
|
@ -170,7 +170,6 @@ abstract class CakeTestCase extends PHPUnit_Framework_TestCase {
|
|||
/**
|
||||
* Announces the start of a test.
|
||||
*
|
||||
* @param string $method Test method just started.
|
||||
* @return void
|
||||
*/
|
||||
protected function assertPreConditions() {
|
||||
|
@ -181,7 +180,6 @@ abstract class CakeTestCase extends PHPUnit_Framework_TestCase {
|
|||
/**
|
||||
* Announces the end of a test.
|
||||
*
|
||||
* @param string $method Test method just finished.
|
||||
* @return void
|
||||
*/
|
||||
protected function assertPostConditions() {
|
||||
|
@ -496,6 +494,7 @@ abstract class CakeTestCase extends PHPUnit_Framework_TestCase {
|
|||
* Generates all permutation of an array $items and returns them in a new array.
|
||||
*
|
||||
* @param array $items An array of items
|
||||
* @param array $perms
|
||||
* @return array
|
||||
*/
|
||||
protected function _arrayPermute($items, $perms = array()) {
|
||||
|
@ -594,6 +593,9 @@ abstract class CakeTestCase extends PHPUnit_Framework_TestCase {
|
|||
return self::assertNotRegExp($pattern, $string, $message);
|
||||
}
|
||||
|
||||
/**
|
||||
* assert no errors
|
||||
*/
|
||||
protected function assertNoErrors() {
|
||||
}
|
||||
|
||||
|
@ -681,6 +683,7 @@ abstract class CakeTestCase extends PHPUnit_Framework_TestCase {
|
|||
*
|
||||
* @param string $model
|
||||
* @param mixed $methods
|
||||
* @param mixed $config
|
||||
* @return Model
|
||||
*/
|
||||
public function getMockForModel($model, $methods = array(), $config = null) {
|
||||
|
|
|
@ -43,6 +43,8 @@ class CakeTestLoader extends PHPUnit_Runner_StandardTestSuiteLoader {
|
|||
/**
|
||||
* Convert path fragments used by Cake's test runner to absolute paths that can be fed to PHPUnit.
|
||||
*
|
||||
* @param string $filePath
|
||||
* @param string $params
|
||||
* @return void
|
||||
*/
|
||||
protected function _resolveTestFile($filePath, $params) {
|
||||
|
@ -80,7 +82,8 @@ class CakeTestLoader extends PHPUnit_Runner_StandardTestSuiteLoader {
|
|||
/**
|
||||
* Get the list of files for the test listing.
|
||||
*
|
||||
* @return void
|
||||
* @param string $params
|
||||
* @return array
|
||||
*/
|
||||
public static function generateTestList($params) {
|
||||
$directory = self::_basePath($params);
|
||||
|
@ -101,7 +104,7 @@ class CakeTestLoader extends PHPUnit_Runner_StandardTestSuiteLoader {
|
|||
* a given fileTestFunction, like isTestCaseFile()
|
||||
*
|
||||
* @param string $directory The directory to scan for files.
|
||||
* @param mixed $fileTestFunction
|
||||
* @return array
|
||||
*/
|
||||
protected static function _getRecursiveFileList($directory = '.') {
|
||||
$fileList = array();
|
||||
|
|
|
@ -29,6 +29,8 @@ class CakeTestRunner extends PHPUnit_TextUI_TestRunner {
|
|||
/**
|
||||
* Lets us pass in some options needed for cake's webrunner.
|
||||
*
|
||||
* @param mixed $loader
|
||||
* @param array $params list of options to be used for this run
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($loader, $params) {
|
||||
|
@ -84,7 +86,8 @@ class CakeTestRunner extends PHPUnit_TextUI_TestRunner {
|
|||
/**
|
||||
* Get the fixture manager class specified or use the default one.
|
||||
*
|
||||
* @return instance of a fixture manager.
|
||||
* @param array $arguments
|
||||
* @return mixed instance of a fixture manager.
|
||||
* @throws RuntimeException When fixture manager class cannot be loaded.
|
||||
*/
|
||||
protected function _getFixtureManager($arguments) {
|
||||
|
|
|
@ -36,6 +36,7 @@ class CakeTestSuiteCommand extends PHPUnit_TextUI_Command {
|
|||
/**
|
||||
* Construct method
|
||||
*
|
||||
* @param mixed $loader
|
||||
* @param array $params list of options to be used for this run
|
||||
* @throws MissingTestLoaderException When a loader class could not be found.
|
||||
*/
|
||||
|
@ -129,7 +130,7 @@ class CakeTestSuiteCommand extends PHPUnit_TextUI_Command {
|
|||
/**
|
||||
* Create a runner for the command.
|
||||
*
|
||||
* @param $loader The loader to be used for the test run.
|
||||
* @param mixed $loader The loader to be used for the test run.
|
||||
* @return CakeTestRunner
|
||||
*/
|
||||
public function getRunner($loader) {
|
||||
|
@ -149,6 +150,7 @@ class CakeTestSuiteCommand extends PHPUnit_TextUI_Command {
|
|||
/**
|
||||
* Handles output flag used to change printing on webrunner.
|
||||
*
|
||||
* @param string $reporter
|
||||
* @return void
|
||||
*/
|
||||
public function handleReporter($reporter) {
|
||||
|
|
|
@ -210,6 +210,7 @@ abstract class ControllerTestCase extends CakeTestCase {
|
|||
*
|
||||
* @param string $url The url to test
|
||||
* @param array $options See options
|
||||
* @return mixed
|
||||
*/
|
||||
protected function _testAction($url = '', $options = array()) {
|
||||
$this->vars = $this->result = $this->view = $this->contents = $this->headers = null;
|
||||
|
|
|
@ -136,7 +136,7 @@ abstract class BaseCoverageReport {
|
|||
*
|
||||
* @param array $fileLines
|
||||
* @param array $coverageData
|
||||
* @return array. Array of covered, total lines.
|
||||
* @return array Array of covered, total lines.
|
||||
*/
|
||||
protected function _calculateCoveredLines($fileLines, $coverageData) {
|
||||
$covered = $total = 0;
|
||||
|
|
|
@ -122,6 +122,10 @@ HTML;
|
|||
/**
|
||||
* Renders the html for a single line in the html diff.
|
||||
*
|
||||
* @param string $line
|
||||
* @param integer $linenumber
|
||||
* @param string $class
|
||||
* @param array $coveringTests
|
||||
* @return void
|
||||
*/
|
||||
protected function _paintLine($line, $linenumber, $class, $coveringTests) {
|
||||
|
@ -170,6 +174,8 @@ HTML;
|
|||
/**
|
||||
* Generate an HTML snippet for coverage headers
|
||||
*
|
||||
* @param string $filename
|
||||
* @param string $percent
|
||||
* @return void
|
||||
*/
|
||||
public function coverageHeader($filename, $percent) {
|
||||
|
|
|
@ -24,6 +24,11 @@ require_once 'PHPUnit/TextUI/ResultPrinter.php';
|
|||
*/
|
||||
class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
|
||||
|
||||
/**
|
||||
* Headers sent
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
protected $_headerSent = false;
|
||||
|
||||
/**
|
||||
|
@ -113,10 +118,20 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
|
|||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Print result
|
||||
*
|
||||
* @param PHPUnit_Framework_TestResult $result
|
||||
*/
|
||||
public function printResult(PHPUnit_Framework_TestResult $result) {
|
||||
$this->paintFooter($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Paint result
|
||||
*
|
||||
* @param PHPUnit_Framework_TestResult $result
|
||||
*/
|
||||
public function paintResult(PHPUnit_Framework_TestResult $result) {
|
||||
$this->paintFooter($result);
|
||||
}
|
||||
|
|
|
@ -169,6 +169,7 @@ class CakeHtmlReporter extends CakeBaseReporter {
|
|||
/**
|
||||
* Paints a code coverage report.
|
||||
*
|
||||
* @param array $coverage
|
||||
* @return void
|
||||
*/
|
||||
public function paintCoverage(array $coverage) {
|
||||
|
@ -242,6 +243,7 @@ class CakeHtmlReporter extends CakeBaseReporter {
|
|||
*
|
||||
* @param PHPUnit_Framework_AssertionFailedError $message Failure object displayed in
|
||||
* the context of the other tests.
|
||||
* @param mixed $test
|
||||
* @return void
|
||||
*/
|
||||
public function paintFail($message, $test) {
|
||||
|
@ -294,6 +296,7 @@ class CakeHtmlReporter extends CakeBaseReporter {
|
|||
* Paints a PHP exception.
|
||||
*
|
||||
* @param Exception $exception Exception to display.
|
||||
* @param mixed $test
|
||||
* @return void
|
||||
*/
|
||||
public function paintException($message, $test) {
|
||||
|
|
|
@ -48,7 +48,7 @@ class CakeTextReporter extends CakeBaseReporter {
|
|||
/**
|
||||
* Paints a failing test.
|
||||
*
|
||||
* @param $message PHPUnit_Framework_AssertionFailedError $message Failure object displayed in
|
||||
* @param PHPUnit_Framework_AssertionFailedError $message Failure object displayed in
|
||||
* the context of the other tests.
|
||||
* @return void
|
||||
*/
|
||||
|
@ -95,7 +95,6 @@ class CakeTextReporter extends CakeBaseReporter {
|
|||
/**
|
||||
* Paints the title only.
|
||||
*
|
||||
* @param string $test_name Name class of test.
|
||||
* @return void
|
||||
*/
|
||||
public function paintHeader() {
|
||||
|
@ -177,7 +176,7 @@ class CakeTextReporter extends CakeBaseReporter {
|
|||
* Generates a Text summary of the coverage data.
|
||||
*
|
||||
* @param array $coverage Array of coverage data.
|
||||
* @return string
|
||||
* @return void
|
||||
*/
|
||||
public function paintCoverage($coverage) {
|
||||
$reporter = new TextCoverageReport($coverage, $this);
|
||||
|
|
|
@ -85,13 +85,17 @@ class CakeTime {
|
|||
|
||||
/**
|
||||
* Temporary variable containing timestamp value, used internally convertSpecifiers()
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
protected static $_time = null;
|
||||
|
||||
/**
|
||||
* Magic set method for backward compatibility.
|
||||
*
|
||||
* Used by TimeHelper to modify static variables in CakeTime
|
||||
*
|
||||
* @param string $name Variable name
|
||||
* @param mixes $value Variable value
|
||||
*/
|
||||
public function __set($name, $value) {
|
||||
switch ($name) {
|
||||
|
@ -105,8 +109,10 @@ class CakeTime {
|
|||
|
||||
/**
|
||||
* Magic set method for backward compatibility.
|
||||
*
|
||||
* Used by TimeHelper to get static variables in CakeTime
|
||||
*
|
||||
* @param string $name Variable name
|
||||
* @return mixed
|
||||
*/
|
||||
public function __get($name) {
|
||||
switch ($name) {
|
||||
|
|
|
@ -687,6 +687,7 @@ class Hash {
|
|||
*
|
||||
* @param array $data The data to reduce.
|
||||
* @param string $path The path to extract from $data.
|
||||
* @param callable $function The function to call on each extracted value.
|
||||
* @return mixed The reduced value.
|
||||
*/
|
||||
public static function reduce(array $data, $path, $function) {
|
||||
|
@ -700,6 +701,7 @@ class Hash {
|
|||
*
|
||||
* @param array $data The data to reduce.
|
||||
* @param string $path The path to extract from $data.
|
||||
* @param callable $function The function to call on each extracted value.
|
||||
* @return mixed The results of the applied method.
|
||||
*/
|
||||
public static function apply(array $data, $path, $function) {
|
||||
|
|
|
@ -925,7 +925,7 @@ class Validation {
|
|||
* Checking for upload errors
|
||||
*
|
||||
* @param string|array $check
|
||||
* @retrun boolean
|
||||
* @return boolean
|
||||
* @see http://www.php.net/manual/en/features.file-upload.errors.php
|
||||
*/
|
||||
public static function uploadError($check) {
|
||||
|
|
|
@ -118,7 +118,7 @@ class Xml {
|
|||
*
|
||||
* @param string $input The input to load.
|
||||
* @param array $options The options to use. See Xml::build()
|
||||
* @return SimpleXmlElement|DOMDocument.
|
||||
* @return SimpleXmlElement|DOMDocument
|
||||
*/
|
||||
protected static function _loadXml($input, $options) {
|
||||
$hasDisable = function_exists('libxml_disable_entity_loader');
|
||||
|
|
|
@ -732,7 +732,7 @@ class HtmlHelper extends AppHelper {
|
|||
/**
|
||||
* Prepends startText to crumbs array if set
|
||||
*
|
||||
* @param $startText
|
||||
* @param string $startText Text to prepend
|
||||
* @return array Crumb list including startText (if provided)
|
||||
*/
|
||||
protected function _prepareCrumbs($startText) {
|
||||
|
|
|
@ -69,8 +69,7 @@ abstract class JsBaseEngineHelper extends AppHelper {
|
|||
* Redirects to a URL. Creates a window.location modification snippet
|
||||
* that can be used to trigger 'redirects' from Javascript.
|
||||
*
|
||||
* @param string|array $url
|
||||
* @param array $options
|
||||
* @param string|array $url URL
|
||||
* @return string completed redirect in javascript
|
||||
*/
|
||||
public function redirect($url = null) {
|
||||
|
|
|
@ -259,9 +259,9 @@ class JsHelper extends AppHelper {
|
|||
}
|
||||
|
||||
/**
|
||||
* Generates the object string for variables passed to javascript.
|
||||
* Generates the object string for variables passed to javascript and adds to buffer
|
||||
*
|
||||
* @return string Generated JSON object of all set vars
|
||||
* @return void
|
||||
*/
|
||||
protected function _createVars() {
|
||||
if (!empty($this->_jsVars)) {
|
||||
|
|
|
@ -73,7 +73,7 @@ class NumberHelper extends AppHelper {
|
|||
}
|
||||
|
||||
/**
|
||||
* @see: CakeNumber::precision()
|
||||
* @see CakeNumber::precision()
|
||||
*
|
||||
* @param float $number A floating point number.
|
||||
* @param integer $precision The precision of the returned number.
|
||||
|
@ -85,7 +85,7 @@ class NumberHelper extends AppHelper {
|
|||
}
|
||||
|
||||
/**
|
||||
* @see: CakeNumber::toReadableSize()
|
||||
* @see CakeNumber::toReadableSize()
|
||||
*
|
||||
* @param integer $size Size in bytes
|
||||
* @return string Human readable size
|
||||
|
@ -96,7 +96,7 @@ class NumberHelper extends AppHelper {
|
|||
}
|
||||
|
||||
/**
|
||||
* @see: CakeNumber::toPercentage()
|
||||
* @see CakeNumber::toPercentage()
|
||||
*
|
||||
* @param float $number A floating point number
|
||||
* @param integer $precision The precision of the returned number
|
||||
|
@ -108,7 +108,7 @@ class NumberHelper extends AppHelper {
|
|||
}
|
||||
|
||||
/**
|
||||
* @see: CakeNumber::format()
|
||||
* @see CakeNumber::format()
|
||||
*
|
||||
* @param float $number A floating point number
|
||||
* @param integer $options if int then places, if string then before, if (,.-) then use it
|
||||
|
@ -121,7 +121,7 @@ class NumberHelper extends AppHelper {
|
|||
}
|
||||
|
||||
/**
|
||||
* @see: CakeNumber::currency()
|
||||
* @see CakeNumber::currency()
|
||||
*
|
||||
* @param float $number
|
||||
* @param string $currency Shortcut to default options. Valid values are 'USD', 'EUR', 'GBP', otherwise
|
||||
|
@ -136,7 +136,7 @@ class NumberHelper extends AppHelper {
|
|||
}
|
||||
|
||||
/**
|
||||
* @see: CakeNumber::addFormat()
|
||||
* @see CakeNumber::addFormat()
|
||||
*
|
||||
* @param string $formatName The format name to be used in the future.
|
||||
* @param array $options The array of options for this format.
|
||||
|
@ -149,7 +149,7 @@ class NumberHelper extends AppHelper {
|
|||
}
|
||||
|
||||
/**
|
||||
* @see: CakeNumber::defaultCurrency()
|
||||
* @see CakeNumber::defaultCurrency()
|
||||
*
|
||||
* @param string $currency The currency to be used in the future.
|
||||
* @return void
|
||||
|
|
|
@ -51,6 +51,8 @@ class TextHelper extends AppHelper {
|
|||
|
||||
/**
|
||||
* String utility instance
|
||||
*
|
||||
* @var stdClass
|
||||
*/
|
||||
protected $_engine;
|
||||
|
||||
|
|
|
@ -34,6 +34,8 @@ class TimeHelper extends AppHelper {
|
|||
|
||||
/**
|
||||
* CakeTime instance
|
||||
*
|
||||
* @var stdClass
|
||||
*/
|
||||
protected $_engine = null;
|
||||
|
||||
|
@ -66,7 +68,7 @@ class TimeHelper extends AppHelper {
|
|||
*
|
||||
* @param string $name Name of the attribute to set.
|
||||
* @param string $value Value of the attribute to set.
|
||||
* @return mixed
|
||||
* @return void
|
||||
*/
|
||||
public function __set($name, $value) {
|
||||
switch ($name) {
|
||||
|
|
|
@ -222,6 +222,7 @@ class View extends Object {
|
|||
/**
|
||||
* Element cache settings
|
||||
*
|
||||
* @var array
|
||||
* @see View::_elementCache();
|
||||
* @see View::_renderElement
|
||||
*/
|
||||
|
@ -304,8 +305,19 @@ class View extends Object {
|
|||
*/
|
||||
protected $_eventManagerConfigured = false;
|
||||
|
||||
/**
|
||||
* Constant for view file type 'view'
|
||||
*/
|
||||
const TYPE_VIEW = 'view';
|
||||
|
||||
/**
|
||||
* Constant for view file type 'element'
|
||||
*/
|
||||
const TYPE_ELEMENT = 'element';
|
||||
|
||||
/**
|
||||
* Constant for view file type 'layout'
|
||||
*/
|
||||
const TYPE_LAYOUT = 'layout';
|
||||
|
||||
/**
|
||||
|
@ -647,7 +659,8 @@ class View extends Object {
|
|||
* empty or undefined '' will be returned.
|
||||
*
|
||||
* @param string $name Name of the block
|
||||
* @return string The block content or $default if the block does not exist.
|
||||
* @param string $default Default text
|
||||
* @return string $default The block content or $default if the block does not exist.
|
||||
* @see ViewBlock::get()
|
||||
*/
|
||||
public function fetch($name, $default = '') {
|
||||
|
@ -1119,8 +1132,9 @@ class View extends Object {
|
|||
* Checks if an element is cached and returns the cached data if present
|
||||
*
|
||||
* @param string $name Element name
|
||||
* @param string $plugin Plugin name
|
||||
* @param string $data Data
|
||||
* @param array $options Element options
|
||||
* @return string|null
|
||||
*/
|
||||
protected function _elementCache($name, $data, $options) {
|
||||
$plugin = null;
|
||||
|
@ -1153,6 +1167,7 @@ class View extends Object {
|
|||
* @param string $file Element file path
|
||||
* @param array $data Data to render
|
||||
* @param array $options Element options
|
||||
* @return string
|
||||
*/
|
||||
protected function _renderElement($file, $data, $options) {
|
||||
if (!$this->_helpersLoaded) {
|
||||
|
|
|
@ -157,6 +157,7 @@ class ViewBlock {
|
|||
* Get the content for a block.
|
||||
*
|
||||
* @param string $name Name of the block
|
||||
* @param string $default Default string
|
||||
* @return string The block content or $default if the block does not exist.
|
||||
*/
|
||||
public function get($name, $default = '') {
|
||||
|
|
Loading…
Add table
Reference in a new issue