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

Commit

Permalink
Merge branch 'cs/remove-underscores' of https://github.com/arse/zf2 i…
Browse files Browse the repository at this point in the history
…nto feature/protected-underscores

Conflicts:
	library/Zend/Console/Getopt.php
  • Loading branch information
Show file tree
Hide file tree
Showing 35 changed files with 675 additions and 675 deletions.
24 changes: 12 additions & 12 deletions src/PubSubHubbub/AbstractCallback.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ abstract class AbstractCallback implements CallbackInterface
*
* @var Model\SubscriptionPersistenceInterface
*/
protected $_storage = null;
protected $storage = null;

/**
* An instance of a class handling Http Responses. This is implemented in
Expand All @@ -37,14 +37,14 @@ abstract class AbstractCallback implements CallbackInterface
*
* @var HttpResponse|PhpResponse
*/
protected $_httpResponse = null;
protected $httpResponse = null;

/**
* The number of Subscribers for which any updates are on behalf of.
*
* @var int
*/
protected $_subscriberCount = 1;
protected $subscriberCount = 1;

/**
* Constructor; accepts an array or Traversable object to preset
Expand Down Expand Up @@ -111,7 +111,7 @@ public function sendResponse()
*/
public function setStorage(Model\SubscriptionPersistenceInterface $storage)
{
$this->_storage = $storage;
$this->storage = $storage;
return $this;
}

