phplinter\Tokenizer::meaningfull PHP Method

meaningfull() public static method

----------------------------------------------------------------------+
public static meaningfull ( $token ) : Bool
return Bool ----------------------------------------------------------------------+
    public static function meaningfull($token)
    {
        switch ($token) {
            case T_WHITESPACE:
            case T_NEWLINE:
            case T_COMMENT:
            case T_DOC_COMMENT:
            case T_IGNORE:
                return false;
            default:
                return true;
        }
    }

Usage Example

Example #1
0
 /**
 ----------------------------------------------------------------------+
 * Return the previous meaningfull token
 * @param	int	current position
 * @return	Int
 ----------------------------------------------------------------------+
 */
 protected function prev($pos)
 {
     $i = $pos;
     $o = $this->node->tokens;
     $c = $this->node->start;
     while (--$i > $c) {
         if (\phplinter\Tokenizer::meaningfull($o[$i][0])) {
             return $i;
         }
     }
     return false;
 }