Code Duplication    Length = 9-11 lines in 2 locations

plugins/actions/twitter/plugins.php 2 locations

@@ 111-119 (lines=9) @@
108
     * @param object $parameters La référence qui vient d'être publiée
109
     * @return void
110
     */
111
    public function fireNewReference($parameters)
112
    {
113
        if (!defined('REFERENCES_TWITTER_PLUGIN_PATH')) {
114
            define('REFERENCES_TWITTER_PLUGIN_PATH', REFERENCES_PLUGINS_PATH . 'actions' . DIRECTORY_SEPARATOR . 'twitter' . DIRECTORY_SEPARATOR);
115
        }
116
        require_once REFERENCES_TWITTER_PLUGIN_PATH . 'config.php';
117
        $reference = $parameters['reference'];
118
        $this->sendTextToTwitter(utf8_encode($reference->getVar('article_title', 'n')), utf8_encode(REFERENCES_TWITTER_NEW_REFERENCE_INTRO), $reference->getUrl());
119
    }
120
121
    /**
122
     * Méthode appelée pour indiquer qu'une nouvelle catégorie de références a été créée
@@ 127-137 (lines=11) @@
124
     * @param object $parameters La catégorie qui vient d'être publiée
125
     * @return void
126
     */
127
    public function fireNewCategory($parameters)
128
    {
129
        if (!defined('REFERENCES_TWITTER_PLUGIN_PATH')) {
130
            define('REFERENCES_TWITTER_PLUGIN_PATH', REFERENCES_PLUGINS_PATH . 'actions' . DIRECTORY_SEPARATOR . 'twitter' . DIRECTORY_SEPARATOR);
131
        }
132
        require_once REFERENCES_TWITTER_PLUGIN_PATH . 'config.php';
133
        if (trim(REFERENCES_TWITTER_NEW_CATEGORY_INTRO) != '') {
134
            $category = $parameters['category'];
135
            $this->sendTextToTwitter(utf8_encode($category->getVar('category_title', 'n')), utf8_encode(REFERENCES_TWITTER_NEW_CATEGORY_INTRO), $category->getUrl());
136
        }
137
    }
138
}
139