Skip to content
Permalink
Browse files

Improve IDE compatibility

  • Loading branch information...
dereuromark committed Sep 20, 2017
1 parent c65346c commit 165f178241dda57449abb9203a6b476048459674
@@ -635,7 +635,7 @@ public function addSubcommands(array $commands)
/**
* Gets the arguments defined in the parser.
*
* @return array Array of argument descriptions
* @return \Cake\Console\ConsoleInputArgument[]
*/
public function arguments()
{
@@ -645,7 +645,7 @@ public function arguments()
/**
* Get the defined options in the parser.
*
* @return array
* @return \Cake\Console\ConsoleInputOption[]
*/
public function options()
{
@@ -655,7 +655,7 @@ public function options()
/**
* Get the array of defined subcommands
*
* @return array
* @return \Cake\Console\ConsoleInputSubcommand[]
*/
public function subcommands()
{
@@ -877,7 +877,7 @@ public function constructAuthenticate()
*
* @param \Cake\Auth\Storage\StorageInterface|null $storage Sets provided
* object as storage or if null returns configured storage object.
* @return \Cake\Auth\Storage\StorageInterface|null
* @return \Cake\Auth\Storage\StorageInterface|\Cake\Core\InstanceConfigTrait|null
*/
public function storage(StorageInterface $storage = null)
{
@@ -78,12 +78,12 @@ class CsrfComponent extends Component
*/
public function startup(Event $event)
{
/* @var \Cake\Controller\Controller $controller */
$controller = $event->getSubject();
$request = $controller->request;
$response = $controller->response;
$cookieName = $this->_config['cookieName'];
/* @var \Cake\Http\ServerRequest $request */
$cookieData = $request->getCookie($cookieName);
if ($cookieData) {
$request->params['_csrfToken'] = $cookieData;
@@ -189,6 +189,7 @@ protected function _setExtension($request, $response)
*/
public function startup(Event $event)
{
/* @var \Cake\Controller\Controller $controller */
$controller = $event->getSubject();
$request = $controller->request;
$response = $controller->response;
@@ -99,6 +99,7 @@ class SecurityComponent extends Component
*/
public function startup(Event $event)
{
/* @var \Cake\Controller\Controller $controller */
$controller = $event->getSubject();
$this->session = $controller->request->getSession();
$this->_action = $controller->request->getParam('action');
@@ -510,12 +511,12 @@ protected function _debugPostTokenNotMatching(Controller $controller, $hashParts
'Missing field \'%s\' in POST data'
);
$expectedUnlockedFields = Hash::get($expectedParts, 2);
$dataUnlockedFields = Hash::get($hashParts, 2) ?: [];
$dataUnlockedFields = Hash::get($hashParts, 2) ?: null;
if ($dataUnlockedFields) {
$dataUnlockedFields = explode('|', $dataUnlockedFields);
}
$unlockFieldsMessages = $this->_debugCheckFields(
$dataUnlockedFields,
(array)$dataUnlockedFields,
$expectedUnlockedFields,
'Unexpected unlocked field \'%s\' in POST data',
null,
@@ -320,9 +320,8 @@ public function components($components = null)
public function loadComponent($name, array $config = [])
{
list(, $prop) = pluginSplit($name);
$this->{$prop} = $this->components()->load($name, $config);
return $this->{$prop};
return $this->{$prop} = $this->components()->load($name, $config);
}
/**
@@ -689,7 +688,7 @@ public function referer($default = null, $local = false)
* @param \Cake\ORM\Table|string|\Cake\ORM\Query|null $object Table to paginate
* (e.g: Table instance, 'TableName' or a Query object)
* @param array $settings The settings/configuration used for pagination.
* @return \Cake\ORM\ResultSet Query results
* @return \Cake\ORM\ResultSet|\Cake\Datasource\ResultSetInterface Query results
* @link https://book.cakephp.org/3.0/en/controllers.html#paginating-a-model
* @throws \RuntimeException When no compatible table object can be found.
*/
@@ -556,6 +556,7 @@ protected function _handleError($exception)
if (empty($class) || !class_exists($class)) {
$class = 'Cake\Error\ExceptionRenderer';
}
/* @var \Cake\Error\ExceptionRenderer $instance */
$instance = new $class($exception);
$this->_response = $instance->render();
}

0 comments on commit 165f178

Please sign in to comment.
You can’t perform that action at this time.