Skip to content

Commit

Permalink
Fix some more doc blocks and smells. Enable further clickability in IDE.
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Dec 22, 2016
1 parent 40fb946 commit 2312ab8
Show file tree
Hide file tree
Showing 86 changed files with 176 additions and 159 deletions.
2 changes: 1 addition & 1 deletion src/Auth/DigestAuthenticate.php
Expand Up @@ -132,7 +132,7 @@ public function getUser(ServerRequest $request)
* Gets the digest headers from the request/environment.
*
* @param \Cake\Http\ServerRequest $request Request object.
* @return array Array of digest information.
* @return array|bool Array of digest information.
*/
protected function _getDigest(ServerRequest $request)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Auth/Storage/MemoryStorage.php
Expand Up @@ -30,7 +30,7 @@ class MemoryStorage implements StorageInterface
/**
* Redirect url.
*
* @var string
* @var string|null
*/
protected $_redirectUrl;

Expand Down
2 changes: 1 addition & 1 deletion src/Cache/Cache.php
Expand Up @@ -102,7 +102,7 @@ class Cache
/**
* Cache Registry used for creating and using cache adapters.
*
* @var \Cake\Cache\CacheRegistry
* @var \Cake\Core\ObjectRegistry
*/
protected static $_registry;

Expand Down
2 changes: 1 addition & 1 deletion src/Cache/Engine/FileEngine.php
Expand Up @@ -36,7 +36,7 @@ class FileEngine extends CacheEngine
/**
* Instance of SplFileObject class
*
* @var \SplFileObject
* @var \SplFileObject|null
*/
protected $_File = null;

