Skip to content

Instantly share code, notes, and snippets.

@komapa
Created May 29, 2011 11:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save komapa/997661 to your computer and use it in GitHub Desktop.
Save komapa/997661 to your computer and use it in GitHub Desktop.
Propel runtime phpDoc optimisations - config/
Index: config/PropelConfiguration.php
===================================================================
--- config/PropelConfiguration.php (revision 2294)
+++ config/PropelConfiguration.php (working copy)
@@ -16,7 +16,7 @@
* configuration can also be retrieved as a nested arrays, flat array or as a
* PropelConfiguration instance.
*
- * @author Veikko Mäkinen <veikko@veikko.fi>
+ * @author Veikko Mäkinen <veikko@veikko.fi>
* @version $Revision$
* @package propel.runtime.config
*/
@@ -26,18 +26,14 @@
const TYPE_ARRAY_FLAT = 2;
const TYPE_OBJECT = 3;
- /**
- * @var array An array of parameters
- */
protected $parameters = array();
-
protected $flattenedParameters = array();
protected $isFlattened = false;
/**
* Construct a new configuration container
*
- * @param array $parameters
+ * @param array $parameters
*/
public function __construct(array $parameters = array())
{
@@ -45,7 +41,10 @@
}
/**
- * @see http://www.php.net/ArrayAccess
+ * @see http://www.php.net/ArrayAccess
+ *
+ * @param integer $offset
+ * @return boolean
*/
public function offsetExists($offset)
{
@@ -53,15 +52,21 @@
}
/**
- * @see http://www.php.net/ArrayAccess
+ * @see http://www.php.net/ArrayAccess
+ *
+ * @param integer $offset
+ * @param mixed $value
*/
public function offsetSet($offset, $value)
{
- $this->parameter[$offset] = $value;
+ $this->parameters[$offset] = $value;
}
/**
- * @see http://www.php.net/ArrayAccess
+ * @see http://www.php.net/ArrayAccess
+ *
+ * @param integer $offset
+ * @return array
*/
public function offsetGet($offset)
{
@@ -69,7 +74,9 @@
}
/**
- * @see http://www.php.net/ArrayAccess
+ * @see http://www.php.net/ArrayAccess
+ *
+ * @param integer $offset
*/
public function offsetUnset($offset)
{
@@ -79,10 +86,10 @@
/**
* Get parameter value from the container
*
- * @param string $name Parameter name
- * @param mixed $default Default value to be used if the
- * requested value is not found
- * @return mixed Parameter value or the default
+ * @param string $name Parameter name
+ * @param mixed $default Default value to be used if the requested value is not found
+ *
+ * @return mixed Parameter value or the default
*/
public function getParameter($name, $default = null)
{
@@ -96,8 +103,8 @@
/**
* Store a value to the container
*
- * @param string $name Configuration item name (name.space.name)
- * @param mixed $value Value to be stored
+ * @param string $name Configuration item name (name.space.name)
+ * @param mixed $value Value to be stored
*/
public function setParameter($name, $value)
{
@@ -111,10 +118,10 @@
}
/**
+ * @throws PropelException
*
- *
- * @param int $type
- * @return mixed
+ * @param integer $type
+ * @return mixed
*/
public function getParameters($type = PropelConfiguration::TYPE_ARRAY)
{
@@ -130,6 +137,9 @@
}
}
+ /**
+ * @return array
+ */
public function getFlattenedParameters()
{
if (!$this->isFlattened) {
@@ -151,5 +161,4 @@
}
$this->flattenedParameters = array_merge($this->flattenedParameters, $result);
}
-
}
Index: config/PropelConfigurationIterator.php
===================================================================
--- config/PropelConfigurationIterator.php (revision 2294)
+++ config/PropelConfigurationIterator.php (working copy)
@@ -12,7 +12,7 @@
* PropelConfigurationIterator is used internally by PropelConfiguration to
* build a flat array from nesting configuration arrays.
*
- * @author Veikko Mäkinen <veikko@veikko.fi>
+ * @author Veikko Mäkinen <veikko@veikko.fi>
* @version $Revision$
* @package propel.runtime.config
*/
@@ -31,21 +31,21 @@
/**
* Namespace stack when recursively iterating the configuration tree
*
- * @var array
+ * @var array
*/
protected $namespaceStack = array();
/**
* Current node type. Possible values: null (undefined), self::NODE_PARENT or self::NODE_ITEM
*
- * @var int
+ * @var integer
*/
protected $nodeType = null;
/**
* Get current namespace
*
- * @return string
+ * @return string
*/
public function getNamespace()
{
@@ -55,8 +55,8 @@
/**
* Get current node type.
*
- * @see http://www.php.net/RecursiveIteratorIterator
- * @return int
+ * @see http://www.php.net/RecursiveIteratorIterator
+ * @return integer
* - null (undefined)
* - self::NODE_PARENT
* - self::NODE_ITEM
@@ -69,8 +69,8 @@
/**
* Get the current element
*
- * @see http://www.php.net/RecursiveIteratorIterator
- * @return mixed
+ * @see http://www.php.net/RecursiveIteratorIterator
+ * @return mixed
*/
public function current()
{
@@ -89,7 +89,7 @@
/**
* Called after current child iterator is invalid and right before it gets destructed.
*
- * @see http://www.php.net/RecursiveIteratorIterator
+ * @see http://www.php.net/RecursiveIteratorIterator
*/
public function endChildren()
{
@@ -97,5 +97,4 @@
array_pop($this->namespaceStack);
}
}
-
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment