Nelmio\Alice\FixtureBuilder\Denormalizer\FlagParserInterface::parse PHP Method

parse() public method

Parses a string element to extract the flags from it.
public parse ( string $element ) : FlagBag
$element string e.g. 'user0 (dummy_flag, another_flag)'
return Nelmio\Alice\Definition\FlagBag
    public function parse(string $element) : FlagBag;

Usage Example

Example #1
0
 /**
  * @inheritdoc
  */
 public function denormalize(FixtureBag $builtFixtures, string $className, string $unparsedFixtureId, array $specs, FlagBag $flags) : FixtureBag
 {
     if (null === $this->flagParser) {
         throw FlagParserExceptionFactory::createForExpectedMethodToBeCalledIfHasAParser(__METHOD__);
     }
     $idFlags = $this->flagParser->parse($unparsedFixtureId);
     $fixture = new SimpleFixture($idFlags->getKey(), $className, new SpecificationBag(null, new PropertyBag(), new MethodCallBag()));
     $fixture = $fixture->withSpecs($this->specsDenormalizer->denormalize($fixture, $this->flagParser, $specs));
     return $builtFixtures->with(new TemplatingFixture(new SimpleFixtureWithFlags($fixture, $idFlags->mergeWith($flags))));
 }
All Usage Examples Of Nelmio\Alice\FixtureBuilder\Denormalizer\FlagParserInterface::parse
FlagParserInterface