for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the takeit/AmpHtmlBundle package.
*
* (c) Rafał Muszyński <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Takeit\Bundle\AmpHtmlBundle\Converter;
use Lullabot\AMP\Validate\Scope;
use Lullabot\AMP\AMP;
/**
* HTML to AMP HTML converter.
* @author Rafał Muszyński <[email protected]>
class LullabotAmpConverter implements AmpConverterInterface
{
* @var AMP
private $ampConverter;
* @param AMP $ampConverter
public function __construct(AMP $ampConverter)
$this->ampConverter = $ampConverter;
}
* {@inheritdoc}
public function convertToAmp($html)
$this->ampConverter->loadHtml($html, ['scope' => Scope::HTML_SCOPE]);
return $this->ampConverter->convertToAmpHtml();