1. <?php
  2. /**
  3.  * Copyright (c) 2007, Laurent Laville <pear@laurent-laville.org>
  4.  *
  5.  * All rights reserved.
  6.  *
  7.  * Redistribution and use in source and binary forms, with or without
  8.  * modification, are permitted provided that the following conditions
  9.  * are met:
  10.  *
  11.  *     * Redistributions of source code must retain the above copyright
  12.  *       notice, this list of conditions and the following disclaimer.
  13.  *     * Redistributions in binary form must reproduce the above copyright
  14.  *       notice, this list of conditions and the following disclaimer in the
  15.  *       documentation and/or other materials provided with the distribution.
  16.  *     * Neither the name of the authors nor the names of its contributors
  17.  *       may be used to endorse or promote products derived from this software
  18.  *       without specific prior written permission.
  19.  *
  20.  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  21.  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  22.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  23.  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
  24.  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  25.  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  26.  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  27.  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  28.  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  29.  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  30.  * POSSIBILITY OF SUCH DAMAGE.
  31.  *
  32.  * @category Web_Services
  33.  * @package  Services_W3C_CSSValidator
  34.  * @author   Laurent Laville <pear@laurent-laville.org>
  35.  * @license  http://www.opensource.org/licenses/bsd-license.php BSD
  36.  * @version  CVS: $id$
  37.  * @link     http://pear.php.net/package/Services_W3C_CSSValidator
  38.  * @since    File available since Release 0.1.0
  39.  */
  40.  
  41. /**
  42.  * Base class for a W3C CSS Validator Response.
  43.  *
  44.  * @category Web_Services
  45.  * @package  Services_W3C_CSSValidator
  46.  * @author   Laurent Laville <pear@laurent-laville.org>
  47.  * @license  http://www.opensource.org/licenses/bsd-license.php BSD
  48.  * @link     http://pear.php.net/package/Services_W3C_CSSValidator
  49.  * @since    Class available since Release 0.1.0
  50.  */
  51. class Services_W3C_CSSValidator_Response
  52. {
  53.     /**
  54.      * The address of the document validated. In EARL terms, this is
  55.      * the TestSubject.
  56.      *
  57.      * @var    string
  58.      * @since  0.1.0
  59.      * @access public
  60.      */
  61.     public $uri;
  62.  
  63.     /**
  64.      * Location of the service which provided the validation result. In EARL terms,
  65.      * this is the Assertor.
  66.      *
  67.      * @var    string
  68.      * @since  0.1.0
  69.      * @access public
  70.      */
  71.     public $checkedby;
  72.  
  73.     /**
  74.      * The CSS level (or profile) in use during the validation.
  75.      *
  76.      * @var    string
  77.      * @since  0.1.0
  78.      * @access public
  79.      */
  80.     public $csslevel;
  81.  
  82.     /**
  83.      * The actual date of the validation.
  84.      *
  85.      * @var    string
  86.      * @since  0.1.0
  87.      * @access public
  88.      */
  89.     public $date;
  90.  
  91.     /**
  92.      * Whether or not the document validated passed or not formal validation (boolean)
  93.      *
  94.      * @var    bool
  95.      * @since  0.1.0
  96.      * @access public
  97.      */
  98.     public $validity;
  99.  
  100.     /**
  101.      * Array of Services_W3C_CSSValidator_Error objects (if applicable)
  102.      *
  103.      * @var    array
  104.      * @since  0.1.0
  105.      * @access public
  106.      */
  107.     public $errors = array();
  108.  
  109.     /**
  110.      * Array of Services_W3C_CSSValidator_Warning objects (if applicable)
  111.      *
  112.      * @var    array
  113.      * @since  0.1.0
  114.      * @access public
  115.      */
  116.     public $warnings = array();
  117.  
  118.     /**
  119.      * Returns the validity of the checked document.
  120.      *
  121.      * @return bool
  122.      * @since  0.1.0
  123.      * @access public
  124.      */
  125.     public function isValid()
  126.     {
  127.         return $this->validity;
  128.     }
  129. }
  130. ?>