Advertisement
fruffl

Untitled

Sep 27th, 2013
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.32 KB | None | 0 0
  1.  
  2.         protected static function is($__is, $__optional, $__never, $__in)
  3.         {
  4.             $__in = static::request($__in);
  5.             if(FALSE === ($__is === ($__is & $__in)))
  6.             {
  7.                 return FALSE;
  8.             }
  9.                
  10.             foreach(ClsInf::constants(get_called_class()) as $k => $v)
  11.             {
  12.                 foreach((array) $__never as $group)
  13.                     if($v === ($v & $group) && $v === ($v & $__in))
  14.                     {
  15.                         print __str::TAB.__str::TAB.'EXIT '.$k.PHP_EOL;
  16.                         return FALSE;
  17.                     }
  18.                
  19.                 foreach((array) $__never as $group)
  20.                     if($v === ($v & $group) && $v === ($v & $__in))
  21.                     {
  22.                         print __str::TAB.__str::TAB.'OPTIONAL '.$k.PHP_EOL;
  23.                         return TRUE;
  24.                     }
  25.                
  26.             }
  27.            
  28.             return TRUE;
  29.         }
  30.  
  31.  
  32.         static function isObjectProperty($__request)
  33.         {
  34.             return static::is
  35.             (
  36.                 self::T_PAIR, // always base with sub
  37.                 self::T_P1_VAR|self::T_P1_ALIAS|self::T_P2_VAR|self::T_P2_ALIAS, // valid is ($?($?)base with ($?($?)sub
  38.                 self::T_FUNC|self::T_STATIC, // never base::sub or base::sub()
  39.                 $__request
  40.             );
  41.         }
  42.  
  43.         static function isStaticProperty($__request)
  44.         {
  45.             return static::is
  46.             (
  47.                 self::T_PAIR|self::T_STATIC, //  always base with sub, always base::sub
  48.                 self::T_P1_VAR|self::T_P1_ALIAS|self::T_P2_VAR|self::T_P2_ALIAS, // valid is ($?($?)base with ($?($?)sub
  49.                 self::T_FUNC, // never base::sub()
  50.                 $__request
  51.             );
  52.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement