Code Duplication    Length = 15-15 lines in 6 locations

plugins/actions/twitter/twitter.php 6 locations

@@ 808-822 (lines=15) @@
805
     * @internal param $int [optional] $count        Specifies the number of records to retrieve. May not be greater than 200.
806
     * @internal param $int [optional] $page            Specifies the page of results to retrieve.
807
     */
808
    public function statusesMentions($sinceId = null, $maxId = null, $count = null, $page = null)
809
    {
810
        // validate
811
        if ($count != null && $count > 200) throw new TwitterException('Count may not be greater than 200.');
812
813
        // build parameters
814
        $parameters = array();
815
        if ($sinceId != null) $parameters['since_id'] = (string)$sinceId;
816
        if ($maxId != null) $parameters['max_id'] = (string)$maxId;
817
        if ($count != null) $parameters['count'] = (int)$count;
818
        if ($page != null) $parameters['page'] = (int)$page;
819
820
        // make the call
821
        return (array)$this->doCall('statuses/mentions.json', $parameters);
822
    }
823
824
    /**
825
     * Returns the 20 most recent retweets posted by the authenticating user.
@@ 839-853 (lines=15) @@
836
     * @internal param $int [optional] $count        Specifies the number of records to retrieve. May not be greater than 200.
837
     * @internal param $int [optional] $page            Specifies the page of results to retrieve.
838
     */
839
    public function statusesRetweetedByMe($sinceId = null, $maxId = null, $count = null, $page = null)
840
    {
841
        // validate
842
        if ($count != null && $count > 200) throw new TwitterException('Count may not be greater than 200.');
843
844
        // build parameters
845
        $parameters = array();
846
        if ($sinceId != null) $parameters['since_id'] = (string)$sinceId;
847
        if ($maxId != null) $parameters['max_id'] = (string)$maxId;
848
        if ($count != null) $parameters['count'] = (int)$count;
849
        if ($page != null) $parameters['page'] = (int)$page;
850
851
        // make the call
852
        return (array)$this->doCall('statuses/retweeted_by_me.json', $parameters);
853
    }
854
855
    /**
856
     * Returns the 20 most recent retweets posted by the authenticating user's friends.
@@ 870-884 (lines=15) @@
867
     * @internal param $int [optional] $count        Specifies the number of records to retrieve. May not be greater than 200.
868
     * @internal param $int [optional] $page            Specifies the page of results to retrieve.
869
     */
870
    public function statusesRetweetedToMe($sinceId = null, $maxId = null, $count = null, $page = null)
871
    {
872
        // validate
873
        if ($count != null && $count > 200) throw new TwitterException('Count may not be greater than 200.');
874
875
        // build parameters
876
        $parameters = array();
877
        if ($sinceId != null) $parameters['since_id'] = (string)$sinceId;
878
        if ($maxId != null) $parameters['max_id'] = (string)$maxId;
879
        if ($count != null) $parameters['count'] = (int)$count;
880
        if ($page != null) $parameters['page'] = (int)$page;
881
882
        // make the call
883
        return (array)$this->doCall('statuses/retweeted_by_me.json', $parameters);
884
    }
885
886
887
    // Tweets resources
@@ 903-917 (lines=15) @@
900
     * @internal param $int [optional] $count        Specifies the number of records to retrieve. May not be greater than 200.
901
     * @internal param $int [optional] $page            Specifies the page of results to retrieve.
902
     */
903
    public function statusesReweetsOfMe($sinceId = null, $maxId = null, $count = null, $page = null)
904
    {
905
        // validate
906
        if ($count != null && $count > 200) throw new TwitterException('Count may not be greater than 200.');
907
908
        // build parameters
909
        $parameters = array();
910
        if ($sinceId != null) $parameters['since_id'] = (string)$sinceId;
911
        if ($maxId != null) $parameters['max_id'] = (string)$maxId;
912
        if ($count != null) $parameters['count'] = (int)$count;
913
        if ($page != null) $parameters['page'] = (int)$page;
914
915
        // make the call
916
        return (array)$this->doCall('statuses/retweets_of_me.json', $parameters);
917
    }
918
919
    /**
920
     * Returns a single status, specified by the id parameter below. The status's author will be returned inline.
@@ 1604-1618 (lines=15) @@
1601
     * @internal param $int [optional] $count        Specifies the number of records to retrieve. May not be greater than 200.
1602
     * @internal param $int [optional] $page            Specifies the page of results to retrieve.
1603
     */
1604
    public function directMessages($sinceId = null, $maxId = null, $count = null, $page = null)
1605
    {
1606
        // validate
1607
        if ($count != null && $count > 200) throw new TwitterException('Count may not be greater than 200.');
1608
1609
        // build parameters
1610
        $parameters = array();
1611
        if ($sinceId != null) $parameters['since_id'] = (string)$sinceId;
1612
        if ($maxId != null) $parameters['max_id'] = (string)$maxId;
1613
        if ($count != null) $parameters['count'] = (int)$count;
1614
        if ($page != null) $parameters['page'] = (int)$page;
1615
1616
        // make the call
1617
        return (array)$this->doCall('direct_messages.json', $parameters, true);
1618
    }
1619
1620
    /**
1621
     * Returns a list of the 20 most recent direct messages sent by the authenticating user.
@@ 1635-1649 (lines=15) @@
1632
     * @internal param $int [optional] $count        Specifies the number of records to retrieve. May not be greater than 200.
1633
     * @internal param $int [optional] $page            Specifies the page of results to retrieve.
1634
     */
1635
    public function directMessagesSent($sinceId = null, $maxId = null, $count = null, $page = null)
1636
    {
1637
        // validate
1638
        if ($count != null && $count > 200) throw new TwitterException('Count may not be greater than 200.');
1639
1640
        // build parameters
1641
        $parameters = array();
1642
        if ($sinceId != null) $parameters['since_id'] = (string)$sinceId;
1643
        if ($maxId != null) $parameters['max_id'] = (string)$maxId;
1644
        if ($count != null) $parameters['count'] = (int)$count;
1645
        if ($page != null) $parameters['page'] = (int)$page;
1646
1647
        // make the call
1648
        return (array)$this->doCall('direct_messages/sent.json', $parameters, true);
1649
    }
1650
1651
    /**
1652
     * Sends a new direct message to the specified user from the authenticating user.