summaryrefslogtreecommitdiff
path: root/scripts/dev/generate-phpt/src/gtFunction.php
diff options
context:
space:
mode:
authorSean Finney <seanius@debian.org>2009-06-24 22:49:04 +0200
committerSean Finney <seanius@debian.org>2009-06-24 22:49:04 +0200
commit84f4ca9b07fe5b73d840258f4aa7c1eb534c4253 (patch)
tree9829bd578af8a4a8b42b04277f9067e00dc5ad90 /scripts/dev/generate-phpt/src/gtFunction.php
parent6821b67124604da690c5e9276d5370d679c63ac8 (diff)
downloadphp-84f4ca9b07fe5b73d840258f4aa7c1eb534c4253.tar.gz
Imported Upstream version 5.3.0~RC4upstream/5.3.0_RC4upstream/5.3.0.RC4
Diffstat (limited to 'scripts/dev/generate-phpt/src/gtFunction.php')
-rw-r--r--scripts/dev/generate-phpt/src/gtFunction.php48
1 files changed, 48 insertions, 0 deletions
diff --git a/scripts/dev/generate-phpt/src/gtFunction.php b/scripts/dev/generate-phpt/src/gtFunction.php
new file mode 100644
index 000000000..74058216e
--- /dev/null
+++ b/scripts/dev/generate-phpt/src/gtFunction.php
@@ -0,0 +1,48 @@
+<?php
+
+/**
+ * Class reperesents a single PHP function.
+ *
+ */
+class gtFunction extends gtTestSubject {
+
+ private $functionName;
+
+ /**
+ * Set the name of the name of the function
+ *
+ * @param string $functionName
+ */
+ public function __construct($functionName) {
+ $this->functionName = $functionName;
+ }
+
+
+ /**
+ * Get the names of function argments and initialise mandatory and optional argument arrays
+ *
+ */
+ public function setArgumentNames() {
+ $function= new ReflectionFunction($this->functionName);
+
+ foreach ($function->getParameters() as $i => $param) {
+ if($param->isOptional()) {
+ $this->optionalArgumentNames[] = $param->getName();
+ } else {
+ $this->mandatoryArgumentNames[] = $param->getName();
+ }
+ }
+ }
+
+
+ /**
+ * Return the name of the function
+ *
+ * @return string
+ */
+ public function getName() {
+ return $this->functionName;
+ }
+
+}
+?> \ No newline at end of file