/var/www/vhosts/nabawater/vendor/2amigos/qrcode-library/src/Factory
Edit: /var/www/vhosts/nabawater/vendor/2amigos/qrcode-library/src/Factory/WriterFactory.php (1083B)
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Da\QrCode\Factory;
use Da\QrCode\Contracts\WriterInterface;
use Da\QrCode\Exception\UnknownWriterException;
use Da\QrCode\Writer\EpsWriter;
use Da\QrCode\Writer\JpgWriter;
use Da\QrCode\Writer\PngWriter;
use Da\QrCode\Writer\SvgWriter;
class WriterFactory
{
protected static $map = [
'eps' => EpsWriter::class,
'jpg' => JpgWriter::class,
'png' => PngWriter::class,
'svg' => SvgWriter::class
];
/**
* @param string $name
*
* @throws UnknownWriterException
* @return WriterInterface
*/
public static function fromName(string $name): WriterInterface
{
if (!array_key_exists($name, self::$map)) {
throw new UnknownWriterException(sprintf('Unknown writer name "%s"', $name));
}
return new self::$map[$name];
}
}