<commit_before><?php

namespace Blog\CoreBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;

/**
 * Class AuthorController
 */
class AuthorController extends Controller
{
    /**
     * @Route("/show")
     * @Template()
     */
    public function showAction()
    {
    }

}<commit_msg>added the author controller action<commit_after><?php

namespace Blog\CoreBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;

/**
 * Class AuthorController
 */
class AuthorController extends Controller
{
    /**
     * Show posts by author
     *
     * @param string $slug
     *
     * @throws NotFoundException
     * @return array
     *
     * @Route("/author/{slug}")
     * @Template()
     */
    public function showAction($slug)
    {
    	$author = $this->getDoctrine()->getRepository('ModelBundle:Author')->findOneBy(
    		array(
    			'slug' => $slug
    		)
    	);

    	if (null === $author) {
    		throw $this->createNotFoundException('Author was not found');
    	}

    	$author = $this->getDoctrine()->getRepository('ModelBundle:Post')->findBy(
    		array(
    			'author' => $author
    		)
    	);

    	return array(
    		'author' => $author,
    		'posts' => $posts
    	);
    }

}
{'fraction_non_alphanumeric': 0.13275517011340893, 'fraction_numerical': 0.0, 'mean_word_length': 3.0, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6955064', 'n_tokens_mistral': 454, 'n_tokens_neox': 455, 'n_words': 79}