Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merged from zf2/master
Browse files Browse the repository at this point in the history
  • Loading branch information
Show file tree
Hide file tree
Showing 115 changed files with 665 additions and 336 deletions.
4 changes: 2 additions & 2 deletions src/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @category Zend
* @package Zend_Feed
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -31,7 +31,7 @@
* @uses \Exception
* @category Zend
* @package Zend_Feed
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Exception extends \Exception
Expand Down
4 changes: 2 additions & 2 deletions src/PubSubHubbub/AbstractCallback.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @category Zend
* @package Zend_Feed_Pubsubhubbub
* @subpackage Callback
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -31,7 +31,7 @@
* @category Zend
* @package Zend_Feed_Pubsubhubbub
* @subpackage Callback
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
abstract class AbstractCallback implements Callback
Expand Down
4 changes: 2 additions & 2 deletions src/PubSubHubbub/Callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @category Zend
* @package Zend_Feed_Pubsubhubbub
* @subpackage Callback
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -28,7 +28,7 @@
* @category Zend
* @package Zend_Feed_Pubsubhubbub
* @subpackage Callback
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface Callback
Expand Down
4 changes: 2 additions & 2 deletions src/PubSubHubbub/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @category Zend
* @package Zend_Feed_Pubsubhubbub
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -27,7 +27,7 @@
* @uses \Exception
* @category Zend
* @package Zend_Feed_Pubsubhubbub
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Exception extends \Exception
Expand Down
4 changes: 2 additions & 2 deletions src/PubSubHubbub/HttpResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @category Zend
* @package Zend_Feed_Pubsubhubbub
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -28,7 +28,7 @@
* @uses \Zend\Feed\PubSubHubbub\Exception
* @category Zend
* @package Zend_Feed_Pubsubhubbub
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class HttpResponse
Expand Down
10 changes: 6 additions & 4 deletions src/PubSubHubbub/Model/AbstractModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @category Zend
* @package Zend_Feed_Pubsubhubbub
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -23,12 +23,14 @@
*/
namespace Zend\Feed\PubSubHubbub\Model;

use \Zend\Db\TableGateway;

