Location: PHPKode > scripts > ClassQL > maximebf-classql-b6f8b7d/libs/ClassQL/Parser/Contexts/Parameters.php
<?php
/**
 * ClassQL
 * Copyright (c) 2010 Maxime Bouroumeau-Fuseau
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 * @author Maxime Bouroumeau-Fuseau
 * @copyright 2010 (c) Maxime Bouroumeau-Fuseau
 * @license http://www.opensource.org/licenses/mit-license.php
 * @link http://github.com/maximebf/classql
 */
 
namespace ClassQL\Parser\Contexts;

use ClassQL\Parser\CatchAllContext;

class Parameters extends CatchAllContext
{
    /** @var string */
    protected $_paramName;
    
    public function tokenVariable($value)
    {
        if (!empty($this->_paramName)) {
            // only one variable possible
            $this->_syntaxError();
        }
        
        $this->_paramName = $value;
        $this->_value .= $value;
    }
    
    public function tokenArrayOpen()
    {
        $this->_value .= $this->enterContext('RewriteArray');
    }
    
    public function tokenComma()
    {
        $this->exitContext(array_merge(
            array($this->_paramName => trim($this->_value)), 
            $this->enterContext('Parameters')
        ));
    }
    
    public function tokenParenthClose()
    {
        $this->exitContext(array($this->_paramName => trim($this->_value)));
    }
}
Return current item: ClassQL