| Conditions | 1 |
| Paths | 1 |
| Total Lines | 87 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php namespace Scriptotek\Sru; |
||
| 51 | public function testNext() |
||
| 52 | { |
||
| 53 | $cql = 'dc.title="Joda jada isjda"'; |
||
| 54 | |||
| 55 | $http = new MockHttp(); |
||
| 56 | $http->addResponse( |
||
| 57 | (new HttpResponse()) |
||
| 58 | ->withBody(stream_for('<?xml version="1.0" encoding="UTF-8" ?> |
||
| 59 | <srw:searchRetrieveResponse |
||
| 60 | xmlns:srw="http://www.loc.gov/zing/srw/" |
||
| 61 | xmlns:xcql="http://www.loc.gov/zing/cql/xcql/" |
||
| 62 | > |
||
| 63 | <srw:version>1.1</srw:version> |
||
| 64 | <srw:numberOfRecords>3</srw:numberOfRecords> |
||
| 65 | <srw:records> |
||
| 66 | <srw:record> |
||
| 67 | <srw:recordSchema>marcxchange</srw:recordSchema> |
||
| 68 | <srw:recordPacking>xml</srw:recordPacking> |
||
| 69 | <srw:recordPosition>1</srw:recordPosition> |
||
| 70 | <srw:recordData>Record 1</srw:recordData> |
||
| 71 | </srw:record> |
||
| 72 | <srw:record> |
||
| 73 | <srw:recordSchema>marcxchange</srw:recordSchema> |
||
| 74 | <srw:recordPacking>xml</srw:recordPacking> |
||
| 75 | <srw:recordPosition>2</srw:recordPosition> |
||
| 76 | <srw:recordData>Record 2</srw:recordData> |
||
| 77 | </srw:record> |
||
| 78 | </srw:records> |
||
| 79 | <srw:nextRecordPosition>3</srw:nextRecordPosition> |
||
| 80 | <srw:echoedSearchRetrieveRequest> |
||
| 81 | <srw:operation>searchRetrieve</srw:operation> |
||
| 82 | <srw:version>1.1</srw:version> |
||
| 83 | <srw:query>\' . $cql . \'</srw:query> |
||
| 84 | <srw:startRecord>1</srw:startRecord> |
||
| 85 | <srw:maximumRecords>2</srw:maximumRecords> |
||
| 86 | <srw:recordSchema>marcxchange</srw:recordSchema> |
||
| 87 | </srw:echoedSearchRetrieveRequest> |
||
| 88 | <srw:extraResponseData> |
||
| 89 | <responseDate>2014-03-28T12:09:50Z</responseDate> |
||
| 90 | </srw:extraResponseData> |
||
| 91 | </srw:searchRetrieveResponse> |
||
| 92 | ') |
||
| 93 | ) |
||
| 94 | ); |
||
| 95 | |||
| 96 | $sru = new Client($this->url, null, $http); |
||
| 97 | $response = $sru->search($cql); |
||
| 98 | $this->assertCount(2, $response->records); |
||
| 99 | |||
| 100 | |||
| 101 | $http->addResponse( |
||
| 102 | (new HttpResponse()) |
||
| 103 | ->withBody(stream_for('<?xml version="1.0" encoding="UTF-8" ?> |
||
| 104 | <srw:searchRetrieveResponse |
||
| 105 | xmlns:srw="http://www.loc.gov/zing/srw/" |
||
| 106 | xmlns:xcql="http://www.loc.gov/zing/cql/xcql/" |
||
| 107 | > |
||
| 108 | <srw:version>1.1</srw:version> |
||
| 109 | <srw:numberOfRecords>3</srw:numberOfRecords> |
||
| 110 | <srw:records> |
||
| 111 | <srw:record> |
||
| 112 | <srw:recordSchema>marcxchange</srw:recordSchema> |
||
| 113 | <srw:recordPacking>xml</srw:recordPacking> |
||
| 114 | <srw:recordPosition>3</srw:recordPosition> |
||
| 115 | <srw:recordData>Record 3</srw:recordData> |
||
| 116 | </srw:record> |
||
| 117 | </srw:records> |
||
| 118 | <srw:echoedSearchRetrieveRequest> |
||
| 119 | <srw:operation>searchRetrieve</srw:operation> |
||
| 120 | <srw:version>1.1</srw:version> |
||
| 121 | <srw:query>' . $cql . '</srw:query> |
||
| 122 | <srw:startRecord>3</srw:startRecord> |
||
| 123 | <srw:maximumRecords>2</srw:maximumRecords> |
||
| 124 | <srw:recordSchema>marcxchange</srw:recordSchema> |
||
| 125 | </srw:echoedSearchRetrieveRequest> |
||
| 126 | <srw:extraResponseData> |
||
| 127 | <responseDate>2014-03-28T12:09:50Z</responseDate> |
||
| 128 | </srw:extraResponseData> |
||
| 129 | </srw:searchRetrieveResponse> |
||
| 130 | ')) |
||
| 131 | ); |
||
| 132 | |||
| 133 | $response = $response->next(); |
||
| 134 | $this->assertCount(1, $response->records); |
||
| 135 | |||
| 136 | $response = $response->next(); |
||
| 137 | $this->assertNull($response); |
||
| 138 | } |
||
| 176 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths