svn: /phpdoc/doc-base/branches/docgen-update/scripts/docgen/ includes/cli-options.php structures/Docgen_Job.php
| From: | Justin Martin | Date: | Wed, 22 Feb 2012 09:30:51 +0000 |
| Subject: | svn: /phpdoc/doc-base/branches/docgen-update/scripts/docgen/ includes/cli-options.php structures/Docgen_Job.php | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-9641@lists.php.net to get a copy of this message | ||
frozenfire Wed, 22 Feb 2012 09:30:51 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=323421
Log:
Missing parantheses, braces, semicolons galore.
Added "no options specified" condition to show help.
Changed Docgen_Job to abstract.
Changed paths:
U phpdoc/doc-base/branches/docgen-update/scripts/docgen/includes/cli-options.php
U phpdoc/doc-base/branches/docgen-update/scripts/docgen/structures/Docgen_Job.php
Modified: phpdoc/doc-base/branches/docgen-update/scripts/docgen/includes/cli-options.php
===================================================================
--- phpdoc/doc-base/branches/docgen-update/scripts/docgen/includes/cli-options.php 2012-02-22
09:25:44 UTC (rev 323420)
+++ phpdoc/doc-base/branches/docgen-update/scripts/docgen/includes/cli-options.php 2012-02-22
09:30:51 UTC (rev 323421)
@@ -73,6 +73,7 @@
// Conditions upon which to display the usage message and exit
if ($options === FALSE // Invalid option usage
+ || empty($options)
|| (array_key_exists("h", $options)
|| array_key_exists("help", $options)) // Help is requested
) {
@@ -86,7 +87,7 @@
}
// Cannot be both verbose and quiet
- if ((!empty($options["q"]
+ if ((!empty($options["q"])
|| !empty($options["quiet"]))
&& (!empty($options["v"])
|| !empty($options["verbose"]))
@@ -111,7 +112,7 @@
if ((is_array($options[$shortoption])
|| is_array($options[$longoption]))
|| (!empty($options[$shortoption])
- && !empty($options[$longoption])
+ && !empty($options[$longoption]))
&& !in_array($shortoption, self::$option_spec['multiples'], true)
) {
trigger_error("Option -{$shortoption}, --{$longoption} does not support
multiple specifications.", E_USER_ERROR);
@@ -126,7 +127,7 @@
} elseif (isset($options[$shortoption]) && is_array($options[$longoption])) {
$options[$longoption][] = $option[$shortoption];
self::$options[$longoption] = $options[$longoption];
- } elseif (isset($options[$shortoption) && isset($options[$longoption])) {
+ } elseif (isset($options[$shortoption]) && isset($options[$longoption])) {
self::$options[$longoption] = array($options[$shortoption], $options[$longoption]);
} elseif (isset($options[$shortoption]) || isset($options[$longoption])) { // Just one
version of the option is specified
self::$options[$longoption] =
isset($options[$shortoption])?$options[$shortoption]:$options[$longoption];
@@ -134,7 +135,7 @@
}
// Change extension names to lowercase - just makes things easier in the long run
- foreach (self::$options["extension"] as &$extension) {
+ if (is_array(self::$options["extension"])) foreach
(self::$options["extension"] as &$extension) {
$extension = strtolower($extension);
}
@@ -161,13 +162,13 @@
&& function_exists($item))
) {
trigger_error("The '{$item}' {$jobtype} is not loaded.
Documentation will not occur for this {$jobtype}.", E_USER_WARNING);
- unset($option[$jobtype][$index];
+ unset($option[$jobtype][$index]);
}
}
if (empty($options[$jobtype])) $options[$jobtype] = null;
} else {
if (($jobtype == "extension"
- && !extension_loaded($options[$jobtype])
+ && !extension_loaded($options[$jobtype]))
|| ($jobtype == "class"
&& !class_exists($options[$jobtype]))
|| ($jobtype == "method"
@@ -228,7 +229,7 @@
if ($jobtype == "function") $reflect = new
ReflectionFunction($options[$jobtype]);
$extension = strtolower($reflect->getExtensionName());
if (is_array($option["extension"]) &&
in_array($extension, $option["extension"])) {
- $options[$jobtype] = null
+ $options[$jobtype] = null;
} elseif ($options["extension"] == $extension) {
$options[$jobtype] = null;
}
@@ -257,7 +258,7 @@
// Verify the specified phpdoc location exists and can be read
if (!is_null($options["phpdoc"]) &&
!is_readable($options["phpdoc"])) {
trigger_error("The phpdoc path '{$options["phpdoc"]}' does not
exist or is not readable. It will not be analyzed or copied to.", E_USER_WARNING);
- $options["phpdoc"] = null
+ $options["phpdoc"] = null;
$options["copy"] = false;
}
Modified: phpdoc/doc-base/branches/docgen-update/scripts/docgen/structures/Docgen_Job.php
===================================================================
--- phpdoc/doc-base/branches/docgen-update/scripts/docgen/structures/Docgen_Job.php 2012-02-22
09:25:44 UTC (rev 323420)
+++ phpdoc/doc-base/branches/docgen-update/scripts/docgen/structures/Docgen_Job.php 2012-02-22
09:30:51 UTC (rev 323421)
@@ -1,6 +1,6 @@
<?php
define("DOCGEN_VERSION", "alpha");
-class Docgen_Job {
+abstract class Docgen_Job {
}