Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit 6f69e43

Browse files
committed
CS fixes in Zend_Service_SlideShare
1 parent 4b8199a commit 6f69e43

File tree

1 file changed

+51
-41
lines changed

1 file changed

+51
-41
lines changed

library/Zend/Service/SlideShare.php

Lines changed: 51 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ class Zend_Service_SlideShare
128128
protected $_cacheobject;
129129

130130
/**
131-
* Sets the Zend_Http_Client object to use in requests. If not provided a default will
132-
* be used.
131+
* Sets the Zend_Http_Client object to use in requests. If not provided a
132+
* default will be used.
133133
*
134134
* @param Zend_Http_Client $client The HTTP client instance to use
135135
* @return Zend_Service_SlideShare
@@ -141,8 +141,8 @@ public function setHttpClient(Zend_Http_Client $client)
141141
}
142142

143143
/**
144-
* Returns the instance of the Zend_Http_Client which will be used. Creates an instance
145-
* of Zend_Http_Client if no previous client was set.
144+
* Returns the instance of the Zend_Http_Client which will be used. Creates
145+
* an instance of Zend_Http_Client if no previous client was set.
146146
*
147147
* @return Zend_Http_Client The HTTP client which will be used
148148
*/
@@ -179,9 +179,9 @@ public function setCacheObject(Zend_Cache_Core $cacheobject)
179179
}
180180

181181
/**
182-
* Gets the Zend_Cache object which will be used to cache API queries. If no cache object
183-
* was previously set the the default will be used (Filesystem caching in /tmp with a life
184-
* time of 43200 seconds)
182+
* Gets the Zend_Cache object which will be used to cache API queries. If no
183+
* cache object was previously set the the default will be used (Filesystem
184+
* caching in /tmp with a life time of 43200 seconds)
185185
*
186186
* @return Zend_Cache_Core The object used in caching
187187
*/
@@ -193,8 +193,8 @@ public function getCacheObject()
193193
'Core',
194194
'File',
195195
array(
196-
'lifetime' => 43200,
197-
'automatic_serialization' => true
196+
'lifetime' => 43200,
197+
'automatic_serialization' => true
198198
),
199199
array('cache_dir' => '/tmp')
200200
);
@@ -316,9 +316,15 @@ public function __construct(
316316
/**
317317
* Uploads the specified Slide show the the server
318318
*
319-
* @param Zend_Service_SlideShare_SlideShow $ss The slide show object representing the slide show to upload
320-
* @param boolean $makeSrcPublic Determines if the the slide show's source file is public or not upon upload
321-
* @return Zend_Service_SlideShare_SlideShow The passed Slide show object, with the new assigned ID provided
319+
* @param Zend_Service_SlideShare_SlideShow $ss The slide show
320+
* object representing the
321+
* slide show to upload
322+
* @param boolean $makeSrcPublic Determines if the slide
323+
* show's source file is public
324+
* or not upon upload
325+
* @return Zend_Service_SlideShare_SlideShow The passed Slide show object,
326+
* with the new assigned ID
327+
* provided
322328
* @throws Zend_Service_SlideShare_Exception
323329
*/
324330
public function uploadSlideShow(
@@ -383,11 +389,12 @@ public function uploadSlideShow(
383389

384390
if ($sxe->getName() == "SlideShareServiceError") {
385391
$message = (string)$sxe->Message[0];
386-
list($code, $error_str) = explode(':', $message);
392+
list($code, $errorStr) = explode(':', $message);
387393
require_once 'Zend/Service/SlideShare/Exception.php';
388-
throw new Zend_Service_SlideShare_Exception(trim(
389-
$error_str
390-
), $code);
394+
throw new Zend_Service_SlideShare_Exception(
395+
trim($errorStr),
396+
$code
397+
);
391398
}
392399

393400
if (!$sxe->getName() == "SlideShowUploaded") {
@@ -405,26 +412,25 @@ public function uploadSlideShow(
405412
/**
406413
* Retrieves a slide show's information based on slide show ID
407414
*
408-
* @param int $ss_id The slide show ID
415+
* @param int $ssId The slide show ID
409416
* @return Zend_Service_SlideShare_SlideShow the Slideshow object
410417
* @throws Zend_Service_SlideShare_Exception
411418
*/
412-
public function getSlideShow($ss_id)
419+
public function getSlideShow($ssId)
413420
{
414421
$timestamp = time();
415422

416423
$params = array(
417424
'api_key' => $this->getApiKey(),
418425
'ts' => $timestamp,
419426
'hash' => sha1($this->getSharedSecret() . $timestamp),
420-
'slideshow_id' => $ss_id
427+
'slideshow_id' => $ssId
421428
);
422429

423-
$cache = $this->getCacheObject();
424-
425-
$cache_key = md5("__zendslideshare_cache_$ss_id");
430+
$cache = $this->getCacheObject();
431+
$cacheKey = md5("__zendslideshare_cache_$ssId");
426432

427-
if (!$retval = $cache->load($cache_key)) {
433+
if (!$retval = $cache->load($cacheKey)) {
428434
$client = $this->getHttpClient();
429435

430436
$client->setUri(self::SERVICE_GET_SHOW_URI);
@@ -444,11 +450,12 @@ public function getSlideShow($ss_id)
444450

445451
if ($sxe->getName() == "SlideShareServiceError") {
446452
$message = (string)$sxe->Message[0];
447-
list($code, $error_str) = explode(':', $message);
453+
list($code, $errorStr) = explode(':', $message);
448454
require_once 'Zend/Service/SlideShare/Exception.php';
449-
throw new Zend_Service_SlideShare_Exception(trim(
450-
$error_str
451-
), $code);
455+
throw new Zend_Service_SlideShare_Exception(
456+
trim($errorStr),
457+
$code
458+
);
452459
}
453460

454461
if (!($sxe->getName() == 'Slideshow')) {
@@ -459,7 +466,7 @@ public function getSlideShow($ss_id)
459466
}
460467
$retval = $this->_slideShowNodeToObject(clone $sxe);
461468

462-
$cache->save($retval, $cache_key);
469+
$cache->save($retval, $cacheKey);
463470
}
464471

465472
return $retval;
@@ -529,7 +536,9 @@ public function getSlideShowsByGroup($group, $offset = null, $limit = null)
529536
* @return array An array of Zend_Service_SlideShare_SlideShow objects
530537
* @throws Zend_Service_SlideShare_Exception
531538
*/
532-
protected function _getSlideShowsByType($key, $value, $offset = null, $limit = null)
539+
protected function _getSlideShowsByType(
540+
$key, $value, $offset = null, $limit = null
541+
)
533542
{
534543
$key = strtolower($key);
535544

@@ -555,10 +564,12 @@ protected function _getSlideShowsByType($key, $value, $offset = null, $limit = n
555564

556565
$timestamp = time();
557566

558-
$params = array('api_key' => $this->getApiKey(),
559-
'ts' => $timestamp,
560-
'hash' => sha1($this->getSharedSecret().$timestamp),
561-
$key => $value);
567+
$params = array(
568+
'api_key' => $this->getApiKey(),
569+
'ts' => $timestamp,
570+
'hash' => sha1($this->getSharedSecret() . $timestamp),
571+
$key => $value
572+
);
562573

563574
if ($offset !== null) {
564575
$params['offset'] = (int)$offset;
@@ -568,11 +579,10 @@ protected function _getSlideShowsByType($key, $value, $offset = null, $limit = n
568579
$params['limit'] = (int)$limit;
569580
}
570581

571-
$cache = $this->getCacheObject();
572-
573-
$cache_key = md5($key.$value.$offset.$limit);
582+
$cache = $this->getCacheObject();
583+
$cacheKey = md5($key . $value . $offset . $limit);
574584

575-
if (!$retval = $cache->load($cache_key)) {
585+
if (!$retval = $cache->load($cacheKey)) {
576586
$client = $this->getHttpClient();
577587

578588
$client->setUri($queryUri);
@@ -592,10 +602,10 @@ protected function _getSlideShowsByType($key, $value, $offset = null, $limit = n
592602

593603
if ($sxe->getName() == "SlideShareServiceError") {
594604
$message = (string)$sxe->Message[0];
595-
list($code, $error_str) = explode(':', $message);
605+
list($code, $errorStr) = explode(':', $message);
596606
require_once 'Zend/Service/SlideShare/Exception.php';
597607
throw new Zend_Service_SlideShare_Exception(
598-
trim($error_str), $code
608+
trim($errorStr), $code
599609
);
600610
}
601611

@@ -614,7 +624,7 @@ protected function _getSlideShowsByType($key, $value, $offset = null, $limit = n
614624
}
615625
}
616626

617-
$cache->save($retval, $cache_key);
627+
$cache->save($retval, $cacheKey);
618628
}
619629

620630
return $retval;
@@ -633,7 +643,7 @@ protected function _getSlideShowsByType($key, $value, $offset = null, $limit = n
633643
protected function _slideShowNodeToObject(SimpleXMLElement $node)
634644
{
635645

636-
if($node->getName() == 'Slideshow') {
646+
if ($node->getName() == 'Slideshow') {
637647
$ss = new Zend_Service_SlideShare_SlideShow();
638648

639649
$ss->setId((string)$node->ID);

0 commit comments

Comments
 (0)