private function _processSwitchCase() {
		// If we already are in a "case", we remove it from the stack
		if ($this->statementStack->getCurrentStackItem()->type === StatementItem::TYPE_CASE || $this->statementStack->getCurrentStackItem()->type === StatementItem::TYPE_DEFAULT) {

			// Test if the previous case had a break
			$this->_checkSwitchCaseNeedBreak();

			$this->statementStack->pop();
		}

		// If the case arrives after the default
		$this->_checkSwitchDefaultOrder();

		// We store the control statement in the stack
		$stackitem = new StatementItem();
		$stackitem->line = $this->lineNumber;
		$stackitem->type = "CASE";
		$stackitem->name = "case";
		$this->statementStack->push($stackitem);

		// For this case
		$this->statementStack->getCurrentStackItem()->caseHasBreak = false;
		$this->statementStack->getCurrentStackItem()->caseStartLine = $this->lineNumber;

		// Check if the case is empty
		// We detect if the next valid token after ":" is another T_CASE
		$startPos = $this->tokenizer->findNextStringPosition(":", $this->tokenizer->getCurrentPosition());
		$this->statementStack->getCurrentStackItem()->caseIsEmpty = $this->tokenizer->checkNextValidToken(T_CASE, false, $startPos + 1) || $this->tokenizer->checkNextValidToken(T_DEFAULT, false, $startPos + 1);
	}
private function _processSwitchCase() {
		// If we already are in a "case", we remove it from the stack
		if ($this->statementStack->getCurrentStackItem()->type === StatementItem::TYPE_CASE || $this->statementStack->getCurrentStackItem()->type === StatementItem::TYPE_DEFAULT) {

			// Test if the previous case had a break
			$this->_checkSwitchCaseNeedBreak();

			$this->statementStack->pop();
		}

		// If the case arrives after the default
		$this->_checkSwitchDefaultOrder();

		// We store the control statement in the stack
		$stackitem = new StatementItem();
		$stackitem->line = $this->lineNumber;
		$stackitem->type = "CASE";
		$stackitem->name = "case";
		$this->statementStack->push($stackitem);

		// For this case
		$this->statementStack->getCurrentStackItem()->caseHasBreak = false;
		$this->statementStack->getCurrentStackItem()->caseStartLine = $this->lineNumber;

		// Check if the case is empty
		// We detect if the next valid token after ":" is another T_CASE
		$startPos = $this->tokenizer->findNextStringPosition(":", $this->tokenizer->getCurrentPosition());
		$this->statementStack->getCurrentStackItem()->caseIsEmpty = $this->tokenizer->checkNextValidToken(T_CASE, false, $startPos + 1) || $this->tokenizer->checkNextValidToken(T_DEFAULT, false, $startPos + 1);
	}
private function _processSwitchCase ( ) { // If we already are in a "case", we remove it from the stack if ( $ this -> statementStack -> getCurrentStackItem ( ) -> type === StatementItem :: TYPE_CASE || $ this -> statementStack -> getCurrentStackItem ( ) -> type === StatementItem :: TYPE_DEFAULT ) { // Test if the previous case had a break $ this -> _checkSwitchCaseNeedBreak ( ) ; $ this -> statementStack -> pop ( ) ; } // If the case arrives after the default $ this -> _checkSwitchDefaultOrder ( ) ; // We store the control statement in the stack $ stackitem = new StatementItem ( ) ; $ stackitem -> line = $ this -> lineNumber ; $ stackitem -> type = "CASE" ; $ stackitem -> name = "case" ; $ this -> statementStack -> push ( $ stackitem ) ; // For this case $ this -> statementStack -> getCurrentStackItem ( ) -> caseHasBreak = false ; $ this -> statementStack -> getCurrentStackItem ( ) -> caseStartLine = $ this -> lineNumber ; // Check if the case is empty // We detect if the next valid token after ":" is another T_CASE $ startPos = $ this -> tokenizer -> findNextStringPosition ( ":" , $ this -> tokenizer -> getCurrentPosition ( ) ) ; $ this -> statementStack -> getCurrentStackItem ( ) -> caseIsEmpty = $ this -> tokenizer -> checkNextValidToken ( T_CASE , false , $ startPos + 1 ) || $ this -> tokenizer -> checkNextValidToken ( T_DEFAULT , false , $ startPos + 1 ) ; }
Process a case statement.
Process a case statement .