ynloultratech /
graphql-bundle
| 1 | <?php |
||
| 2 | /******************************************************************************* |
||
| 3 | * This file is part of the GraphQL Bundle package. |
||
| 4 | * |
||
| 5 | * (c) YnloUltratech <[email protected]> |
||
| 6 | * |
||
| 7 | * For the full copyright and license information, please view the LICENSE |
||
| 8 | * file that was distributed with this source code. |
||
| 9 | ******************************************************************************/ |
||
| 10 | |||
| 11 | namespace Ynlo\GraphQLBundle\Behat\Gherkin; |
||
| 12 | |||
| 13 | use Behat\Gherkin\Node\PyStringNode; |
||
| 14 | use Symfony\Component\Yaml\Yaml; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Represents Gherkin PyString argument with YAML support |
||
| 18 | */ |
||
| 19 | class YamlStringNode extends PyStringNode |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * @var [] |
||
|
0 ignored issues
–
show
Documentation
Bug
introduced
by
Loading history...
|
|||
| 23 | */ |
||
| 24 | protected $array; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Initializes PyString. |
||
| 28 | * |
||
| 29 | * @param array $strings String in form of [$stringLine] |
||
| 30 | * @param integer $line Line number where string been started |
||
| 31 | */ |
||
| 32 | public function __construct(array $strings, $line) |
||
| 33 | { |
||
| 34 | parent::__construct($strings, $line); |
||
| 35 | |||
| 36 | $this->array = Yaml::parse($this->getRaw()); |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @return mixed |
||
| 41 | */ |
||
| 42 | public function toArray() |
||
| 43 | { |
||
| 44 | return $this->array; |
||
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @param mixed $array |
||
| 49 | */ |
||
| 50 | public function setArray($array): void |
||
| 51 | { |
||
| 52 | $this->array = $array; |
||
| 53 | } |
||
| 54 | } |
||
| 55 |