@@ -19,10 +19,10 @@ |
||
| 19 | 19 | namespace Phpoaipmh\Example; |
| 20 | 20 | |
| 21 | 21 | use Symfony\Component\Console\Command\Command; |
| 22 | +use Symfony\Component\Console\Helper\Table; |
|
| 22 | 23 | use Symfony\Component\Console\Input\InputInterface; |
| 23 | 24 | use Symfony\Component\Console\Input\InputOption; |
| 24 | 25 | use Symfony\Component\Console\Output\OutputInterface; |
| 25 | -use Symfony\Component\Console\Helper\Table; |
|
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | 28 | * A symfony 2 console command. |
@@ -53,8 +53,8 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | public function __construct(Example $example) |
| 55 | 55 | { |
| 56 | - $this->example = $example; |
|
| 57 | - parent::__construct(); |
|
| 56 | + $this->example = $example; |
|
| 57 | + parent::__construct(); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | /** |
@@ -79,8 +79,8 @@ discard block |
||
| 79 | 79 | $data = $this->example->getBasicInformation(); |
| 80 | 80 | $output->writeln("Basic information: "); |
| 81 | 81 | foreach ($data as $key => $value) { |
| 82 | - $line = $formatter->formatSection($key, $value); |
|
| 83 | - $output->writeln($line); |
|
| 82 | + $line = $formatter->formatSection($key, $value); |
|
| 83 | + $output->writeln($line); |
|
| 84 | 84 | } |
| 85 | 85 | } |
| 86 | 86 | |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | */ |
| 37 | 37 | public function __construct(array $curlOpts = []) |
| 38 | 38 | { |
| 39 | - if (! is_callable('curl_exec')) { |
|
| 39 | + if (!is_callable('curl_exec')) { |
|
| 40 | 40 | throw new \Exception("OAI-PMH CurlAdapter HTTP HttpAdapterInterface requires the CURL PHP Extension"); |
| 41 | 41 | } |
| 42 | 42 | |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | */ |
| 41 | 41 | public function __construct() |
| 42 | 42 | { |
| 43 | - $oaiUrl = 'http://openscholarship.wustl.edu/do/oai/'; |
|
| 43 | + $oaiUrl = 'http://openscholarship.wustl.edu/do/oai/'; |
|
| 44 | 44 | $client = new Client($oaiUrl); |
| 45 | 45 | $this->endpoint = new Endpoint($client); |
| 46 | 46 | } |
@@ -87,13 +87,13 @@ |
||
| 87 | 87 | */ |
| 88 | 88 | public function request($verb, array $params = array()) |
| 89 | 89 | { |
| 90 | - if (! $this->url) { |
|
| 90 | + if (!$this->url) { |
|
| 91 | 91 | throw new RuntimeException("Cannot perform request when URL not set. Use setUrl() method"); |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | //Build the URL |
| 95 | 95 | $params = array_merge(array('verb' => $verb), $params); |
| 96 | - $url = $this->url . (parse_url($this->url, PHP_URL_QUERY) ? '&' : '?') . http_build_query($params); |
|
| 96 | + $url = $this->url.(parse_url($this->url, PHP_URL_QUERY) ? '&' : '?').http_build_query($params); |
|
| 97 | 97 | |
| 98 | 98 | //Do the request |
| 99 | 99 | try { |
@@ -96,8 +96,8 @@ discard block |
||
| 96 | 96 | $this->resumptionToken = $resumptionToken; |
| 97 | 97 | |
| 98 | 98 | //Node name error? |
| 99 | - if (! $this->getItemNodeName()) { |
|
| 100 | - throw new BaseOaipmhException('Cannot determine item name for verb: ' . $this->verb); |
|
| 99 | + if (!$this->getItemNodeName()) { |
|
| 100 | + throw new BaseOaipmhException('Cannot determine item name for verb: '.$this->verb); |
|
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | 103 | |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | $this->numRequests++; |
| 202 | 202 | |
| 203 | 203 | //Result format error? |
| 204 | - if (! isset($resp->$verb->$nodeName)) { |
|
| 204 | + if (!isset($resp->$verb->$nodeName)) { |
|
| 205 | 205 | throw new MalformedResponseException(sprintf("Expected XML element list '%s' missing for verb '%s'", $nodeName, $verb)); |
| 206 | 206 | } |
| 207 | 207 | |
@@ -84,6 +84,7 @@ discard block |
||
| 84 | 84 | * @param ClientInterface $client The client to use |
| 85 | 85 | * @param string $verb The verb to use when retrieving results from the client |
| 86 | 86 | * @param array $params Optional parameters passed to OAI-PMH |
| 87 | + * @param string $resumptionToken |
|
| 87 | 88 | */ |
| 88 | 89 | public function __construct(ClientInterface $client, $verb, array $params = array(), $resumptionToken = null) |
| 89 | 90 | { |
@@ -102,7 +103,7 @@ discard block |
||
| 102 | 103 | /** |
| 103 | 104 | * Get the total number of requests made during this run |
| 104 | 105 | * |
| 105 | - * @return int The number of HTTP requests made |
|
| 106 | + * @return boolean The number of HTTP requests made |
|
| 106 | 107 | */ |
| 107 | 108 | public function getNumRequests() |
| 108 | 109 | { |
@@ -259,7 +260,7 @@ discard block |
||
| 259 | 260 | * |
| 260 | 261 | * Map the item node name based on the verb |
| 261 | 262 | * |
| 262 | - * @return string|boolean The element name for the mapping, or false if unmapped |
|
| 263 | + * @return string|false The element name for the mapping, or false if unmapped |
|
| 263 | 264 | */ |
| 264 | 265 | private function getItemNodeName() |
| 265 | 266 | { |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | public function __toString() |
| 41 | 41 | { |
| 42 | 42 | $refl = new \ReflectionClass($this); |
| 43 | - return $refl->getShortName() . ": [{$this->code}]: ({$this->oaiErrorCode}) {$this->message}"; |
|
| 43 | + return $refl->getShortName().": [{$this->code}]: ({$this->oaiErrorCode}) {$this->message}"; |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | public function getOaiErrorCode() |