Skip to content

Commit

Permalink
More docblock CS fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed May 27, 2014
1 parent 8c8b1a0 commit b240bac
Show file tree
Hide file tree
Showing 29 changed files with 103 additions and 122 deletions.
1 change: 1 addition & 0 deletions src/Cache/Cache.php
Expand Up @@ -101,6 +101,7 @@ class Cache {
* Finds and builds the instance of the required engine class.
*
* @param string $name Name of the config array that needs an engine instance built
* @return void
* @throws \Cake\Error\Exception When a cache engine cannot be created.
*/
protected static function _buildEngine($name) {
Expand Down
2 changes: 2 additions & 0 deletions src/Cache/CacheRegistry.php
Expand Up @@ -47,6 +47,7 @@ protected function _resolveClassName($class) {
*
* @param string $class The classname that is missing.
* @param string $plugin The plugin the cache is missing in.
* @return void
* @throws \Cake\Error\Exception
*/
protected function _throwMissingClassError($class, $plugin) {
Expand All @@ -57,6 +58,7 @@ protected function _throwMissingClassError($class, $plugin) {
* Create the cache engine instance.
*
* Part of the template method for Cake\Utility\ObjectRegistry::load()
*
* @param string|CacheEngine $class The classname or object to make.
* @param string $alias The alias of the object.
* @param array $config An array of settings to use for the cache engine.
Expand Down
14 changes: 4 additions & 10 deletions src/Cache/Engine/FileEngine.php
@@ -1,11 +1,5 @@
<?php
/**
* File Storage engine for cache. Filestorage is the slowest cache storage
* to read and write. However, it is good for servers that don't have other storage
* engine available, or have content which is not performance sensitive.
*
* You can configure a FileEngine cache, using Cache::config()
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
Expand Down Expand Up @@ -322,8 +316,8 @@ protected function _clearDirectory($path, $now, $threshold) {
/**
* Not implemented
*
* @param string $key
* @param int $offset
* @param string $key Cache key.
* @param int $offset Offset.
* @return void
* @throws \Cake\Error\Exception
*/
Expand All @@ -334,8 +328,8 @@ public function decrement($key, $offset = 1) {
/**
* Not implemented
*
* @param string $key
* @param int $offset
* @param string $key Cache key.
* @param int $offset Offset.
* @return void
* @throws \Cake\Error\Exception
*/
Expand Down
3 changes: 2 additions & 1 deletion src/Cache/Engine/MemcachedEngine.php
Expand Up @@ -155,6 +155,7 @@ public function init(array $config = []) {
/**
* Settings the memcached instance
*
* @return void
* @throws \Cake\Error\Exception when the Memcached extension is not built with the desired serializer engine
*/
protected function _setOptions() {
Expand Down Expand Up @@ -351,7 +352,7 @@ public function deleteMany($keys) {
/**
* Delete all keys from the cache
*
* @param bool $check
* @param bool $check If true will check expiration, otherwise delete all.
* @return bool True if the cache was successfully cleared, false otherwise
*/
public function clear($check) {
Expand Down
2 changes: 1 addition & 1 deletion src/Cache/Engine/RedisEngine.php
Expand Up @@ -192,7 +192,7 @@ public function delete($key) {
/**
* Delete all keys from the cache
*
* @param bool $check
* @param bool $check If true will check expiration, otherwise delete all.
* @return bool True if the cache was successfully cleared, false otherwise
*/
public function clear($check) {
Expand Down
5 changes: 2 additions & 3 deletions src/Cache/Engine/XcacheEngine.php
@@ -1,7 +1,5 @@
<?php
/**
* Xcache storage engine for cache.
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
Expand Down Expand Up @@ -147,7 +145,8 @@ public function delete($key) {
/**
* Delete all keys from the cache
*
* @param bool $check
* @param bool $check If true will check expiration, otherwise delete all.
* Unused for Xcache engine.
* @return bool True if the cache was successfully cleared, false otherwise
*/
public function clear($check) {
Expand Down
4 changes: 2 additions & 2 deletions src/Collection/ExtractTrait.php
Expand Up @@ -44,8 +44,8 @@ protected function _propertyExtractor($callback) {
* Returns a column from $data that can be extracted
* by iterating over the column names contained in $path
*
* @param array|\ArrayAccess $data
* @param array $path
* @param array|\ArrayAccess $data Data.
* @param array $path Path to extract from.
* @return mixed
*/
protected function _extract($data, $path) {
Expand Down
4 changes: 2 additions & 2 deletions src/Collection/Iterator/FilterIterator.php
Expand Up @@ -33,8 +33,8 @@ class FilterIterator extends Collection {
* in the current iteration, the key of the element and the passed $items iterator
* as arguments, in that order.
*
* @param Iterator $items the items to be filtered
* @param callable $callback
* @param Iterator $items The items to be filtered.
* @param callable $callback Callback.
*/
public function __construct(Iterator $items, callable $callback) {
$wrapper = new CallbackFilterIterator($items, $callback);
Expand Down
2 changes: 1 addition & 1 deletion src/Collection/Iterator/NestIterator.php
Expand Up @@ -34,7 +34,7 @@ class NestIterator extends Collection implements RecursiveIterator {
/**
* Constructor
*
* @param array|\Traversable $items
* @param array|\Traversable $items Collection items.
* @param string|callable $nestKey the property that contains the nested items
* If a callable is passed, it should return the childrens for the passed item
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Collection/Iterator/ReplaceIterator.php
Expand Up @@ -37,8 +37,8 @@ class ReplaceIterator extends Collection {
* in the current iteration, the key of the element and the passed $items iterator
* as arguments, in that order.
*
* @param array|\Traversable $items the items to be filtered
* @param callable $callback
* @param array|\Traversable $items The items to be filtered.
* @param callable $callback Callback.
*/
public function __construct($items, callable $callback) {
$this->_callback = $callback;
Expand Down
6 changes: 3 additions & 3 deletions src/Collection/Iterator/TreeIterator.php
Expand Up @@ -39,9 +39,9 @@ class TreeIterator extends RecursiveIteratorIterator {
/**
* Constructor
*
* @param RecursiveIterator $items The iterator to flatten
* @param int $mode
* @param int $flags
* @param RecursiveIterator $items The iterator to flatten.
* @param int $mode Iterator mode.
* @param int $flags Iterator flags.
*/
public function __construct(RecursiveIterator $items, $mode = RecursiveIteratorIterator::SELF_FIRST, $flags = 0) {
parent::__construct($items, $mode, $flags);
Expand Down
8 changes: 4 additions & 4 deletions src/Collection/Iterator/TreePrinter.php
Expand Up @@ -52,14 +52,14 @@ class TreePrinter extends RecursiveIteratorIterator {
/**
* Constructor
*
* @param RecursiveIterator $items The iterator to flatten
* @param RecursiveIterator $items The iterator to flatten.
* @param string|callable $valuePath The property to extract or a callable to return
* the display value
* the display value.
* @param string|callable $keyPath The property to use as iteration key or a
* callable returning the key value.
* @param string $spacer The string to use for prefixing the values according to
* their depth in the tree
* @param int $mode
* their depth in the tree.
* @param int $mode Iterator mode.
*/
public function __construct($items, $valuePath, $keyPath, $spacer, $mode = RecursiveIteratorIterator::SELF_FIRST) {
parent::__construct($items, $mode);
Expand Down
4 changes: 1 addition & 3 deletions src/Event/Event.php
@@ -1,7 +1,5 @@
<?php
/**
* Event class
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
Expand Down Expand Up @@ -82,7 +80,7 @@ public function __construct($name, $subject = null, $data = null) {
/**
* Dynamically returns the name and subject if accessed directly
*
* @param string $attribute
* @param string $attribute Attribute name
* @return mixed
*/
public function __get($attribute) {
Expand Down
12 changes: 5 additions & 7 deletions src/Event/EventManager.php
@@ -1,7 +1,5 @@
<?php
/**
* Event Manager
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
Expand Down Expand Up @@ -62,7 +60,7 @@ class EventManager {
*
* If called with the first parameter, it will be set as the globally available instance
*
* @param \Cake\Event\EventManager $manager
* @param \Cake\Event\EventManager $manager Event manager instance.
* @return \Cake\Event\EventManager the global event manager
*/
public static function instance($manager = null) {
Expand Down Expand Up @@ -114,7 +112,7 @@ public function attach($callable, $eventKey = null, array $options = array()) {
* Auxiliary function to attach all implemented callbacks of a Cake\Event\EventListener class instance
* as individual methods on this manager
*
* @param \Cake\Event\EventListener $subscriber
* @param \Cake\Event\EventListener $subscriber Event listerner.
* @return void
*/
protected function _attachSubscriber(EventListener $subscriber) {
Expand Down Expand Up @@ -254,7 +252,7 @@ public function dispatch($event) {
* Optimize the common cases to provide improved performance.
*
* @param callable $listener The listener to trigger.
* @param Event $event
* @param \Cake\Event\Event $event Event instance.
* @return mixed The result of the $listener function.
*/
protected function _callListener(callable $listener, Event $event) {
Expand All @@ -281,7 +279,7 @@ protected function _callListener(callable $listener, Event $event) {
/**
* Returns a list of all listeners for an eventKey in the order they should be called
*
* @param string $eventKey
* @param string $eventKey Event key.
* @return array
*/
public function listeners($eventKey) {
Expand Down Expand Up @@ -313,7 +311,7 @@ public function listeners($eventKey) {
/**
* Returns the listeners for the specified event key indexed by priority
*
* @param string $eventKey
* @param string $eventKey Event key.
* @return array
*/
public function prioritisedListeners($eventKey) {
Expand Down
18 changes: 9 additions & 9 deletions src/Model/Behavior/CounterCacheBehavior.php
Expand Up @@ -91,7 +91,7 @@ class CounterCacheBehavior extends Behavior {
/**
* Constructor
*
* @param Table $table The table this behavior is attached to.
* @param \Cake\ORM\Table $table The table this behavior is attached to.
* @param array $config The config for this behavior.
*/
public function __construct(Table $table, array $config = []) {
Expand All @@ -104,8 +104,8 @@ public function __construct(Table $table, array $config = []) {
*
* Makes sure to update counter cache when a new record is created or updated.
*
* @param Event $event
* @param Entity $entity
* @param \Cake\Event\Event $event The afterSave event that was fired.
* @param \Cake\ORM\Entity $entity The entity that was saved.
* @return void
*/
public function afterSave(Event $event, Entity $entity) {
Expand All @@ -117,8 +117,8 @@ public function afterSave(Event $event, Entity $entity) {
*
* Makes sure to update counter cache when a record is deleted.
*
* @param Event $event
* @param Entity $entity
* @param \Cake\Event\Event $event The afterDelete event that was fired.
* @param \Cake\ORM\Entity $entity The entity that was deleted.
* @return void
*/
public function afterDelete(Event $event, Entity $entity) {
Expand All @@ -128,8 +128,8 @@ public function afterDelete(Event $event, Entity $entity) {
/**
* Iterate all associations and update counter caches.
*
* @param Event $event
* @param Entity $entity
* @param \Cake\Event\Event $event Event instance.
* @param \Cake\ORM\Entity $entity Entity
* @return void
*/
protected function _processAssociations(Event $event, Entity $entity) {
Expand All @@ -142,8 +142,8 @@ protected function _processAssociations(Event $event, Entity $entity) {
/**
* Updates counter cache for a single association
*
* @param Event $event
* @param Entity $entity
* @param \Cake\Event\Event $event Event instance.
* @param \Cake\ORM\Entity $entity Entity
* @param Association $assoc The association object
* @param array $settings The settings for for counter cache for this association
* @return void
Expand Down
22 changes: 10 additions & 12 deletions src/Model/Behavior/TimestampBehavior.php
Expand Up @@ -65,7 +65,7 @@ class TimestampBehavior extends Behavior {
* If events are specified - do *not* merge them with existing events,
* overwrite the events to listen on
*
* @param Table $table The table this behavior is attached to.
* @param \Cake\ORM\Table $table The table this behavior is attached to.
* @param array $config The config for this behavior.
*/
public function __construct(Table $table, array $config = []) {
Expand All @@ -77,12 +77,10 @@ public function __construct(Table $table, array $config = []) {
}

/**
* handleEvent
*
* There is only one event handler, it can be configured to be called for any event
*
* @param Event $event
* @param Entity $entity
* @param \Cake\Event\Event $event Event instance.
* @param \Cake\ORM\Entity $entity Entity instance.
* @throws \UnexpectedValueException if a field's when value is misdefined
* @return true (irrespective of the behavior logic, the save will not be prevented)
* @throws \UnexpectedValueException When the value for an event is not 'always', 'new' or 'existing'
Expand Down Expand Up @@ -130,8 +128,8 @@ public function implementedEvents() {
* If an explicit date time is passed, the config option `refreshTimestamp` is
* automatically set to false.
*
* @param \DateTime $ts
* @param bool $refreshTimestamp
* @param \DateTime $ts Timestamp
* @param bool $refreshTimestamp If true timestamp is refreshed.
* @return \Cake\Utility\Time
*/
public function timestamp(\DateTime $ts = null, $refreshTimestamp = false) {
Expand All @@ -154,8 +152,8 @@ public function timestamp(\DateTime $ts = null, $refreshTimestamp = false) {
* "always" or "existing", update the timestamp value. This method will overwrite
* any pre-existing value.
*
* @param Entity $entity
* @param string $eventName
* @param \Cake\ORM\Entity $entity Entity instance.
* @param string $eventName Event name.
* @return bool true if a field is updated, false if no action performed
*/
public function touch(Entity $entity, $eventName = 'Model.beforeSave') {
Expand All @@ -181,9 +179,9 @@ public function touch(Entity $entity, $eventName = 'Model.beforeSave') {
/**
* Update a field, if it hasn't been updated already
*
* @param Entity $entity
* @param string $field
* @param bool $refreshTimestamp
* @param \Cake\ORM\Entity $entity Entity instance.
* @param string $field Field name
* @param bool $refreshTimestamp Whether to refresh timestamp.
* @return void
*/
protected function _updateField(Entity $entity, $field, $refreshTimestamp) {
Expand Down

0 comments on commit b240bac

Please sign in to comment.