/**
* @uses \Zend\Db\Table\Table
* @uses \Zend\Registry
* @category Zend
* @package Zend_Feed_Pubsubhubbub
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class AbstractModel
Expand All @@ -47,12 +49,12 @@ class AbstractModel
* @param \Zend\Db\Table\AbstractTable $tableGateway
* @return void
*/
public function __construct(\Zend\Db\Table\AbstractTable $tableGateway = null)
public function __construct(TableGateway\TableGatewayInterface $tableGateway = null)
{
if ($tableGateway === null) {
$parts = explode('\\', get_class($this));
$table = strtolower(array_pop($parts));
$this->_db = new \Zend\Db\Table\Table($table);
$this->_db = new TableGateway\TableGateway($table);
} else {
$this->_db = $tableGateway;
}
Expand Down
18 changes: 9 additions & 9 deletions src/PubSubHubbub/Model/Subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @category Zend
* @package Zend_Feed_Pubsubhubbub
* @subpackage Entity
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -34,7 +34,7 @@
* @category Zend
* @package Zend_Feed_Pubsubhubbub
* @subpackage Entity
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Subscription extends AbstractModel implements SubscriptionPersistence
Expand All @@ -53,7 +53,7 @@ public function setSubscription(array $data)
'ID must be set before attempting a save'
);
}
$result = $this->_db->find($data['id']);
$result = $this->_db->select(array('id' => $data['id']));
if ($result && (0 < count($result))) {
$data['created_time'] = $result->current()->created_time;
$now = new Date\Date;
Expand All @@ -65,7 +65,7 @@ public function setSubscription(array $data)
}
$this->_db->update(
$data,
$this->_db->getAdapter()->quoteInto('id = ?', $data['id'])
array('id' => $data['id'])
);
return false;
}
Expand All @@ -86,9 +86,9 @@ public function getSubscription($key)
throw new PubSubHubbub\Exception('Invalid parameter "key"'
.' of "' . $key . '" must be a non-empty string');
}
$result = $this->_db->find($key);
$result = $this->_db->select(array('id' => $key));
if (count($result)) {
return $result->current()->toArray();
return $result->current()->getArrayCopy();
}
return false;
}
Expand All @@ -105,7 +105,7 @@ public function hasSubscription($key)
throw new PubSubHubbub\Exception('Invalid parameter "key"'
.' of "' . $key . '" must be a non-empty string');
}
$result = $this->_db->find($key);
$result = $this->_db->select(array('id' => $key));
if (count($result)) {
return true;
}
Expand All @@ -120,10 +120,10 @@ public function hasSubscription($key)
*/
public function deleteSubscription($key)
{
$result = $this->_db->find($key);
$result = $this->_db->select(array('id' => $key));
if (count($result)) {
$this->_db->delete(
$this->_db->getAdapter()->quoteInto('id = ?', $key)
array('id' => $key)
);
return true;
}
Expand Down
4 changes: 2 additions & 2 deletions src/PubSubHubbub/Model/SubscriptionPersistence.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @category Zend
* @package Zend_Feed_Pubsubhubbub
* @subpackage Entity
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -28,7 +28,7 @@
* @category Zend
* @package Zend_Feed_Pubsubhubbub
* @subpackage Entity
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface SubscriptionPersistence
Expand Down
4 changes: 2 additions & 2 deletions src/PubSubHubbub/PubSubHubbub.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @category Zend
* @package Zend_Feed_Pubsubhubbub
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -29,7 +29,7 @@
/**
* @category Zend
* @package Zend_Feed_Pubsubhubbub
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class PubSubHubbub
Expand Down
8 changes: 4 additions & 4 deletions src/PubSubHubbub/Publisher.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @category Zend
* @package Zend_Feed_Pubsubhubbub
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -28,7 +28,7 @@
/**
* @category Zend
* @package Zend_Feed_Pubsubhubbub
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Publisher
Expand Down Expand Up @@ -384,7 +384,7 @@ public function getErrors()
protected function _getHttpClient()
{
$client = PubSubHubbub::getHttpClient();
$client->setMethod(\Zend\Http\Client::POST);
$client->setMethod(\Zend\Http\Request::METHOD_POST);
$client->setConfig(array(
'useragent' => 'Zend_Feed_Pubsubhubbub_Publisher/' . \Zend\Version::VERSION,
));
Expand All @@ -403,7 +403,7 @@ protected function _getHttpClient()
$params[] = urlencode($name) . '=' . urlencode($value);
}
$paramString = implode('&', $params);
$client->setRawData($paramString);
$client->setRawBody($paramString);
return $client;
}
}
6 changes: 3 additions & 3 deletions src/PubSubHubbub/Subscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @category Zend
* @package Zend_Feed_Pubsubhubbub
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -29,7 +29,7 @@
/**
* @category Zend
* @package Zend_Feed_Pubsubhubbub
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Subscriber
Expand Down Expand Up @@ -715,7 +715,7 @@ protected function _getRequestParameters($hubUrl, $mode)
$params['hub.callback'] = rtrim($this->getCallbackUrl(), '/')
. '/' . PubSubHubbub::urlencode($key);
}
if ($mode == 'subscribe' && !is_null($this->getLeaseSeconds())) {
if ($mode == 'subscribe' && $this->getLeaseSeconds() !== null) {
$params['hub.lease_seconds'] = $this->getLeaseSeconds();
}

Expand Down
6 changes: 3 additions & 3 deletions src/PubSubHubbub/Subscriber/Callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @category Zend
* @package Zend_Feed_Pubsubhubbub
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -29,7 +29,7 @@
/**
* @category Zend
* @package Zend_Feed_Pubsubhubbub
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Callback extends PubSubHubbub\AbstractCallback
Expand Down Expand Up @@ -199,7 +199,7 @@ public function setFeedUpdate($feed)
*/
public function hasFeedUpdate()
{
if (is_null($this->_feedUpdate)) {
if ($this->_feedUpdate === null) {
return false;
}
return true;
Expand Down
4 changes: 2 additions & 2 deletions src/Reader/AbstractEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @category Zend
* @package Zend_Feed_Reader
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -28,7 +28,7 @@
* @uses \Zend\Feed\Reader\Reader
* @category Zend
* @package Zend_Feed_Reader
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
abstract class AbstractEntry
Expand Down
4 changes: 2 additions & 2 deletions src/Reader/AbstractFeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @category Zend
* @package Zend_Feed_Reader
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -29,7 +29,7 @@
* @uses Zend\Feed\Reader\Feed
* @category Zend
* @package Zend_Feed_Reader
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
abstract class AbstractFeed implements Feed
Expand Down
4 changes: 2 additions & 2 deletions src/Reader/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @category Zend
* @package Zend_Feed_Reader
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -27,7 +27,7 @@
* @uses ArrayObject
* @category Zend
* @package Zend_Feed_Reader
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Collection extends \ArrayObject
Expand Down
4 changes: 2 additions & 2 deletions src/Reader/Collection/AbstractCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @category Zend
* @package Zend_Feed_Reader
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -26,7 +26,7 @@
/**
* @category Zend
* @package Zend_Feed_Reader
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
abstract class AbstractCollection extends \ArrayObject
Expand Down
Loading

0 comments on commit cccc24c

Please sign in to comment.