Skip to content

Commit 06f864b

Browse files
committed
PSR-2 style fix
1 parent 6daeef4 commit 06f864b

14 files changed

+276
-296
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"require-dev": {
1212
"phpunit/phpunit": "4.0.*",
1313
"satooshi/php-coveralls": "dev-master",
14-
"mockery/mockery": "dev-master",
15-
"sami/sami": "1.4.*"
14+
"sami/sami": "1.4.*",
15+
"mockery/mockery": "dev-master"
1616
},
1717
"license": "MIT",
1818
"authors": [

src/Client.php

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?php namespace Scriptotek\Sru;
2-
2+
33
use \Guzzle\Http\Client as HttpClient;
44

55
/**
66
* SRU client
77
*/
8-
class Client {
9-
8+
class Client
9+
{
1010
/** @var HttpClient */
1111
protected $httpClient;
1212

@@ -25,7 +25,7 @@ class Client {
2525
/**
2626
* @var string|string[] Proxy configuration details.
2727
*
28-
* Either a string 'host:port' or an
28+
* Either a string 'host:port' or an
2929
* array('host:port', 'username', 'password').
3030
*/
3131
protected $proxy;
@@ -89,7 +89,7 @@ public function urlTo($cql, $start = 1, $count = 10, $extraParams = array())
8989
);
9090

9191
if ($start != 1) {
92-
// At least the BIBSYS SRU service, specifying startRecord results in
92+
// At least the BIBSYS SRU service, specifying startRecord results in
9393
// a less clear error message when there's no results
9494
$qs['startRecord'] = $start;
9595
}
@@ -103,7 +103,7 @@ public function urlTo($cql, $start = 1, $count = 10, $extraParams = array())
103103

104104
/**
105105
* Get HTTP client configuration options (authentication, proxy, headers)
106-
*
106+
*
107107
* @return array
108108
*/
109109
public function getHttpOptions()
@@ -135,8 +135,8 @@ public function getHttpOptions()
135135
* @param array $extraParams Extra GET parameters
136136
* @return SearchRetrieveResponse
137137
*/
138-
public function search($cql, $start = 1, $count = 10, $extraParams = array()) {
139-
138+
public function search($cql, $start = 1, $count = 10, $extraParams = array())
139+
{
140140
$url = $this->urlTo($cql, $start, $count, $extraParams);
141141
$options = $this->getHttpOptions();
142142

@@ -179,8 +179,8 @@ public function first($cql, $extraParams = array(), $httpClient = null)
179179
*
180180
* @return ExplainResponse
181181
*/
182-
public function explain() {
183-
182+
public function explain()
183+
{
184184
$url = $this->url . '?' . http_build_query(array(
185185
'operation' => 'explain',
186186
'version' => $this->version,
@@ -191,8 +191,5 @@ public function explain() {
191191
$body = $res->getBody(true);
192192

193193
return new ExplainResponse($body, $this);
194-
195194
}
196-
197195
}
198-

src/ExplainResponse.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php namespace Scriptotek\Sru;
2-
2+
33
/**
44
* Explain response
55
*/
6-
class ExplainResponse extends Response implements ResponseInterface {
7-
6+
class ExplainResponse extends Response implements ResponseInterface
7+
{
88
/** @var string Server hostname */
99
public $host;
1010

@@ -30,7 +30,9 @@ public function __construct($text, &$client = null)
3030
$this->indexes = array();
3131

3232
$explain = $this->response->first('/srw:explainResponse/srw:record/srw:recordData/exp:explain');
33-
if (!$explain) return;
33+
if (!$explain) {
34+
return;
35+
}
3436

3537
$serverInfo = $explain->first('exp:serverInfo');
3638
$dbInfo = $explain->first('exp:databaseInfo');
@@ -59,8 +61,5 @@ public function __construct($text, &$client = null)
5961
}
6062

6163
// TODO
62-
6364
}
64-
6565
}
66-

src/InvalidResponseException.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?php namespace Scriptotek\Sru;
22

3-
class InvalidResponseException extends \Exception{
4-
5-
/**
6-
* @param string $message
7-
*/
8-
public function __construct($message) {
9-
parent::__construct($message);
10-
}
11-
3+
class InvalidResponseException extends \Exception
4+
{
5+
/**
6+
* @param string $message
7+
*/
8+
public function __construct($message)
9+
{
10+
parent::__construct($message);
11+
}
1212
}

src/Record.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?php namespace Scriptotek\Sru;
2-
2+
33
use Danmichaelo\QuiteSimpleXMLElement\QuiteSimpleXMLElement;
44

55
/**
66
* Single record from a SRU response
77
*/
8-
class Record {
9-
8+
class Record
9+
{
1010
/** @var int */
1111
public $position;
1212

@@ -31,5 +31,4 @@ public function __construct($doc)
3131
$this->schema = $doc->text('./srw:recordSchema');
3232
$this->data = $doc->first('./srw:recordData');
3333
}
34-
3534
}

0 commit comments

Comments
 (0)