From b822149d434d12c14ffaa49e3f987d844b906116 Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Thu, 10 Jan 2013 13:51:31 -0500 Subject: [PATCH] Style adjustments to VuFindHttp module. --- module/VuFindHttp/Module.php | 8 ++--- .../VuFindHttp/src/VuFindHttp/HttpService.php | 33 +++++++++++-------- .../VuFindHttp/HttpServiceAwareInterface.php | 8 ++--- .../src/VuFindHttp/HttpServiceInterface.php | 16 +++++---- 4 files changed, 38 insertions(+), 27 deletions(-) diff --git a/module/VuFindHttp/Module.php b/module/VuFindHttp/Module.php index 472f3c95c77..dae38443895 100644 --- a/module/VuFindHttp/Module.php +++ b/module/VuFindHttp/Module.php @@ -20,8 +20,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * @category Proxy - * @package Service + * @category VuFind2 + * @package Http * @author David Maus <maus@hab.de> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://github.com/dmj/vf2-proxy @@ -32,8 +32,8 @@ namespace VuFindHttp; /** * ZF2 module definition for the VF2 HTTP service. * - * @category Proxy - * @package Service + * @category VuFind2 + * @package Http * @author David Maus <maus@hab.de> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://github.com/dmj/vf2-proxy diff --git a/module/VuFindHttp/src/VuFindHttp/HttpService.php b/module/VuFindHttp/src/VuFindHttp/HttpService.php index 27d408c6df5..49366ed0587 100644 --- a/module/VuFindHttp/src/VuFindHttp/HttpService.php +++ b/module/VuFindHttp/src/VuFindHttp/HttpService.php @@ -20,8 +20,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * @category Http - * @package Service + * @category VuFind2 + * @package Http * @author David Maus <maus@hab.de> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://github.com/dmj/vf2-HTTP @@ -32,8 +32,8 @@ namespace VuFindHttp; /** * VuFind HTTP service. * - * @category Http - * @package Service + * @category VuFind2 + * @package Http * @author David Maus <maus@hab.de> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://github.com/dmj/vf2-search-subsystem @@ -119,7 +119,8 @@ class HttpService implements HttpServiceInterface $url .= '?' . $query; } } - $client = $this->createClient($url, \Zend\Http\Request::METHOD_GET, $timeout); + $client + = $this->createClient($url, \Zend\Http\Request::METHOD_GET, $timeout); return $this->send($client); } @@ -133,11 +134,15 @@ class HttpService implements HttpServiceInterface * * @return \Zend\Http\Response */ - public function post ($url, $body = null, $type = 'application/octet-stream', $timeout = null) - { - $client = $this->createClient($url, \Zend\Http\Request::METHOD_POST, $timeout); + public function post ($url, $body = null, $type = 'application/octet-stream', + $timeout = null + ) { + $client + = $this->createClient($url, \Zend\Http\Request::METHOD_POST, $timeout); $client->setRawBody($body); - $client->setHeaders(array('Content-Type' => $type, 'Content-Length' => strlen($body))); + $client->setHeaders( + array('Content-Type' => $type, 'Content-Length' => strlen($body)) + ); return $this->send($client); } @@ -163,8 +168,9 @@ class HttpService implements HttpServiceInterface * * @return void */ - public function setDefaultAdapter(\Zend\Http\Client\Adapter\AdapterInterface $adapter) - { + public function setDefaultAdapter( + \Zend\Http\Client\Adapter\AdapterInterface $adapter + ) { $this->defaultAdapter = $adapter; } @@ -177,8 +183,9 @@ class HttpService implements HttpServiceInterface * * @return \Zend\Http\Client */ - public function createClient ($url = null, $method = \Zend\Http\Request::METHOD_GET, $timeout = null) - { + public function createClient ($url = null, + $method = \Zend\Http\Request::METHOD_GET, $timeout = null + ) { $client = new \Zend\Http\Client(); $client->setMethod($method); if (null !== $this->defaultAdapter) { diff --git a/module/VuFindHttp/src/VuFindHttp/HttpServiceAwareInterface.php b/module/VuFindHttp/src/VuFindHttp/HttpServiceAwareInterface.php index 16153250787..8c7c323961a 100644 --- a/module/VuFindHttp/src/VuFindHttp/HttpServiceAwareInterface.php +++ b/module/VuFindHttp/src/VuFindHttp/HttpServiceAwareInterface.php @@ -20,8 +20,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * @category Http - * @package Service + * @category VuFind2 + * @package Http * @author David Maus <maus@hab.de> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://github.com/dmj/vf2-proxy @@ -32,8 +32,8 @@ namespace VuFindHttp; /** * Marker interface for HTTP service aware classes. * - * @category Http - * @package Service + * @category VuFind2 + * @package Http * @author David Maus <maus@hab.de> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://github.com/dmj/vf2-proxy diff --git a/module/VuFindHttp/src/VuFindHttp/HttpServiceInterface.php b/module/VuFindHttp/src/VuFindHttp/HttpServiceInterface.php index 456f59f938b..b6e25e94e29 100644 --- a/module/VuFindHttp/src/VuFindHttp/HttpServiceInterface.php +++ b/module/VuFindHttp/src/VuFindHttp/HttpServiceInterface.php @@ -20,8 +20,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * @category Http - * @package Service + * @category VuFind2 + * @package Http * @author David Maus <maus@hab.de> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://github.com/dmj/vf2-proxy @@ -32,8 +32,8 @@ namespace VuFindHttp; /** * VuFind HTTP service interface definition. * - * @category Http - * @package Service + * @category VuFind2 + * @package Http * @author David Maus <maus@hab.de> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://github.com/dmj/vf2-proxy @@ -74,7 +74,9 @@ interface HttpServiceInterface * * @return \Zend\Http\Response */ - public function post ($url, $body = null, $type = 'application/octet-stream', $timeout = null); + public function post ($url, $body = null, $type = 'application/octet-stream', + $timeout = null + ); /** * Post form data. @@ -96,6 +98,8 @@ interface HttpServiceInterface * * @return \Zend\Http\Client */ - public function createClient ($url, $method = \Zend\Http\Request::METHOD_GET, $timeout = null); + public function createClient ($url, $method = \Zend\Http\Request::METHOD_GET, + $timeout = null + ); } \ No newline at end of file -- GitLab