Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
3 / 3
CRAP
100.00% covered (success)
100.00%
4 / 4
LiteralStep
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
3 / 3
3
100.00% covered (success)
100.00%
4 / 4
 __construct
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 __toString
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 expect
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
<?php
/**
 * Copyright (c) Tony Bogdanov <tonybogdanov@gmail.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace DataTraveller\Path\Step;
/**
 * Class LiteralStep
 *
 * @package DataTraveller\Path\Step
 * @author TonyBogdanov <tonybogdanov@gmail.com>
 */
class LiteralStep implements StepInterface {
    /**
     * @var string
     */
    protected $value;
    /**
     * LiteralStep constructor.
     *
     * @param string $value
     */
    public function __construct( string $value ) {
        $this->value = $value;
    }
    /**
     * @return string
     */
    public function __toString(): string {
        return $this->value;
    }
    /**
     * @param string $key
     *
     * @return bool
     */
    public function expect( string $key ): bool {
        return $key === $this->value;
    }
}