Skip to content

Commit

Permalink
Fix up doblocks to be of more concrete type arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Oct 23, 2016
1 parent 752d0fe commit 7c23c08
Show file tree
Hide file tree
Showing 28 changed files with 63 additions and 46 deletions.
3 changes: 2 additions & 1 deletion src/Cache/Cache.php
Expand Up @@ -102,7 +102,8 @@ class Cache
/**
* Whether to reset the settings with the next call to Cache::set();
*
* @var array
* @deprecated Not used anymore
* @var bool
*/
protected static $_reset = false;

Expand Down
2 changes: 1 addition & 1 deletion src/Cache/Engine/ApcEngine.php
Expand Up @@ -27,7 +27,7 @@ class ApcEngine extends CacheEngine
* Contains the compiled group names
* (prefixed with the global configuration prefix)
*
* @var array
* @var string[]
*/
protected $_compiledGroupNames = [];

Expand Down
6 changes: 3 additions & 3 deletions src/Core/Configure.php
Expand Up @@ -45,15 +45,15 @@ class Configure
/**
* Configured engine classes, used to load config files from resources
*
* @var array
* @see \Cake\Core\Configure::load()
* @var \Cake\Core\Configure\ConfigEngineInterface[]
*/
protected static $_engines = [];

/**
* Flag to track whether or not ini_set exists.
*
* @return void
* @var bool|null
*/
protected static $_hasIniSet = null;

