Source for file PrimitiveFixture.php

Documentation is available at PrimitiveFixture.php

  1. <?php
  2.  
  3. # Copyright (c) 2002-2005 Cunningham & Cunningham, Inc.
  4. # Released under the terms of the GNU General Public License version 2 or later.
  5. #
  6. # PHP5 translation by Luis A. Floreani <luis.floreani@gmail.com>
  7.  
  8. /**
  9. * load class Fixture
  10. */
  11. include_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'Fixture.php';
  12.  
  13. class PrimitiveFixture extends Fixture {
  14.  
  15. /**
  16. * @param Parse cell
  17. * @return int
  18. */
  19. private function parseLong($cell) {
  20. if (strchr($cell->text(), '.') !== false)
  21. throw new Exception("NumberFormatException: For input string: \"" . $cell->text(). "\"");
  22. return (int)$cell->text();
  23. }
  24. /**
  25. * @param Parse cell
  26. * @param string/int value
  27. */
  28. public function check ($cell, $value) {
  29. if (is_numeric($value)) {
  30. if (is_int($value)) {
  31. if ($this->parseLong($cell) == $value) {
  32. $this->right($cell);
  33. } else {
  34. $this->wrong($cell, $value);
  35. }
  36. }
  37. }
  38. }
  39. }
  40.  
  41. ?>

Documentation generated on Sun, 02 Apr 2006 16:01:05 +0200 by phpDocumentor 1.3.0RC5