This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/CssSelector/Token.php

50 lines
1.0 KiB
PHP

<?php
namespace Symfony\Component\CssSelector;
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* Token represents a CSS Selector token.
*
* This component is a port of the Python lxml library,
* which is copyright Infrae and distributed under the BSD license.
*
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
*/
class Token
{
protected $type;
protected $value;
protected $position;
public function __construct($type, $value, $position)
{
$this->type = $type;
$this->value = $value;
$this->position = $position;
}
public function __toString()
{
return (string) $this->value;
}
public function isType($type)
{
return $this->type == $type;
}
public function getPosition()
{
return $this->position;
}
}