<commit_before><?php

/*
 * This file is part of the Medio project.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Gnugat\Medio\TwigExtension\Line;

use Gnugat\Medio\Model\Phpdoc\MethodPhpdoc;

class MethodPhpdocLineStrategy implements LineStrategy
{
    /**
     * {@inheritDoc}
     */
    public function supports($model)
    {
        return $model instanceof MethodPhpdoc;
    }

    /**
     * {@inheritDoc}
     */
    public function needsLineAfter($model, $block)
    {
        $hasApiTag = (null !== $model->getApiTag());
        $hasParameterTags = (!empty($model->getParameterTags()));
        $hasDescription = (null !== $model->getDescription());
        $hasDeprecationTag = (null !== $model->getDeprecationTag());
        if ('description' === $block) {
            return ($hasDescription && ($hasParameterTags || $hasApiTag || $hasDeprecationTag));
        }
        if ('parameter_tags' === $block) {
            return ($hasParameterTags && ($hasApiTag || $hasDeprecationTag));
        }
        if ('deprecation_tag' === $block) {
            return ($hasApiTag && $hasDeprecationTag);<commit_msg>Fixed test suite for PHP 5.3 and 5.4<commit_after><?php

/*
 * This file is part of the Medio project.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Gnugat\Medio\TwigExtension\Line;

use Gnugat\Medio\Model\Phpdoc\MethodPhpdoc;

class MethodPhpdocLineStrategy implements LineStrategy
{
    /**
     * {@inheritDoc}
     */
    public function supports($model)
    {
        return $model instanceof MethodPhpdoc;
    }

    /**
     * {@inheritDoc}
     */
    public function needsLineAfter($model, $block)
    {
        $parameterTags = $model->getParameterTags();

        $hasApiTag = (null !== $model->getApiTag());
        $hasParameterTags = (!empty($parameterTags));
        $hasDescription = (null !== $model->getDescription());
        $hasDeprecationTag = (null !== $model->getDeprecationTag());
        if ('description' === $block) {
            return ($hasDescription && ($hasParameterTags || $hasApiTag || $hasDeprecationTag));
        }
        if ('parameter_tags' === $block) {
            return ($hasParameterTags && ($hasApiTag || $hasDeprecationTag));
        }
        if ('deprecation_tag' === $block) {
            return ($hasApiTag && $hasDeprecationTag);
{'fraction_non_alphanumeric': 0.14504116032928263, 'fraction_numerical': 0.0015680125441003528, 'mean_word_length': 2.8902439024390243, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 17, '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': '1372272', 'n_tokens_mistral': 747, 'n_tokens_neox': 739, 'n_words': 176}