Skip to content

Commit 71c8257

Browse files
committed
WIP
1 parent 908f605 commit 71c8257

21 files changed

+25
-25
lines changed

src/EntitySet.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -579,17 +579,17 @@ public function addTrailingMetadata(Transaction $transaction, MetadataContainer
579579
$skipToken = $transaction->getSkipToken();
580580

581581
if ($skipToken->hasValue()) {
582-
$paginationParams['$top'] = $top->getValue();
583-
$paginationParams['$skiptoken'] = $skipToken->getValue();
582+
$paginationParams[$top::param] = $top->getValue();
583+
$paginationParams[$skipToken::param] = $skipToken->getValue();
584584
}
585585
break;
586586

587587
case $this instanceof PaginationInterface:
588588
$skip = $transaction->getSkip();
589589

590590
if ($skip->hasValue() && ($count === null || $skip->getValue() < $count)) {
591-
$paginationParams['$top'] = $top->getValue();
592-
$paginationParams['$skip'] = $skip->getValue();
591+
$paginationParams[$top::param] = $top->getValue();
592+
$paginationParams[$skip::param] = $skip->getValue();
593593
}
594594
break;
595595
}
@@ -598,7 +598,8 @@ public function addTrailingMetadata(Transaction $transaction, MetadataContainer
598598
if ($paginationParams) {
599599
$transactionParams = array_diff_key(
600600
$transaction->getQueryParams(),
601-
array_flip(['$top', '$skip', '$skiptoken'])
601+
array_flip([Option\Top::param, Option\Skip::param, Option\SkipToken::param]),
602+
array_flip(['$'.Option\Top::param, '$'.Option\Skip::param, '$'.Option\SkipToken::param]),
602603
);
603604

604605
$metadata['nextLink'] = Url::http_build_url(

tests/Unit/CSV/__snapshots__/CSVTest__test_orderby__1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@
3939
"duration": "P2DT17H44M37.225146000012S"
4040
}
4141
],
42-
"@nextLink": "http://localhost/odata/csv?%24orderby=name&%24top=4&%24skip=4"
42+
"@nextLink": "http://localhost/odata/csv?%24orderby=name&top=4&skip=4"
4343
}

tests/Unit/CSV/__snapshots__/CSVTest__test_orderby_direction__1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@
3939
"duration": "P54DT17H45M8.5999999996275S"
4040
}
4141
],
42-
"@nextLink": "http://localhost/odata/csv?%24orderby=name%20desc&%24top=4&%24skip=4"
42+
"@nextLink": "http://localhost/odata/csv?%24orderby=name%20desc&top=4&skip=4"
4343
}

tests/Unit/CSV/__snapshots__/CSVTest__test_pagination__1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@
2626
"duration": "PT8H38M9.5408012599983S"
2727
}
2828
],
29-
"@nextLink": "http://localhost/odata/csv?%24top=4&%24skip=9"
29+
"@nextLink": "http://localhost/odata/csv?top=4&skip=9"
3030
}

tests/Unit/CSV/__snapshots__/CSVTest__test_pagination__2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@
2626
"duration": "PT6S"
2727
}
2828
],
29-
"@nextLink": "http://localhost/odata/csv?%24top=4&%24skip=13"
29+
"@nextLink": "http://localhost/odata/csv?top=4&skip=13"
3030
}

tests/Unit/Options/__snapshots__/CountTest__test_count_ignores_top__1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
}
1414
],
1515
"@count": 4,
16-
"@nextLink": "http://localhost/odata/airports?%24count=true&%24top=1&%24skip=1"
16+
"@nextLink": "http://localhost/odata/airports?%24count=true&top=1&skip=1"
1717
}

tests/Unit/Options/__snapshots__/SkipTest__test_top_skip__1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
"is_big": false
1313
}
1414
],
15-
"@nextLink": "http://localhost/odata/airports?%24top=1&%24skip=2"
15+
"@nextLink": "http://localhost/odata/airports?top=1&skip=2"
1616
}

tests/Unit/Options/__snapshots__/TopTest__test_page__1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@
2222
"is_big": false
2323
}
2424
],
25-
"@nextLink": "http://localhost/odata/airports?%24top=2&%24skip=2"
25+
"@nextLink": "http://localhost/odata/airports?top=2&skip=2"
2626
}

tests/Unit/Options/__snapshots__/TopTest__test_page_select__1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
"code": "lax"
99
}
1010
],
11-
"@nextLink": "http://localhost/odata/airports?%24select=code&%24top=2&%24skip=2"
11+
"@nextLink": "http://localhost/odata/airports?%24select=code&top=2&skip=2"
1212
}

