Skip to content

Commit

Permalink
Merge pull request phayes#9 from theodoreb/master
Browse files Browse the repository at this point in the history
Fix Hack alert in Geometry.class.php
  • Loading branch information
phayes committed Dec 6, 2011
2 parents 3c5890b + 8991753 commit 4957f88
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions lib/geometry/Geometry.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,8 @@ public function out() {
$processor_type = $type_map[$format];
$processor = new $processor_type();

// @@TODO: Hack alert!
// There has got to be a better way to do this...
// Is there an equivilent to call_user_func for objects???
if (count($args) == 0) $result = $processor->write($this);
if (count($args) == 1) $result = $processor->write($this, $args[0]);
if (count($args) == 2) $result = $processor->write($this, $args[0],$args[1]);
if (count($args) == 3) $result = $processor->write($this, $args[0],$args[1],$args[2]);
if (count($args) == 4) $result = $processor->write($this, $args[0],$args[1],$args[2], $args[3]);
if (count($args) == 5) $result = $processor->write($this, $args[0],$args[1],$args[2], $args[3], $args[4]);
array_unshift($args, $this);
$result = call_user_func_array(array($processor, 'write'), $args);

return $result;
}
Expand Down

0 comments on commit 4957f88

Please sign in to comment.