Expand Down
2 changes: 1 addition & 1 deletion src/Cache/Engine/WincacheEngine.php
Expand Up @@ -204,7 +204,7 @@ public function groups()
*/
public function clearGroup($group)
{
$success = null;
$success = false;
wincache_ucache_inc($this->_config['prefix'] . $group, 1, $success);

return $success;
Expand Down
4 changes: 2 additions & 2 deletions src/Collection/Iterator/MapReduce.php
Expand Up @@ -52,7 +52,7 @@ class MapReduce implements IteratorAggregate
/**
* Holds the original data that needs to be processed
*
* @var \Traversable
* @var \Traversable|null
*/
protected $_data;

Expand All @@ -74,7 +74,7 @@ class MapReduce implements IteratorAggregate
/**
* Count of elements emitted during the Reduce phase
*
* @var string
* @var int
*/
protected $_counter = 0;

Expand Down
2 changes: 1 addition & 1 deletion src/Console/ConsoleInputSubcommand.php
Expand Up @@ -102,7 +102,7 @@ public function help($width = 0)
/**
* Get the usage value for this option
*
* @return mixed Either false or a ConsoleOptionParser
* @return \Cake\Console\ConsoleOptionParser|bool Either false or a ConsoleOptionParser
*/
public function parser()
{
Expand Down
4 changes: 2 additions & 2 deletions src/Console/ConsoleOptionParser.php
Expand Up @@ -100,7 +100,7 @@ class ConsoleOptionParser
/**
* Map of short -> long options, generated when using addOption()
*
* @var string
* @var array
*/
protected $_shortOptions = [];

Expand Down Expand Up @@ -501,7 +501,7 @@ public function addArgument($name, array $params = [])
if ($a->isEqualTo($arg)) {
return $this;
}
if ($options['required'] && !$a->isRequired()) {
if (!empty($options['required']) && !$a->isRequired()) {
throw new LogicException('A required argument cannot follow an optional one');
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Console/ConsoleOutput.php
Expand Up @@ -119,9 +119,9 @@ class ConsoleOutput
];

/**
* formatting options for colored output
* Formatting options for colored output.
*
* @var string
* @var array
*/
protected static $_options = [
'bold' => 1,
Expand Down
2 changes: 1 addition & 1 deletion src/Console/HelpFormatter.php
Expand Up @@ -210,6 +210,6 @@ public function xml($string = true)
$argument->xml($arguments);
}

return $string ? $xml->asXml() : $xml;
return $string ? $xml->asXML() : $xml;
}
}
2 changes: 1 addition & 1 deletion src/Console/Shell.php
Expand Up @@ -129,7 +129,7 @@ class Shell
/**
* Contains tasks to load and instantiate
*
* @var array
* @var array|bool
* @link http://book.cakephp.org/3.0/en/console-and-shells.html#Shell::$tasks
*/
public $tasks = [];
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/Component/AuthComponent.php
Expand Up @@ -192,7 +192,7 @@ class AuthComponent extends Component
/**
* Storage object.
*
* @var \Cake\Auth\Storage\StorageInterface
* @var \Cake\Auth\Storage\StorageInterface|null
*/
protected $_storage;

Expand Down
4 changes: 2 additions & 2 deletions src/Controller/Component/CookieComponent.php
Expand Up @@ -85,7 +85,7 @@ class CookieComponent extends Component
*
* Accessed in the controller using $this->Cookie->read('Name.key');
*
* @var string
* @var array
*/
protected $_values = [];

Expand All @@ -104,7 +104,7 @@ class CookieComponent extends Component
* A reference to the Controller's Cake\Network\Response object.
* Currently unused.
*
* @var \Cake\Network\Response
* @var \Cake\Network\Response|null
* @deprecated 3.4.0 Will be removed in 4.0.0
*/
protected $_response = null;
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/Component/SecurityComponent.php
Expand Up @@ -637,7 +637,7 @@ protected function _matchExistingFields($dataFields, &$expectedFields, $intKeyMe
*
* @param array $expectedFields Expected fields
* @param string $missingMessage Message template
* @return string Error message about expected fields
* @return string|null Error message about expected fields
*/
protected function _debugExpectedFields($expectedFields = [], $missingMessage = '')
{
Expand Down
8 changes: 4 additions & 4 deletions src/Database/Connection.php
Expand Up @@ -88,9 +88,9 @@ class Connection implements ConnectionInterface
/**
* The schema collection object
*
* @var \Cake\Database\Schema\Collection
* @var \Cake\Database\Schema\Collection|null
*/
protected $_schemaCollection;
protected $_schemaCollection = null;

/**
* Constructor.
Expand Down Expand Up @@ -612,7 +612,7 @@ public function rollbackSavepoint($name)
*/
public function disableForeignKeys()
{
$this->execute($this->_driver->disableForeignKeySql())->closeCursor();
$this->execute($this->_driver->disableForeignKeySQL())->closeCursor();
}

/**
Expand All @@ -622,7 +622,7 @@ public function disableForeignKeys()
*/
public function enableForeignKeys()
{
$this->execute($this->_driver->enableForeignKeySql())->closeCursor();
$this->execute($this->_driver->enableForeignKeySQL())->closeCursor();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Database/Dialect/SqlserverDialectTrait.php
Expand Up @@ -298,7 +298,7 @@ protected function _transformFunctionExpression(FunctionExpression $expression)
* Used by Cake\Schema package to reflect schema and
* generate schema.
*
* @return \Cake\Database\Schema\MysqlSchema
* @return \Cake\Database\Schema\SqlserverSchema
*/
public function schemaDialect()
{
Expand Down
4 changes: 2 additions & 2 deletions src/Database/Driver.php
Expand Up @@ -86,7 +86,7 @@ abstract public function disconnect();
* If first argument is passed,
*
* @param null|\PDO $connection The connection object
* @return void
* @return \Cake\Database\Connection
*/
abstract public function connection($connection = null);

Expand Down Expand Up @@ -258,7 +258,7 @@ public function schemaValue($value)
is_numeric($value) && strpos($value, ',') === false &&
$value[0] !== '0' && strpos($value, 'e') === false)
) {
return $value;
return (string)$value;
}

return $this->_connection->quote($value, PDO::PARAM_STR);
Expand Down
9 changes: 4 additions & 5 deletions src/Database/Driver/PDODriverTrait.php
Expand Up @@ -27,9 +27,9 @@ trait PDODriverTrait
/**
* Instance of PDO.
*
* @var \PDO
* @var \PDO|null
*/
protected $_connection;
protected $_connection = null;

/**
* Establishes a connection to the database server
Expand Down Expand Up @@ -79,7 +79,7 @@ public function disconnect()
}

/**
* Check whether or not the driver is connected.
* Checks whether or not the driver is connected.
*
* @return bool
*/
Expand All @@ -94,9 +94,8 @@ public function isConnected()
$connected = false;
}
}
$this->connected = !empty($connected);

return $this->connected;
return (bool)$connected;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Database/Expression/Comparison.php
Expand Up @@ -42,7 +42,7 @@ class Comparison implements ExpressionInterface, FieldInterface
/**
* The type to be used for casting the value to a database representation
*
* @var string
* @var string|array
*/
protected $_type;

Expand Down
2 changes: 1 addition & 1 deletion src/Database/Expression/ValuesExpression.php
Expand Up @@ -60,7 +60,7 @@ class ValuesExpression implements ExpressionInterface
* Whether or not values have been casted to expressions
* already.
*
* @var string
* @var bool
*/
protected $_castedExpressions = false;

Expand Down
6 changes: 3 additions & 3 deletions src/Database/Log/LoggedQuery.php
Expand Up @@ -33,14 +33,14 @@ class LoggedQuery
/**
* Number of milliseconds this query took to complete
*
* @var float
* @var int
*/
public $took = 0;

/**
* Associative array with the params bound to the query string
*
* @var string
* @var array
*/
public $params = [];

Expand All @@ -54,7 +54,7 @@ class LoggedQuery
/**
* The exception that was thrown by the execution of this query
*
* @var \Exception
* @var \Exception|null
*/
public $error;

Expand Down
4 changes: 2 additions & 2 deletions src/Database/Log/LoggingStatement.php
Expand Up @@ -28,7 +28,7 @@ class LoggingStatement extends StatementDecorator
/**
* Logger instance responsible for actually doing the logging task
*
* @var \Cake\Database\Log\QueryLogger
* @var \Cake\Database\Log\QueryLogger|null
*/
protected $_logger;

Expand Down Expand Up @@ -110,7 +110,7 @@ public function bindValue($column, $value, $type = 'string')
* it returns the currently setup logger instance
*
* @param object|null $instance Logger object instance.
* @return object Logger instance
* @return object|null Logger instance
*/
public function logger($instance = null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Database/Query.php
Expand Up @@ -1618,7 +1618,7 @@ public function func()
* iterated without having to call execute() manually, thus making it look like
* a result set instead of the query itself.
*
* @return \Iterator
* @return \Cake\Database\StatementInterface|null
*/
public function getIterator()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Database/Schema/TableSchema.php
Expand Up @@ -399,7 +399,7 @@ public function columnType($name, $type = null)
* based upon.
*
* @param string $column The column name to get the base type from
* @return string The base type name
* @return string|null The base type name
*/
public function baseColumnType($column)
{
Expand Down
1 change: 1 addition & 0 deletions src/Database/Statement/BufferedStatement.php
Expand Up @@ -46,6 +46,7 @@ class BufferedStatement extends StatementDecorator

/**
* Current record pointer
*
* @var int
*/
protected $_counter = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/Database/Statement/StatementDecorator.php
Expand Up @@ -37,7 +37,7 @@ class StatementDecorator implements StatementInterface, Countable, IteratorAggre
* Statement instance implementation, such as PDOStatement
* or any other custom implementation.
*
* @var mixed
* @var \Cake\Database\StatementInterface
*/
protected $_statement;

Expand Down
2 changes: 1 addition & 1 deletion src/Database/Type.php
Expand Up @@ -269,7 +269,7 @@ public static function boolval($value)
* Will convert values into strings
*
* @param mixed $value The value to convert to a string.
* @return bool
* @return string
* @deprecated 3.1.8 This method is now unused.
*/
public static function strval($value)
Expand Down
2 changes: 1 addition & 1 deletion src/Database/Type/DecimalType.php
Expand Up @@ -72,7 +72,7 @@ public function toDatabase($value, Driver $driver)
*
* @param null|string|resource $value The value to convert.
* @param \Cake\Database\Driver $driver The driver instance to convert with.
* @return float
* @return float|null
* @throws \Cake\Core\Exception\Exception
*/
public function toPHP($value, Driver $driver)
Expand Down

0 comments on commit 2312ab8

Please sign in to comment.