Changeset 2849
- Timestamp:
- 11/23/08 20:29:23 (7 weeks ago)
- Files:
-
- 1 modified
-
trunk/htdocs/system/classes/bitmask.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/htdocs/system/classes/bitmask.php
r2848 r2849 38 38 break; 39 39 default: 40 if ( ! is_bool( $ flags) )40 if ( ! is_bool( $on ) ) 41 41 throw new InvalidArgumentException(_t('Bitmask values must be boolean')); 42 42 if( is_string( $bit ) ) { 43 $bit = array_search( $bit, $this-> value);43 $bit = array_search( $bit, $this->flags ); 44 44 } 45 if( !is_int( $bit ) )45 else if( ! is_int( $bit ) ) { 46 46 throw new InvalidArgumentException(_t('Bitmask names must be pre-defined strings or bitmask indexes')); 47 if( $on ) { 47 } 48 if ( $on ) { 48 49 $this->value |= pow( 2, $bit ); 49 50 } … … 59 60 * Magic getter method for flag status 60 61 * 61 * @param bit integer representing th emask bit to test62 * @param bit integer representing the mask bit to test 62 63 * @return boolean 63 64 */ 64 public function __get( $bi t) {65 public function __get( $bit ) { 65 66 if ( is_int( $bit ) ) { 66 67 $flags = array_values( $this->flags );
