cvs: pear /PhpDocumentor/phpDocumentor Converter.inc
| From: | Greg Beaver | Date: | Sat, 25 Feb 2006 02:45:22 +0000 |
| Subject: | cvs: pear /PhpDocumentor/phpDocumentor Converter.inc | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-38571@lists.php.net to get a copy of this message | ||
cellog Sat Feb 25 02:45:22 2006 UTC
Modified files:
/pear/PhpDocumentor/phpDocumentor Converter.inc
Log:
add missing brace
optimize nested if(){} wherever possible
http://cvs.php.net/viewcvs.cgi/pear/PhpDocumentor/phpDocumentor/Converter.inc?r1=1.10&r2=1.11&diff_format=u
Index: pear/PhpDocumentor/phpDocumentor/Converter.inc
diff -u pear/PhpDocumentor/phpDocumentor/Converter.inc:1.10
pear/PhpDocumentor/phpDocumentor/Converter.inc:1.11
--- pear/PhpDocumentor/phpDocumentor/Converter.inc:1.10 Sat Feb 25 02:40:21 2006
+++ pear/PhpDocumentor/phpDocumentor/Converter.inc Sat Feb 25 02:45:22 2006
@@ -22,7 +22,7 @@
* @package Converters
* @author Greg Beaver <cellog@users.sourceforge.net>
* @since 1.0rc1
- * @version $Id: Converter.inc,v 1.10 2006/02/25 02:40:21 cellog Exp $
+ * @version $Id: Converter.inc,v 1.11 2006/02/25 02:45:22 cellog Exp $
*/
/**
* Smarty template files
@@ -56,7 +56,7 @@
* @abstract
* @author Greg Beaver <cellog@users.sourceforge.net>
* @since 1.0rc1
- * @version $Id: Converter.inc,v 1.10 2006/02/25 02:40:21 cellog Exp $
+ * @version $Id: Converter.inc,v 1.11 2006/02/25 02:45:22 cellog Exp $
*/
class Converter
{
@@ -2055,20 +2055,21 @@
{
foreach($n as $name => $tutorial)
{
- if (!$tutorial->parent)
- {
- $child_path =
$this->_tutorial_path($tutorial,$tutorial,$tutorial);
- if (!isset($this->processed_tutorials[$child_path]))
- {
- $this->processed_tutorials[$child_path] = $tutorial;
- //debug("parent ".$tutorial->name);
- $ret = $this->_setupTutorialTree($tutorial);
- if (!count($tree)) {
- $tree = $ret;
- } else {
- $tree = array_merge($tree,$ret);
- }
- }
+ if ($tutorial->parent) {
+ continue;
+ }
+
+ $child_path = $this->_tutorial_path($tutorial,$tutorial,$tutorial);
+ if (isset($this->processed_tutorials[$child_path])) {
+ continue;
+ }
+ $this->processed_tutorials[$child_path] = $tutorial;
+ //debug("parent ".$tutorial->name);
+ $ret = $this->_setupTutorialTree($tutorial);
+ if (!count($tree)) {
+ $tree = $ret;
+ } else {
+ $tree = array_merge($tree,$ret);
}
}
}
@@ -2094,27 +2095,29 @@
$tute = false;
}
- if ($tute) {
- $child_path = $this->_tutorial_path($parent,$parent,$tute);
- if (!isset($this->processed_tutorials[$child_path]))
- {
- $this->processed_tutorials[$child_path] = $tute;
- if ($tute->name == $child . '.' . $parent->tutorial_type)
- {
- //echo "Adding [$child_path] to [$parent_path]<br>";
-
$tree[$parent_path]['child'][$this->_tutorial_path($parent,$parent,$tute)]
- ['tutorial'] = $tute;
- if ($tute->ini)
- {
- // add all the child's child tutorials to the list
- if (!isset($tree[$parent_path]['child'])) {
- $tree[$parent_path]['child'] =
$this->_setupTutorialTree($tute);
- } else {
- $tree[$parent_path]['child'] =
array_merge($tree[$parent_path]['child'],
- $this->_setupTutorialTree($tute));
- }
- }
- }
+ if (!$tute) {
+ return $tree;
+ }
+ $child_path = $this->_tutorial_path($parent,$parent,$tute);
+ if (isset($this->processed_tutorials[$child_path])) {
+ return $tree;
+ }
+ $this->processed_tutorials[$child_path] = $tute;
+ if ($tute->name != $child . '.' . $parent->tutorial_type) {
+ return $tree;
+ }
+ //echo "Adding [$child_path] to [$parent_path]<br>";
+
$tree[$parent_path]['child'][$this->_tutorial_path($parent,$parent,$tute)]['tutorial']
+ = $tute;
+ if (!$tute->ini) {
+ return $tree;
+ }
+ // add all the child's child tutorials to the list
+ if (!isset($tree[$parent_path]['child'])) {
+ $tree[$parent_path]['child'] = $this->_setupTutorialTree($tute);
+ } else {
+ $tree[$parent_path]['child'] =
array_merge($tree[$parent_path]['child'],
+ $this->_setupTutorialTree($tute));
}
}
}