Documentation is available at Summary.php
- <?php
- # Copyright (c) 2002-2005 Cunningham & Cunningham, Inc.
- # Released under the terms of the GNU General Public License version 2 or later.
- #
- # PHP5 translation by Luis A. Floreani <luis.floreani@gmail.com>
- /**
- * load class Fixture
- */
- include_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'Fixture.php';
- /**
- * load class Parse
- */
- include_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'Parse.php';
- class Summary extends Fixture {
- public static $countKey = "counts";
- public function doTable($table) {
- $this->summary[Summary::$countKey] = $this->counts;
- ksort($this->summary);
- $table->parts->more = $this->rows(array_keys($this->summary));
- }
- /**
- * @param array keys
- * @return Parse
- */
- protected function rows($keys) {
- if (count($keys) > 0) {
- $key = $keys[0];
- $obj = $this->summary[$key];
- if (is_string($obj))
- $str = $obj;
- else
- $str = $obj->toString();
- $td1 = $this->td($str, null);
- $td2 = $this->td($key, $td1);
- $result = $this->tr($td2, $this->rows(array_splice($keys, 1)));
- if ($key == self::$countKey) {
- $this->mark($result);
- }
- return $result;
- } else {
- return null;
- }
- }
- /**
- * @param Parse parts
- * @param Parse more
- * @return Parse
- */
- protected function tr($parts, $more) {
- return new Parse("tr", null, $parts, $more, true);
- }
- /**
- * @param string body
- * @param Parse more
- * @return Parse
- */
- protected function td($body, $more) {
- return new Parse("td", $this->infoS($body), null, $more, true);
- }
- /**
- * @param Parse row
- */
- protected function mark($row) {
- $official = $this->counts;
- $this->counts = new Counts();
- $cell = $row->parts->more;
- if (($official->wrong + $official->exceptions) > 0) {
- $this->wrong($cell);
- } else {
- $this->right($cell);
- }
- $this->counts = $official;
- }
- }
- ?>
Documentation generated on Sun, 02 Apr 2006 16:01:06 +0200 by phpDocumentor 1.3.0RC5