Browse Source

Adding some doc blocks

Jose Lorenzo Rodriguez 11 years ago
parent
commit
59086daa9e
1 changed files with 20 additions and 1 deletions
  1. 20 1
      src/I18n/ChainMessagesLoader.php

+ 20 - 1
src/I18n/ChainMessagesLoader.php

@@ -17,17 +17,36 @@ namespace Cake\I18n;
 use Aura\Intl\Package;
 
 /**
- *
+ * Wraps multiple messages loaders calling them one after another until
+ * one of them returns an non-empty package
  *
  */
 class ChainMessagesLoader {
 
+/**
+ * The list of callables to execute one after another for loading messages
+ *
+ * @var array
+ */
 	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
+ */
 	public function __construct(array $loaders) {
 		$this->_loaders = $loaders;
 	}
 
+/**
+ * Executes this object for returning the translations package as configured in
+ * the chain.
+ *
+ * @return \Aura\Intl\Package
+ */
+
 	public function __invoke() {
 		foreach ($this->_loaders as $k => $loader) {
 			if (!is_callable($loader)) {