Expand All @@ -125,11 +125,11 @@ public function setStorage(Model\SubscriptionPersistenceInterface $storage)
*/
public function getStorage()
{
if ($this->_storage === null) {
if ($this->storage === null) {
throw new Exception\RuntimeException('No storage object has been'
. ' set that subclasses Zend\Feed\Pubsubhubbub\Model\SubscriptionPersistence');
}
return $this->_storage;
return $this->storage;
}

/**
Expand All @@ -148,7 +148,7 @@ public function setHttpResponse($httpResponse)
. ' implement one of Zend\Feed\Pubsubhubbub\HttpResponse or'
. ' Zend\Http\PhpEnvironment\Response');
}
$this->_httpResponse = $httpResponse;
$this->httpResponse = $httpResponse;
return $this;
}

Expand All @@ -161,10 +161,10 @@ public function setHttpResponse($httpResponse)
*/
public function getHttpResponse()
{
if ($this->_httpResponse === null) {
$this->_httpResponse = new HttpResponse;
if ($this->httpResponse === null) {
$this->httpResponse = new HttpResponse;
}
return $this->_httpResponse;
return $this->httpResponse;
}

/**
Expand All @@ -183,7 +183,7 @@ public function setSubscriberCount($count)
throw new Exception\InvalidArgumentException('Subscriber count must be'
. ' greater than zero');
}
$this->_subscriberCount = $count;
$this->subscriberCount = $count;
return $this;
}

Expand All @@ -195,7 +195,7 @@ public function setSubscriberCount($count)
*/
public function getSubscriberCount()
{
return $this->_subscriberCount;
return $this->subscriberCount;
}

/**
Expand Down
18 changes: 9 additions & 9 deletions src/PubSubHubbub/HttpResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class HttpResponse
*
* @var array
*/
protected $_headers = array();
protected $headers = array();

/**
* HTTP response code to use in headers
Expand Down Expand Up @@ -58,13 +58,13 @@ public function send()
*/
public function sendHeaders()
{
if (count($this->_headers) || (200 != $this->statusCode)) {
if (count($this->headers) || (200 != $this->statusCode)) {
$this->canSendHeaders(true);
} elseif (200 == $this->statusCode) {
return;
}
$httpCodeSent = false;
foreach ($this->_headers as $header) {
foreach ($this->headers as $header) {
if (!$httpCodeSent && $this->statusCode) {
header($header['name'] . ': ' . $header['value'], $header['replace'], $this->statusCode);
$httpCodeSent = true;
Expand Down Expand Up @@ -94,13 +94,13 @@ public function setHeader($name, $value, $replace = false)
$name = $this->_normalizeHeader($name);
$value = (string) $value;
if ($replace) {
foreach ($this->_headers as $key => $header) {
foreach ($this->headers as $key => $header) {
if ($name == $header['name']) {
unset($this->_headers[$key]);
unset($this->headers[$key]);
}
}
}
$this->_headers[] = array(
$this->headers[] = array(
'name' => $name,
'value' => $value,
'replace' => $replace,
Expand All @@ -118,21 +118,21 @@ public function setHeader($name, $value, $replace = false)
public function getHeader($name)
{
$name = $this->_normalizeHeader($name);
foreach ($this->_headers as $header) {
foreach ($this->headers as $header) {
if ($header['name'] == $name) {
return $header['value'];
}
}
}

/**
* Return array of headers; see {@link $_headers} for format
* Return array of headers; see {@link $headers} for format
*
* @return array
*/
public function getHeaders()
{
return $this->_headers;
return $this->headers;
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/PubSubHubbub/Model/AbstractModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class AbstractModel
*
* @var TableGatewayInterface
*/
protected $_db = null;
protected $db = null;

/**
* Constructor
Expand All @@ -36,9 +36,9 @@ public function __construct(TableGatewayInterface $tableGateway = null)
if ($tableGateway === null) {
$parts = explode('\\', get_called_class());
$table = strtolower(array_pop($parts));
$this->_db = new TableGateway($table, null);
$this->db = new TableGateway($table, null);
} else {
$this->_db = $tableGateway;
$this->db = $tableGateway;
}
}
}
14 changes: 7 additions & 7 deletions src/PubSubHubbub/Model/Subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function setSubscription(array $data)
'ID must be set before attempting a save'
);
}
$result = $this->_db->select(array('id' => $data['id']));
$result = $this->db->select(array('id' => $data['id']));
if ($result && (0 < count($result))) {
$data['created_time'] = $result->current()->created_time;
$now = $this->getNow();
Expand All @@ -52,14 +52,14 @@ public function setSubscription(array $data)
$data['expiration_time'] = $now->add(new DateInterval('PT' . $data['lease_seconds'] . 'S'))
->format('Y-m-d H:i:s');
}
$this->_db->update(
$this->db->update(
$data,
array('id' => $data['id'])
);
return false;
}

$this->_db->insert($data);
$this->db->insert($data);
return true;
}

Expand All @@ -76,7 +76,7 @@ public function getSubscription($key)
throw new PubSubHubbub\Exception\InvalidArgumentException('Invalid parameter "key"'
.' of "' . $key . '" must be a non-empty string');
}
$result = $this->_db->select(array('id' => $key));
$result = $this->db->select(array('id' => $key));
if (count($result)) {
return $result->current()->getArrayCopy();
}
Expand All @@ -96,7 +96,7 @@ public function hasSubscription($key)
throw new PubSubHubbub\Exception\InvalidArgumentException('Invalid parameter "key"'
.' of "' . $key . '" must be a non-empty string');
}
$result = $this->_db->select(array('id' => $key));
$result = $this->db->select(array('id' => $key));
if (count($result)) {
return true;
}
Expand All @@ -111,9 +111,9 @@ public function hasSubscription($key)
*/
public function deleteSubscription($key)
{
$result = $this->_db->select(array('id' => $key));
$result = $this->db->select(array('id' => $key));
if (count($result)) {
$this->_db->delete(
$this->db->delete(
array('id' => $key)
);
return true;
Expand Down
44 changes: 22 additions & 22 deletions src/PubSubHubbub/Publisher.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,31 +28,31 @@ class Publisher
*
* @var array
*/
protected $_hubUrls = array();
protected $hubUrls = array();

/**
* An array of topic (Atom or RSS feed) URLs which have been updated and
* whose updated status will be notified to all Hub Servers.
*
* @var array
*/
protected $_updatedTopicUrls = array();
protected $updatedTopicUrls = array();

/**
* An array of any errors including keys for 'response', 'hubUrl'.
* The response is the actual Zend_Http_Response object.
*
* @var array
*/
protected $_errors = array();
protected $errors = array();

/**
* An array of topic (Atom or RSS feed) URLs which have been updated and
* whose updated status will be notified to all Hub Servers.
*
* @var array
*/
protected $_parameters = array();
protected $parameters = array();

/**
* Constructor; accepts an array or Zend_Config instance to preset
Expand Down Expand Up @@ -111,7 +111,7 @@ public function addHubUrl($url)
.' of "' . $url . '" must be a non-empty string and a valid'
.'URL');
}
$this->_hubUrls[] = $url;
$this->hubUrls[] = $url;
return $this;
}

Expand Down Expand Up @@ -140,8 +140,8 @@ public function removeHubUrl($url)
if (!in_array($url, $this->getHubUrls())) {
return $this;
}
$key = array_search($url, $this->_hubUrls);
unset($this->_hubUrls[$key]);
$key = array_search($url, $this->hubUrls);
unset($this->hubUrls[$key]);
return $this;
}

Expand All @@ -152,8 +152,8 @@ public function removeHubUrl($url)
*/
public function getHubUrls()
{
$this->_hubUrls = array_unique($this->_hubUrls);
return $this->_hubUrls;
$this->hubUrls = array_unique($this->hubUrls);
return $this->hubUrls;
}

/**
Expand All @@ -170,7 +170,7 @@ public function addUpdatedTopicUrl($url)
.' of "' . $url . '" must be a non-empty string and a valid'
.'URL');
}
$this->_updatedTopicUrls[] = $url;
$this->updatedTopicUrls[] = $url;
return $this;
}

Expand Down Expand Up @@ -199,8 +199,8 @@ public function removeUpdatedTopicUrl($url)
if (!in_array($url, $this->getUpdatedTopicUrls())) {
return $this;
}
$key = array_search($url, $this->_updatedTopicUrls);
unset($this->_updatedTopicUrls[$key]);
$key = array_search($url, $this->updatedTopicUrls);
unset($this->updatedTopicUrls[$key]);
return $this;
}

Expand All @@ -211,8 +211,8 @@ public function removeUpdatedTopicUrl($url)
*/
public function getUpdatedTopicUrls()
{
$this->_updatedTopicUrls = array_unique($this->_updatedTopicUrls);
return $this->_updatedTopicUrls;
$this->updatedTopicUrls = array_unique($this->updatedTopicUrls);
return $this->updatedTopicUrls;
}

/**
Expand Down Expand Up @@ -260,12 +260,12 @@ public function notifyAll()
throw new Exception\RuntimeException('No Hub Server URLs'
. ' have been set so no notifications can be sent');
}
$this->_errors = array();
$this->errors = array();
foreach ($hubs as $url) {
$client->setUri($url);
$response = $client->getResponse();
if ($response->getStatusCode() !== 204) {
$this->_errors[] = array(
$this->errors[] = array(
'response' => $response,
'hubUrl' => $url
);
Expand Down Expand Up @@ -299,7 +299,7 @@ public function setParameter($name, $value = null)
throw new Exception\InvalidArgumentException('Invalid parameter "value"'
.' of "' . $value . '" must be a non-empty string');
}
$this->_parameters[$name] = $value;
$this->parameters[$name] = $value;
return $this;
}

Expand Down Expand Up @@ -330,8 +330,8 @@ public function removeParameter($name)
throw new Exception\InvalidArgumentException('Invalid parameter "name"'
.' of "' . $name . '" must be a non-empty string');
}
if (array_key_exists($name, $this->_parameters)) {
unset($this->_parameters[$name]);
if (array_key_exists($name, $this->parameters)) {
unset($this->parameters[$name]);
}
return $this;
}
Expand All @@ -343,7 +343,7 @@ public function removeParameter($name)
*/
public function getParameters()
{
return $this->_parameters;
return $this->parameters;
}

/**
Expand All @@ -354,7 +354,7 @@ public function getParameters()
*/
public function isSuccess()
{
return !(count($this->_errors) != 0);
return !(count($this->errors) != 0);
}

/**
Expand All @@ -366,7 +366,7 @@ public function isSuccess()
*/
public function getErrors()
{
return $this->_errors;
return $this->errors;
}

/**
Expand Down
Loading

0 comments on commit 2e7e2e2

Please sign in to comment.