Testing_FIT
[ class tree: Testing_FIT ] [ index: Testing_FIT ] [ all elements ]

Source for file Calculator.php

Documentation is available at Calculator.php

  1. <?php
  2.  
  3. include_once 'Testing/FIT/Fixture.php';
  4. include_once 'Testing/FIT/Fixture/Column.php';
  5.  
  6.  
  7. {
  8.  
  9.     protected $_typeDictionary = array(
  10.                                         'a'             => 'float',
  11.                                         'b'             => 'float',
  12.                                         'quotient()'    => 'float',
  13.                                         'sum()'         => 'float',
  14.                                         'sub()'         => 'float',
  15.                                     );
  16.  
  17.     public $a;
  18.     public $b;
  19.  
  20.     public function quotient({
  21.         if$this->b == 0 {
  22.             throw new Exception'division by zero' );
  23.         }
  24.         return $this->a / $this->b;
  25.     }
  26.  
  27.     public function sum({
  28.         return $this->a + $this->b;
  29.     }
  30.  
  31.     public function sub({
  32.         return $this->a - $this->b;
  33.     }
  34. }
  35.  
  36. ?>

Documentation generated on Mon, 11 Mar 2019 15:05:05 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.