@@ -430,7 +430,7 @@ public function withBody(StreamInterface $body): self
430
430
return $ new ;
431
431
}
432
432
433
- private function setHeaders (array $ headers ): void
433
+ private function setHeaders (array $ headers ) /*: void*/
434
434
{
435
435
foreach ($ headers as $ header => $ value ) {
436
436
$ value = $ this ->validateAndTrimHeader ($ header , $ value );
@@ -580,7 +580,7 @@ public function withUri(UriInterface $uri, $preserveHost = false): self
580
580
return $ new ;
581
581
}
582
582
583
- private function updateHostFromUri (): void
583
+ private function updateHostFromUri () /*: void*/
584
584
{
585
585
if ('' === $ host = $ this ->uri ->getHost ()) {
586
586
return ;
@@ -606,7 +606,7 @@ final class Response implements ResponseInterface
606
606
{
607
607
use MessageTrait;
608
608
609
- private const PHRASES = [
609
+ /* private*/ const PHRASES = [
610
610
100 => 'Continue ' , 101 => 'Switching Protocols ' , 102 => 'Processing ' ,
611
611
200 => 'OK ' , 201 => 'Created ' , 202 => 'Accepted ' , 203 => 'Non-Authoritative Information ' , 204 => 'No Content ' , 205 => 'Reset Content ' , 206 => 'Partial Content ' , 207 => 'Multi-status ' , 208 => 'Already Reported ' ,
612
612
300 => 'Multiple Choices ' , 301 => 'Moved Permanently ' , 302 => 'Found ' , 303 => 'See Other ' , 304 => 'Not Modified ' , 305 => 'Use Proxy ' , 306 => 'Switch Proxy ' , 307 => 'Temporary Redirect ' ,
@@ -820,7 +820,7 @@ final class Stream implements StreamInterface
820
820
821
821
private $ size ;
822
822
823
- private const READ_WRITE_HASH = [
823
+ /* private*/ const READ_WRITE_HASH = [
824
824
'read ' => [
825
825
'r ' => true , 'w+ ' => true , 'r+ ' => true , 'x+ ' => true , 'c+ ' => true ,
826
826
'rb ' => true , 'w+b ' => true , 'r+b ' => true , 'x+b ' => true ,
@@ -884,7 +884,7 @@ public function __toString(): string
884
884
}
885
885
}
886
886
887
- public function close (): void
887
+ public function close () /*: void*/
888
888
{
889
889
if (isset ($ this ->stream )) {
890
890
if (\is_resource ($ this ->stream )) {
@@ -908,7 +908,7 @@ public function detach()
908
908
return $ result ;
909
909
}
910
910
911
- public function getSize (): ?int
911
+ public function getSize () /*: ?int*/
912
912
{
913
913
if (null !== $ this ->size ) {
914
914
return $ this ->size ;
@@ -951,7 +951,7 @@ public function isSeekable(): bool
951
951
return $ this ->seekable ;
952
952
}
953
953
954
- public function seek ($ offset , $ whence = \SEEK_SET ): void
954
+ public function seek ($ offset , $ whence = \SEEK_SET ) /*: void*/
955
955
{
956
956
if (!$ this ->seekable ) {
957
957
throw new \RuntimeException ('Stream is not seekable ' );
@@ -962,7 +962,7 @@ public function seek($offset, $whence = \SEEK_SET): void
962
962
}
963
963
}
964
964
965
- public function rewind (): void
965
+ public function rewind () /*: void*/
966
966
{
967
967
$ this ->seek (0 );
968
968
}
@@ -1034,7 +1034,7 @@ public function getMetadata($key = null)
1034
1034
1035
1035
final class UploadedFile implements UploadedFileInterface
1036
1036
{
1037
- private const ERRORS = [
1037
+ /* private*/ const ERRORS = [
1038
1038
\UPLOAD_ERR_OK => 1 ,
1039
1039
\UPLOAD_ERR_INI_SIZE => 1 ,
1040
1040
\UPLOAD_ERR_FORM_SIZE => 1 ,
@@ -1095,7 +1095,7 @@ public function __construct($streamOrFile, $size, $errorStatus, $clientFilename
1095
1095
}
1096
1096
}
1097
1097
1098
- private function validateActive (): void
1098
+ private function validateActive () /*: void*/
1099
1099
{
1100
1100
if (\UPLOAD_ERR_OK !== $ this ->error ) {
1101
1101
throw new \RuntimeException ('Cannot retrieve stream due to upload error ' );
@@ -1119,7 +1119,7 @@ public function getStream(): StreamInterface
1119
1119
return Stream::create ($ resource );
1120
1120
}
1121
1121
1122
- public function moveTo ($ targetPath ): void
1122
+ public function moveTo ($ targetPath ) /*: void*/
1123
1123
{
1124
1124
$ this ->validateActive ();
1125
1125
@@ -1160,12 +1160,12 @@ public function getError(): int
1160
1160
return $ this ->error ;
1161
1161
}
1162
1162
1163
- public function getClientFilename (): ?string
1163
+ public function getClientFilename () /*: ?string*/
1164
1164
{
1165
1165
return $ this ->clientFilename ;
1166
1166
}
1167
1167
1168
- public function getClientMediaType (): ?string
1168
+ public function getClientMediaType () /*: ?string*/
1169
1169
{
1170
1170
return $ this ->clientMediaType ;
1171
1171
}
@@ -1175,11 +1175,11 @@ public function getClientMediaType(): ?string
1175
1175
1176
1176
final class Uri implements UriInterface
1177
1177
{
1178
- private const SCHEMES = ['http ' => 80 , 'https ' => 443 ];
1178
+ /* private*/ const SCHEMES = ['http ' => 80 , 'https ' => 443 ];
1179
1179
1180
- private const CHAR_UNRESERVED = 'a-zA-Z0-9_\-\.~ ' ;
1180
+ /* private*/ const CHAR_UNRESERVED = 'a-zA-Z0-9_\-\.~ ' ;
1181
1181
1182
- private const CHAR_SUB_DELIMS = '!\$& \'\(\)\*\+,;= ' ;
1182
+ /* private*/ const CHAR_SUB_DELIMS = '!\$& \'\(\)\*\+,;= ' ;
1183
1183
1184
1184
private $ scheme = '' ;
1185
1185
@@ -1253,7 +1253,7 @@ public function getHost(): string
1253
1253
return $ this ->host ;
1254
1254
}
1255
1255
1256
- public function getPort (): ?int
1256
+ public function getPort () /*: ?int*/
1257
1257
{
1258
1258
return $ this ->port ;
1259
1259
}
@@ -1412,7 +1412,7 @@ private static function isNonStandardPort(string $scheme, int $port): bool
1412
1412
return !isset (self ::SCHEMES [$ scheme ]) || $ port !== self ::SCHEMES [$ scheme ];
1413
1413
}
1414
1414
1415
- private function filterPort ($ port ): ?int
1415
+ private function filterPort ($ port ) /*: ?int*/
1416
1416
{
1417
1417
if (null === $ port ) {
1418
1418
return null ;
@@ -6571,7 +6571,7 @@ public function getType(string $table): string
6571
6571
return $ this ->reflection ->getType ($ table );
6572
6572
}
6573
6573
6574
- public function create (string $ tableName , /* object */ $ record , array $ params )
6574
+ public function create (string $ tableName , /* object */ $ record , array $ params ) /*: ?int*/
6575
6575
{
6576
6576
$ this ->sanitizeRecord ($ tableName , $ record , '' );
6577
6577
$ table = $ this ->reflection ->getTable ($ tableName );
@@ -6593,21 +6593,21 @@ public function read(string $tableName, string $id, array $params) /*: ?object*/
6593
6593
return $ records [0 ];
6594
6594
}
6595
6595
6596
- public function update (string $ tableName , string $ id , /* object */ $ record , array $ params )
6596
+ public function update (string $ tableName , string $ id , /* object */ $ record , array $ params ) /*: ?int*/
6597
6597
{
6598
6598
$ this ->sanitizeRecord ($ tableName , $ record , $ id );
6599
6599
$ table = $ this ->reflection ->getTable ($ tableName );
6600
6600
$ columnValues = $ this ->columns ->getValues ($ table , true , $ record , $ params );
6601
6601
return $ this ->db ->updateSingle ($ table , $ columnValues , $ id );
6602
6602
}
6603
6603
6604
- public function delete (string $ tableName , string $ id , array $ params )
6604
+ public function delete (string $ tableName , string $ id , array $ params ) /*: ?int*/
6605
6605
{
6606
6606
$ table = $ this ->reflection ->getTable ($ tableName );
6607
6607
return $ this ->db ->deleteSingle ($ table , $ id );
6608
6608
}
6609
6609
6610
- public function increment (string $ tableName , string $ id , /* object */ $ record , array $ params )
6610
+ public function increment (string $ tableName , string $ id , /* object */ $ record , array $ params ) /*: ?int*/
6611
6611
{
6612
6612
$ this ->sanitizeRecord ($ tableName , $ record , $ id );
6613
6613
$ table = $ this ->reflection ->getTable ($ tableName );
@@ -6925,7 +6925,7 @@ private function setHabtmValues(ReflectedTable $t1, ReflectedTable $t2, array &$
6925
6925
6926
6926
// file: src/Tqdev/PhpCrudApi/Api.php
6927
6927
6928
- class Api
6928
+ class Api implements RequestHandlerInterface
6929
6929
{
6930
6930
private $ router ;
6931
6931
private $ responder ;
0 commit comments