Browse Source

Update dependencies

Maurits van der Schee 5 years ago
parent
commit
c298c4681d
2 changed files with 15 additions and 9 deletions
  1. 10
    4
      api.php
  2. 5
    5
      composer.lock

+ 10
- 4
api.php View File

@@ -1498,6 +1498,11 @@ namespace Nyholm\Psr7\Factory {
1498 1498
 
1499 1499
         public function createResponse(int $code = 200, string $reasonPhrase = ''): ResponseInterface
1500 1500
         {
1501
+            if (2 > \func_num_args()) {
1502
+                // This will make the Response class to use a custom reasonPhrase
1503
+                $reasonPhrase = null;
1504
+            }
1505
+
1501 1506
             return new Response($code, [], null, '1.1', $reasonPhrase);
1502 1507
         }
1503 1508
 
@@ -1951,7 +1956,7 @@ namespace Nyholm\Psr7 {
1951 1956
             if (null === $reason && isset(self::PHRASES[$this->statusCode])) {
1952 1957
                 $this->reasonPhrase = self::PHRASES[$status];
1953 1958
             } else {
1954
-                $this->reasonPhrase = $reason;
1959
+                $this->reasonPhrase = $reason ?? '';
1955 1960
             }
1956 1961
 
1957 1962
             $this->protocol = $version;
@@ -2226,7 +2231,7 @@ namespace Nyholm\Psr7 {
2226 2231
                 $new = new self();
2227 2232
                 $new->stream = $body;
2228 2233
                 $meta = \stream_get_meta_data($new->stream);
2229
-                $new->seekable = $meta['seekable'];
2234
+                $new->seekable = $meta['seekable'] && 0 === \fseek($new->stream, 0, \SEEK_CUR);
2230 2235
                 $new->readable = isset(self::READ_WRITE_HASH['read'][$meta['mode']]);
2231 2236
                 $new->writable = isset(self::READ_WRITE_HASH['write'][$meta['mode']]);
2232 2237
                 $new->uri = $new->getMetadata('uri');
@@ -2854,8 +2859,8 @@ namespace Nyholm\Psr7 {
2854 2859
             }
2855 2860
 
2856 2861
             $port = (int) $port;
2857
-            if (1 > $port || 0xffff < $port) {
2858
-                throw new \InvalidArgumentException(\sprintf('Invalid port: %d. Must be between 1 and 65535', $port));
2862
+            if (0 > $port || 0xffff < $port) {
2863
+                throw new \InvalidArgumentException(\sprintf('Invalid port: %d. Must be between 0 and 65535', $port));
2859 2864
             }
2860 2865
 
2861 2866
             return self::isNonStandardPort($this->scheme, $port) ? $port : null;
@@ -10618,6 +10623,7 @@ namespace Tqdev\PhpCrudApi {
10618 10623
         'username' => 'php-crud-api',
10619 10624
         'password' => 'php-crud-api',
10620 10625
         'database' => 'php-crud-api',
10626
+        'controllers' => 'records,columns'
10621 10627
     ]);
10622 10628
     $request = RequestFactory::fromGlobals();
10623 10629
     $api = new Api($config);

+ 5
- 5
composer.lock View File

@@ -8,16 +8,16 @@
8 8
     "packages": [
9 9
         {
10 10
             "name": "nyholm/psr7",
11
-            "version": "1.1.0",
11
+            "version": "1.2.1",
12 12
             "source": {
13 13
                 "type": "git",
14 14
                 "url": "https://github.com/Nyholm/psr7.git",
15
-                "reference": "701fe7ea8c12c07b985b156d589134d328160cf7"
15
+                "reference": "55ff6b76573f5b242554c9775792bd59fb52e11c"
16 16
             },
17 17
             "dist": {
18 18
                 "type": "zip",
19
-                "url": "https://api.github.com/repos/Nyholm/psr7/zipball/701fe7ea8c12c07b985b156d589134d328160cf7",
20
-                "reference": "701fe7ea8c12c07b985b156d589134d328160cf7",
19
+                "url": "https://api.github.com/repos/Nyholm/psr7/zipball/55ff6b76573f5b242554c9775792bd59fb52e11c",
20
+                "reference": "55ff6b76573f5b242554c9775792bd59fb52e11c",
21 21
                 "shasum": ""
22 22
             },
23 23
             "require": {
@@ -66,7 +66,7 @@
66 66
                 "psr-17",
67 67
                 "psr-7"
68 68
             ],
69
-            "time": "2019-02-16T17:20:43+00:00"
69
+            "time": "2019-09-05T13:24:16+00:00"
70 70
         },
71 71
         {
72 72
             "name": "nyholm/psr7-server",

Loading…
Cancel
Save