1<?php 2/** 3 * File containing the ezcConsoleStatusbarOptions class. 4 * 5 * @package ConsoleTools 6 * @version 1.6.1 7 * @copyright Copyright (C) 2005-2010 eZ Systems AS. All rights reserved. 8 * @license http://ez.no/licenses/new_bsd New BSD License 9 * @filesource 10 */ 11 12/** 13 * Struct class to store the options of the ezcConsoleOutput class. 14 * This class stores the options for the {@link ezcConsoleOutput} class. 15 * 16 * @property string $successChar 17 * The char shown for a succeeded status. 18 * @property string $failureChar 19 * The char shown for a failed status. 20 * 21 * @package ConsoleTools 22 * @version 1.6.1 23 */ 24class ezcConsoleStatusbarOptions extends ezcBaseOptions 25{ 26 protected $properties = array( 27 'successChar' => "+", 28 'failureChar' => "-", 29 ); 30 31 /** 32 * Option write access. 33 * 34 * @throws ezcBasePropertyNotFoundException 35 * If a desired property could not be found. 36 * @throws ezcBaseValueException 37 * If a desired property value is out of range. 38 * 39 * @param string $key Name of the property. 40 * @param mixed $value The value for the property. 41 * @ignore 42 */ 43 public function __set( $key, $value ) 44 { 45 switch ( $key ) 46 { 47 case "successChar": 48 case "failureChar": 49 if ( is_string( $value ) === false || strlen( $value ) < 1 ) 50 { 51 throw new ezcBaseValueException( $key, $value, 'string, not empty' ); 52 } 53 break; 54 default: 55 throw new ezcBasePropertyNotFoundException( $key ); 56 } 57 $this->properties[$key] = $value; 58 } 59} 60 61?> 62