svn: /pear/packages/Services_Twitter/trunk/ Services/Twitter.php tests/setup.php

From: Date: Wed, 30 Dec 2009 16:39:02 +0000
Subject: svn: /pear/packages/Services_Twitter/trunk/ Services/Twitter.php tests/setup.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-58415@lists.php.net to get a copy of this message
izi Wed, 30 Dec 2009 16:39:02 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=292815 Log: Some CS fixes Changed paths: U pear/packages/Services_Twitter/trunk/Services/Twitter.php U pear/packages/Services_Twitter/trunk/tests/setup.php Modified: pear/packages/Services_Twitter/trunk/Services/Twitter.php =================================================================== --- pear/packages/Services_Twitter/trunk/Services/Twitter.php 2009-12-30 15:16:33 UTC (rev 292814) +++ pear/packages/Services_Twitter/trunk/Services/Twitter.php 2009-12-30 16:39:02 UTC (rev 292815) @@ -69,6 +69,7 @@ * } * * </code> + * * @category Services * @package Services_Twitter * @author Joe Stump <joe@joestump.net> @@ -309,8 +310,8 @@ $this->currentCategory = null; // prepare the request - list($uri, $method, $params, $files) = - $this->prepareRequest($ep, $args, $cat); + list($uri, $method, $params, $files) + = $this->prepareRequest($ep, $args, $cat); // we can now send our request if ($this->oauth instanceof HTTP_OAuth_Consumer) { @@ -350,8 +351,8 @@ * * @param string $uri The full URI of the endpoint * @param string $method GET or POST - * @param array $params Array of additional parameter - * @param array $files Array of files to upload + * @param array $params Array of additional parameter + * @param array $files Array of files to upload * * @throws Services_Twitter_Exception on failure * @return HTTP_Request2_Response @@ -592,8 +593,11 @@ // check if we have is a search or trends call, in this case the base // uri is different - if ($cat == 'search' || (string)$endpoint['name'] == 'search' || - $cat == 'trends' || (string)$endpoint['name'] == 'trends') { + if ( $cat == 'search' + || (string)$endpoint['name'] == 'search' + || $cat == 'trends' + || (string)$endpoint['name'] == 'trends' + ) { $uri = self::$searchUri; } else { $uri = self::$uri; @@ -629,8 +633,10 @@ $path ); } - if ($minargs && (!isset($args[0]) || - is_array($args[0]) && $minargs > count($args[0]))) { + if ( $minargs && (!isset($args[0]) + || is_array($args[0]) + && $minargs > count($args[0])) + ) { throw new Services_Twitter_Exception( 'Not enough arguments for ' . $path, self::ERROR_PARAMS, @@ -699,8 +705,8 @@ * @return object Instance of SimpleXMLElement */ protected function sendRequest($uri, $method = 'GET', array $args = array(), - array $files = array()) - { + array $files = array() + ) { try { $request = clone $this->getRequest(); $request->setMethod($method); @@ -839,16 +845,19 @@ */ protected function isUtf8($str) { - return (bool)preg_match('%^(?: - [\x09\x0A\x0D\x20-\x7E] # ASCII - | [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte - | \xE0[\xA0-\xBF][\x80-\xBF] # excluding overlongs - | [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} # straight 3-byte - | \xED[\x80-\x9F][\x80-\xBF] # excluding surrogates - | \xF0[\x90-\xBF][\x80-\xBF]{2} # planes 1-3 - | [\xF1-\xF3][\x80-\xBF]{3} # planes 4-15 - | \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16 - )*$%xs', $str); + return (bool)preg_match( + '%^(?: + [\x09\x0A\x0D\x20-\x7E] # ASCII + | [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte + | \xE0[\xA0-\xBF][\x80-\xBF] # excluding overlongs + | [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} # straight 3-byte + | \xED[\x80-\x9F][\x80-\xBF] # excluding surrogates + | \xF0[\x90-\xBF][\x80-\xBF]{2} # planes 1-3 + | [\xF1-\xF3][\x80-\xBF]{3} # planes 4-15 + | \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16 + )*$%xs', + $str + ); } // }}} Modified: pear/packages/Services_Twitter/trunk/tests/setup.php =================================================================== --- pear/packages/Services_Twitter/trunk/tests/setup.php 2009-12-30 15:16:33 UTC (rev 292814) +++ pear/packages/Services_Twitter/trunk/tests/setup.php 2009-12-30 16:39:02 UTC (rev 292815) @@ -61,7 +61,10 @@ if (!$config['live_test']) { if ($ep == 'exception1') { $resp = new HTTP_Request2_Response('HTTP/1.1 401 Unauthorized', false); - $resp->appendBody('{"request":"\/statuses\/friends_timeline.json","error":"Could not authenticate you."}'); + $resp->appendBody( + '{"request":"\/statuses\/friends_timeline.json", ' + . '"error":"Could not authenticate you."}' + ); } else if ($ep == 'exception2') { $resp = new HTTP_Request2_Response('HTTP/1.1 404 Not Found', false); } else {

« previous php.pear.cvs (#58415) next »