tests/Unit/Options/__snapshots__/TopTest__test_top__1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@
2222
"is_big": false
2323
}
2424
],
25-
"@nextLink": "http://localhost/odata/airports?%24top=2&%24skip=2"
25+
"@nextLink": "http://localhost/odata/airports?top=2&skip=2"
2626
}

tests/Unit/Options/__snapshots__/TopTest__test_top_one__1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
"is_big": true
1313
}
1414
],
15-
"@nextLink": "http://localhost/odata/airports?%24top=1&%24skip=1"
15+
"@nextLink": "http://localhost/odata/airports?top=1&skip=1"
1616
}

tests/Unit/Preferences/__snapshots__/MaxPageSizeTest__test_uses_maxpagesize_preference__1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
"duration": "PT11H25M0S"
1010
}
1111
],
12-
"@nextLink": "http://localhost/odata/flights?%24top=1&%24skip=1"
12+
"@nextLink": "http://localhost/odata/flights?top=1&skip=1"
1313
}

tests/Unit/Preferences/__snapshots__/MaxPageSizeTest__test_uses_odata_maxpagesize_preference__1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
"duration": "PT11H25M0S"
1010
}
1111
],
12-
"@nextLink": "http://localhost/odata/flights?%24top=1&%24skip=1"
12+
"@nextLink": "http://localhost/odata/flights?top=1&skip=1"
1313
}

tests/Unit/Protocol/ErrorReportingTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ public function test_error_response_body()
4141
->addInnerError('internal', 'inner error');
4242
} catch (NotImplementedException $e) {
4343
$response = $e->toResponse();
44-
/** @noinspection PhpParamsInspection */
4544
$testResponse = new TestResponse($response);
4645
$this->assertMatchesSnapshot($testResponse->streamedContent(), new StreamingJsonDriver());
4746
}

tests/Unit/Queries/Expand/__snapshots__/ExpandTest__test_expand_containing_top__1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717
"flight_id": 1
1818
}
1919
],
20-
"passengers@nextLink": "http://localhost/odata/flights(1)/passengers?%24top=2&%24skip=2"
20+
"passengers@nextLink": "http://localhost/odata/flights(1)/passengers?top=2&skip=2"
2121
}

tests/Unit/Queries/Expand/__snapshots__/ExpandTest__test_expand_full_metadata_top__1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
],
2424
"passengers@navigationLink": "http://localhost/odata/flights(1)/passengers",
2525
"passengers@count": 3,
26-
"passengers@nextLink": "http://localhost/odata/flights(1)/passengers?%24count=true&%24top=1&%24skip=1"
26+
"passengers@nextLink": "http://localhost/odata/flights(1)/passengers?%24count=true&top=1&skip=1"
2727
},
2828
{
2929
"@type": "#com.example.odata.flight",

tests/Unit/Queries/Expand/__snapshots__/ExpandTest__test_select_with_expand_select_multiple_and_top__1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
"name": "Bob Barry"
1212
}
1313
],
14-
"passengers@nextLink": "http://localhost/odata/flights(1)/passengers?%24select=flight_id%2Cname&%24top=2&%24skip=2"
14+
"passengers@nextLink": "http://localhost/odata/flights(1)/passengers?%24select=flight_id%2Cname&top=2&skip=2"
1515
}

tests/Unit/Queries/Navigation/__snapshots__/NavigationTest__test_apply_query_parameters_to_last_segment__1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
"name": "Bob Barry"
1111
}
1212
],
13-
"@nextLink": "http://localhost/odata/passengers?%24select=flight_id%2Cname&%24top=2&%24skip=2"
13+
"@nextLink": "http://localhost/odata/passengers?%24select=flight_id%2Cname&top=2&skip=2"
1414
}

tests/Unit/Redis/__snapshots__/RedisTest__test_pagination__1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
"key": "dqamni"
1111
}
1212
],
13-
"@nextLink": "http://localhost/odata/passengers?%24top=2&%24skiptoken=2"
13+
"@nextLink": "http://localhost/odata/passengers?top=2&skiptoken=2"
1414
}

tests/Unit/Redis/__snapshots__/RedisTest__test_pagination__2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
"key": "coynla"
1111
}
1212
],
13-
"@nextLink": "http://localhost/odata/passengers?%24top=2&%24skiptoken=4"
13+
"@nextLink": "http://localhost/odata/passengers?top=2&skiptoken=4"
1414
}

tests/Unit/Redis/__snapshots__/RedisTest__test_pagination__3.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
"key": "ilpmuf"
1111
}
1212
],
13-
"@nextLink": "http://localhost/odata/passengers?%24top=2&%24skiptoken=6"
13+
"@nextLink": "http://localhost/odata/passengers?top=2&skiptoken=6"
1414
}

0 commit comments

Comments
 (0)