<commit_before><?php

/*
 * This file is part of the WPFoundation library.
 *
 * Copyright (c) 2015-2016 LIN3S <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace LIN3S\WPFoundation\PostTypes;

/**
 * Abstract class of base post type that implements the interface.
 * This class avoids the redundant task of create the same PostType constructor.
 * Also, it comes with basic implementation of "permalink" method.
 *
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 */
abstract class PostType implements PostTypeInterface
{
    /**
     * Constructor.
     */
    public function __construct()
    {
        add_action('init', [$this, 'postType']);
        add_action('init', [$this, 'taxonomyType']);
        add_action('init', [$this, 'fields'], 20);

        add_filter('post_type_link', [$this, 'permalink'], 1, 2);
        add_filter('term_link', [$this, 'taxonomyPermalink'], 1, 2);
    }

    /**
     * {@inheritdoc}
     */
    public function fields()
    {
    }

    /**<commit_msg>Made call inside posttype constructor to rewriteRules method<commit_after><?php

/*
 * This file is part of the WPFoundation library.
 *
 * Copyright (c) 2015-2016 LIN3S <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace LIN3S\WPFoundation\PostTypes;

/**
 * Abstract class of base post type that implements the interface.
 * This class avoids the redundant task of create the same PostType constructor.
 * Also, it comes with basic implementation of "permalink" method.
 *
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>.<EMAIL>>
 */
abstract class PostType implements PostTypeInterface
{
    /**
     * Constructor.
     */
    public function __construct()
    {
        add_action('init', [$this, 'postType']);
        add_action('init', [$this, 'taxonomyType']);
        add_action('init', [$this, 'fields'], 20);
        add_action('init', [$this, 'rewriteRules'], 20);

        add_filter('post_type_link', [$this, 'permalink'], 1, 2);
        add_filter('term_link', [$this, 'taxonomyPermalink'], 1, 2);
    }

    /**
     * {@inheritdoc}
     */
    public function fields()
    {
    }

    /**
{'fraction_non_alphanumeric': 0.13793103448275862, 'fraction_numerical': 0.014655172413793103, 'mean_word_length': 3.1971066907775767, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 20, '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': '5207999', 'n_tokens_mistral': 725, 'n_tokens_neox': 677, 'n_words': 221}