Expand Down Expand Up @@ -238,7 +238,7 @@ public static function config($name, ConfigEngineInterface $engine)
* Gets the names of the configured Engine objects.
*
* @param string|null $name Engine name.
* @return array Array of the configured Engine objects.
* @return array|bool Array of the configured Engine objects, bool for specific name.
*/
public static function configured($name = null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Exception/Exception.php
Expand Up @@ -38,7 +38,7 @@ class Exception extends RuntimeException
/**
* Array of headers to be passed to Cake\Network\Response::header()
*
* @var array
* @var array|null
*/
protected $_responseHeaders = null;

Expand Down
2 changes: 1 addition & 1 deletion src/Core/ObjectRegistry.php
Expand Up @@ -40,7 +40,7 @@ abstract class ObjectRegistry
/**
* Map of loaded objects.
*
* @var array
* @var object[]
*/
protected $_loaded = [];

Expand Down
2 changes: 1 addition & 1 deletion src/Database/Expression/Comparison.php
Expand Up @@ -64,7 +64,7 @@ class Comparison implements ExpressionInterface, FieldInterface
* A cached list of ExpressionInterface objects that were
* found in the value for this expression.
*
* @var array
* @var \Cake\Database\ExpressionInterface[]
*/
protected $_valueExpressions = [];

Expand Down
2 changes: 1 addition & 1 deletion src/Datasource/QueryTrait.php
Expand Up @@ -54,7 +54,7 @@ trait QueryTrait
* List of formatter classes or callbacks that will post-process the
* results when fetched
*
* @var array
* @var callable[]
*/
protected $_formatters = [];

Expand Down
8 changes: 4 additions & 4 deletions src/Datasource/RulesChecker.php
Expand Up @@ -63,28 +63,28 @@ class RulesChecker
/**
* The list of rules to be checked on both create and update operations
*
* @var array
* @var callable[]
*/
protected $_rules = [];

/**
* The list of rules to check during create operations
*
* @var array
* @var callable[]
*/
protected $_createRules = [];

/**
* The list of rules to check during update operations
*
* @var array
* @var callable[]
*/
protected $_updateRules = [];

/**
* The list of rules to check during delete operations
*
* @var array
* @var callable[]
*/
protected $_deleteRules = [];

Expand Down
2 changes: 1 addition & 1 deletion src/Event/EventList.php
Expand Up @@ -56,7 +56,7 @@ public function add(Event $event)
*
* @link http://php.net/manual/en/arrayaccess.offsetexists.php
* @param mixed $offset An offset to check for.
* @return boole True on success or false on failure.
* @return bool True on success or false on failure.
*/
public function offsetExists($offset)
{
Expand Down
6 changes: 3 additions & 3 deletions src/Http/ActionDispatcher.php
Expand Up @@ -37,7 +37,7 @@ class ActionDispatcher
/**
* Attached routing filters
*
* @var array
* @var \Cake\Event\EventListenerInterface[]
*/
protected $filters = [];

Expand All @@ -53,7 +53,7 @@ class ActionDispatcher
*
* @param \Cake\Http\ControllerFactory|null $factory A controller factory instance.
* @param \Cake\Event\EventManager|null $eventManager An event manager if you want to inject one.
* @param array $filters The list of filters to include.
* @param \Cake\Event\EventListenerInterface[] $filters The list of filters to include.
*/
public function __construct($factory = null, $eventManager = null, array $filters = [])
{
Expand All @@ -71,7 +71,7 @@ public function __construct($factory = null, $eventManager = null, array $filter
*
* @param \Cake\Network\Request $request The request to dispatch.
* @param \Cake\Network\Response $response The response to dispatch.
* @return \Cake\Network\Response a modified/replaced response.
* @return \Cake\Network\Response A modified/replaced response.
*/
public function dispatch(Request $request, Response $response)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Client/FormData.php
Expand Up @@ -50,7 +50,7 @@ class FormData implements Countable
/**
* The parts in the form data.
*
* @var array
* @var \Cake\Http\Client\FormDataPart[]
*/
protected $_parts = [];

Expand Down
4 changes: 2 additions & 2 deletions src/Http/Client/Response.php
Expand Up @@ -505,7 +505,7 @@ public function body($parser = null)
*/
protected function _getJson()
{
if (!empty($this->_json)) {
if ($this->_json) {
return $this->_json;
}

Expand All @@ -519,7 +519,7 @@ protected function _getJson()
*/
protected function _getXml()
{
if (!empty($this->_xml)) {
if ($this->_xml) {
return $this->_xml;
}
libxml_use_internal_errors();
Expand Down
2 changes: 1 addition & 1 deletion src/Http/MiddlewareQueue.php
Expand Up @@ -35,7 +35,7 @@ class MiddlewareQueue implements Countable
/**
* The queue of middleware callables.
*
* @var array
* @var callable[]
*/
protected $callables = [];

Expand Down
4 changes: 2 additions & 2 deletions src/I18n/ChainMessagesLoader.php
Expand Up @@ -27,15 +27,15 @@ class ChainMessagesLoader
/**
* The list of callables to execute one after another for loading messages
*
* @var array
* @var callable[]
*/
protected $_loaders = [];

/**
* Receives a list of callable functions or objects that will be executed
* one after another until one of them returns a non-empty translations package
*
* @param array $loaders List of callables to execute
* @param callable[] $loaders List of callables to execute
*/
public function __construct(array $loaders)
{
Expand Down
4 changes: 2 additions & 2 deletions src/I18n/TranslatorRegistry.php
Expand Up @@ -34,9 +34,9 @@ class TranslatorRegistry extends TranslatorLocator
* packages where none can be found for the combination of translator
* name and locale.
*
* @var array
* @var callable[]
*/
protected $_loaders;
protected $_loaders = [];

/**
* Fallback loader name
Expand Down
2 changes: 1 addition & 1 deletion src/Log/Engine/SyslogLog.php
Expand Up @@ -60,7 +60,7 @@ class SyslogLog extends BaseLog
/**
* Used to map the string names back to their LOG_* constants
*
* @var array
* @var int[]
*/
protected $_levelMap = [
'emergency' => LOG_EMERG,
Expand Down
10 changes: 7 additions & 3 deletions src/ORM/Association.php
Expand Up @@ -187,7 +187,11 @@ abstract class Association
*
* @var array
*/
protected $_validStrategies = [self::STRATEGY_JOIN, self::STRATEGY_SELECT, self::STRATEGY_SUBQUERY];
protected $_validStrategies = [
self::STRATEGY_JOIN,
self::STRATEGY_SELECT,
self::STRATEGY_SUBQUERY
];

/**
* Constructor. Subclasses can override _options function to get the original
Expand Down Expand Up @@ -702,7 +706,7 @@ public function find($type = null, array $options = [])
*/
public function exists($conditions)
{
if (!empty($this->_conditions)) {
if ($this->_conditions) {
$conditions = $this
->find('all', ['conditions' => $conditions])
->clause('where');
Expand Down Expand Up @@ -805,7 +809,7 @@ protected function _appendFields($query, $surrogate, $options)
$fields = array_merge((array)$fields, $target->schema()->columns());
}

if (!empty($fields)) {
if ($fields) {
$query->select($query->aliasFields($fields, $target->alias()));
}
$query->addDefaultTypes($target);
Expand Down
5 changes: 4 additions & 1 deletion src/ORM/Association/BelongsTo.php
Expand Up @@ -36,7 +36,10 @@ class BelongsTo extends Association
*
* @var array
*/
protected $_validStrategies = [self::STRATEGY_JOIN, self::STRATEGY_SELECT];
protected $_validStrategies = [
self::STRATEGY_JOIN,
self::STRATEGY_SELECT
];

/**
* Sets the name of the field representing the foreign key to the target table.
Expand Down
5 changes: 4 additions & 1 deletion src/ORM/Association/BelongsToMany.php
Expand Up @@ -120,7 +120,10 @@ class BelongsToMany extends Association
*
* @var array
*/
protected $_validStrategies = [self::STRATEGY_SELECT, self::STRATEGY_SUBQUERY];
protected $_validStrategies = [
self::STRATEGY_SELECT,
self::STRATEGY_SUBQUERY
];

/**
* Whether the records on the joint table should be removed when a record
Expand Down
5 changes: 4 additions & 1 deletion src/ORM/Association/HasMany.php
Expand Up @@ -62,7 +62,10 @@ class HasMany extends Association
*
* @var array
*/
protected $_validStrategies = [self::STRATEGY_SELECT, self::STRATEGY_SUBQUERY];
protected $_validStrategies = [
self::STRATEGY_SELECT,
self::STRATEGY_SUBQUERY
];

/**
* Saving strategy that will only append to the links set
Expand Down
5 changes: 4 additions & 1 deletion src/ORM/Association/HasOne.php
Expand Up @@ -36,7 +36,10 @@ class HasOne extends Association
*
* @var array
*/
protected $_validStrategies = [self::STRATEGY_JOIN, self::STRATEGY_SELECT];
protected $_validStrategies = [
self::STRATEGY_JOIN,
self::STRATEGY_SELECT
];

/**
* Sets the name of the field representing the foreign key to the target table.
Expand Down
6 changes: 3 additions & 3 deletions src/ORM/Locator/TableLocator.php
Expand Up @@ -36,15 +36,15 @@ class TableLocator implements LocatorInterface
/**
* Instances that belong to the registry.
*
* @var array
* @var \Cake\ORM\Table[]
*/
protected $_instances = [];

/**
* Contains a list of Table objects that were created out of the
* built-in Table class. The list is indexed by table alias
*
* @var array
* @var \Cake\ORM\Table[]
*/
protected $_fallbacked = [];

Expand Down Expand Up @@ -244,7 +244,7 @@ public function clear()
* debugging common mistakes when setting up associations or created new table
* classes.
*
* @return array
* @return \Cake\ORM\Table[]
*/
public function genericInstances()
{
Expand Down
4 changes: 2 additions & 2 deletions src/Routing/Dispatcher.php
Expand Up @@ -33,7 +33,7 @@ class Dispatcher
/**
* Connected filter objects
*
* @var array
* @var \Cake\Event\EventListenerInterface[]
*/
protected $_filters = [];

Expand Down Expand Up @@ -83,7 +83,7 @@ public function addFilter(EventListenerInterface $filter)
/**
* Get the list of connected filters.
*
* @return array
* @return \Cake\Event\EventListenerInterface[]
*/
public function filters()
{
Expand Down
4 changes: 2 additions & 2 deletions src/Routing/DispatcherFactory.php
Expand Up @@ -27,7 +27,7 @@ class DispatcherFactory
/**
* Stack of middleware to apply to dispatchers.
*
* @var array
* @var \Cake\Routing\DispatcherFilter[]
*/
protected static $_stack = [];

Expand Down Expand Up @@ -91,7 +91,7 @@ public static function create()
/**
* Get the connected dispatcher filters.
*
* @return array
* @return \Cake\Routing\DispatcherFilter[]
*/
public static function filters()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Routing/Router.php
Expand Up @@ -148,7 +148,7 @@ class Router
* The stack of URL filters to apply against routing URLs before passing the
* parameters to the route collection.
*
* @var array
* @var callable[]
*/
protected static $_urlFilters = [];

Expand Down
4 changes: 2 additions & 2 deletions src/Shell/Task/ExtractTask.php
Expand Up @@ -51,7 +51,7 @@ class ExtractTask extends Shell
/**
* Current file being processed
*
* @var string
* @var string|null
*/
protected $_file = null;

Expand Down Expand Up @@ -79,7 +79,7 @@ class ExtractTask extends Shell
/**
* Destination path
*
* @var string
* @var string|null
*/
protected $_output = null;

Expand Down

0 comments on commit 7c23c08

Please sign in to comment.