Skip to content
Permalink
Browse files

Improve doc blocks for IDE understanding.

  • Loading branch information...
dereuromark committed Sep 25, 2017
1 parent 8dea5d8 commit 35f70ad2c9843b1c42afba072615ce9141d3bf45
@@ -22,6 +22,8 @@
/**
* Base Authentication class with common methods and properties.
*
* @mixin \Cake\Core\InstanceConfigTrait
*/
abstract class BaseAuthenticate implements EventListenerInterface
{
@@ -22,6 +22,7 @@
* Abstract base authorization adapter for AuthComponent.
*
* @see \Cake\Controller\Component\AuthComponent::$authenticate
* @mixin \Cake\Core\InstanceConfigTrait
*/
abstract class BaseAuthorize
{
@@ -20,6 +20,8 @@
/**
* Session based persistent storage for authenticated user record.
*
* @mixin \Cake\Core\InstanceConfigTrait
*/
class SessionStorage implements StorageInterface
{
@@ -19,6 +19,8 @@
/**
* Storage engine for CakePHP caching
*
* @mixin \Cake\Core\InstanceConfigTrait
*/
abstract class CacheEngine
{
@@ -55,6 +55,7 @@
*
* @link https://book.cakephp.org/3.0/en/controllers/components.html
* @see \Cake\Controller\Controller::$components
* @mixin \Cake\Core\InstanceConfigTrait
*/
class Component implements EventListenerInterface
{
@@ -33,7 +33,7 @@ interface QueryInterface
*
* @param string $field The field to alias
* @param string|null $alias the alias used to prefix the field
* @return array
* @return string
*/
public function aliasField($field, $alias = null);
@@ -43,7 +43,7 @@ public function aliasField($field, $alias = null);
*
* @param array $fields The fields to alias
* @param string|null $defaultAlias The default alias
* @return array
* @return string[]
*/
public function aliasFields($fields, $defaultAlias = null);
@@ -27,6 +27,8 @@
*
* Traps exceptions and converts them into HTML or content-type appropriate
* error pages using the CakePHP ExceptionRenderer.
*
* @mixin \Cake\Core\InstanceConfigTrait
*/
class ErrorHandlerMiddleware
{
@@ -91,6 +91,7 @@
* specify which authentication strategy you want to use.
* CakePHP comes with built-in support for basic authentication.
*
* @mixin \Cake\Core\InstanceConfigTrait
*/
class Client
{
@@ -21,6 +21,8 @@
/**
* Base log engine class.
*
* @mixin \Cake\Core\InstanceConfigTrait
*/
abstract class BaseLog extends AbstractLogger
{
@@ -18,6 +18,8 @@
/**
* Abstract transport for sending email
*
* @mixin \Cake\Core\InstanceConfigTrait
*/
abstract class AbstractTransport
{
@@ -24,6 +24,8 @@
* CakePHP network socket connection class.
*
* Core base class for network communication.
*
* @mixin \Cake\Core\InstanceConfigTrait
*/
class Socket
{
@@ -1191,6 +1191,7 @@ protected function _formatAssociationResults($query, $surrogate, $options)
$extracted = new ResultSetDecorator($callable($extracted));
}
/* @var \Cake\Collection\CollectionInterface $results */
return $results->insert($property, $extracted);
}, Query::PREPEND);
}
@@ -109,6 +109,7 @@
*
* @see \Cake\ORM\Table::addBehavior()
* @see \Cake\Event\EventManager
* @mixin \Cake\Core\InstanceConfigTrait
*/
class Behavior implements EventListenerInterface
{
@@ -213,17 +213,19 @@ public function beforeFind(Event $event, Query $query, $options)
}
$conditions = function ($field, $locale, $query, $select) {
return function ($q) use ($field, $locale, $query, $select) {
$q->where([$q->repository()->aliasField('locale') => $locale]);
return function ($query) use ($field, $locale, $query, $select) {
/* @var \Cake\Datasource\QueryInterface $query */
$query->where([$query->repository()->aliasField('locale') => $locale]);
/* @var \Cake\ORM\Query $query */
if ($query->isAutoFieldsEnabled() ||
in_array($field, $select, true) ||
in_array($this->_table->aliasField($field), $select, true)
) {
$q->select(['id', 'content']);
$query->select(['id', 'content']);
}
return $q;
return $query;
};
};
@@ -381,12 +383,13 @@ public function buildMarshalMap($marshaller, $map, $options)
return [
'_translations' => function ($value, $entity) use ($marshaller, $options) {
/* @var \Cake\Datasource\EntityInterface $entity */
$translations = $entity->get('_translations');
foreach ($this->_config['fields'] as $field) {
$options['validate'] = $this->_config['validator'];
$errors = [];
if (!is_array($value)) {
return;
return null;
}
foreach ($value as $language => $fields) {
if (!isset($translations[$language])) {
@@ -477,12 +480,13 @@ public function findTranslations(Query $query, array $options)
$targetAlias = $this->_translationTable->getAlias();
return $query
->contain([$targetAlias => function ($q) use ($locales, $targetAlias) {
->contain([$targetAlias => function ($query) use ($locales, $targetAlias) {
if ($locales) {
$q->where(["$targetAlias.locale IN" => $locales]);
/* @var \Cake\Datasource\QueryInterface $query */
$query->where(["$targetAlias.locale IN" => $locales]);
}
return $q;
return $query;
}])
->formatResults([$this, 'groupTranslations'], $query::PREPEND);
}
@@ -545,6 +549,7 @@ protected function _rowMapper($results, $locale)
$row['_locale'] = $locale;
if ($hydrated) {
/** @var \Cake\Datasource\EntityInterface $row */
$row->clean();
}
@@ -1289,6 +1289,7 @@ public function findList(Query $query, array $options)
);
return $query->formatResults(function ($results) use ($options) {
/* @var \Cake\Collection\CollectionInterface $results */
return $results->combine(
$options['keyField'],
$options['valueField'],
@@ -1338,6 +1339,7 @@ public function findThreaded(Query $query, array $options)
$options = $this->_setFieldMatchers($options, ['keyField', 'parentField']);
return $query->formatResults(function ($results) use ($options) {
/* @var \Cake\Collection\CollectionInterface $results */
return $results->nest($options['keyField'], $options['parentField'], $options['nestingKey']);
});
}
@@ -62,6 +62,8 @@
*
* When using the `for` or `when` matchers, conditions will be re-checked on the before and after
* callback as the conditions could change during the dispatch cycle.
*
* @mixin \Cake\Core\InstanceConfigTrait
*/
class DispatcherFilter implements EventListenerInterface
{

0 comments on commit 35f70ad

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