for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Axstrad\Bundle\ContentBundle\Renderer;
use Axstrad\Component\Content\Article;
/**
* Axstrad\Bundle\ContentBundle\Renderer\ContentRenderer
*/
class ContentRenderer
{
public function render($content)
$return = null;
switch (true) {
case $content instanceof Article:
$return = $this->renderContent($content);
break;
}
return $return;
public function renderContent(Article $article)
return sprintf(
'<h1>%s</h1>%s',
htmlspecialchars($article->getHeading()),
$article->getCopy()
);
public function renderHeading(Article $article)
'<h1>%s</h1>',
htmlspecialchars($article->getHeading())
public function renderCopy(Article $article)
return $article->getCopy();