for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Amock\Parser;
class ParserFactory
{
const TYPE_YAML = 'yaml';
public static function create(string $type): Parser
switch ($type) {
case static::TYPE_YAML:
return new YamlParser();
default:
throw new Exception\InvalidParserException($type);
}