1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
From f0cdf565fd129136ef4ee43c9e2aa9b12bb3eb8a Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Mon, 13 Dec 2021 08:05:14 +0100
Subject: [PATCH] fix #6 compatibility with psr 1.2.0
---
tests/Factory/createUploadedFile_err01.phpt | 4 ++--
tests/Message/body_err01.phpt | 2 +-
tests/Request/uri_err01.phpt | 2 +-
uri.c | 5 ++++-
4 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/tests/Factory/createUploadedFile_err01.phpt b/tests/Factory/createUploadedFile_err01.phpt
index 0bc72b9..13186e1 100644
--- a/tests/Factory/createUploadedFile_err01.phpt
+++ b/tests/Factory/createUploadedFile_err01.phpt
@@ -43,8 +43,8 @@ try {
?>
--EXPECTF--
-%sttpMessage\Factory::createUploadedFile()%s Psr\Http\Message\StreamInterface, string given
-%sttpMessage\Factory::createUploadedFile()%s Psr\Http\Message\StreamInterface,%sstdClass given
+%sttpMessage\Factory::createUploadedFile()%s\Http\Message\StreamInterface, string given
+%sttpMessage\Factory::createUploadedFile()%s\Http\Message\StreamInterface,%sstdClass given
%sttpMessage\Factory::createUploadedFile()%s, array given
%sttpMessage\Factory::createUploadedFile()%sint, array given
%sttpMessage\Factory::createUploadedFile()%s, array given
diff --git a/tests/Message/body_err01.phpt b/tests/Message/body_err01.phpt
index 720ff6a..5925676 100644
--- a/tests/Message/body_err01.phpt
+++ b/tests/Message/body_err01.phpt
@@ -19,5 +19,5 @@ try {
?>
--EXPECTF--
-%sttpMessage\Message::withBody()%s Psr\Http\Message\StreamInterface, resource given
+%sttpMessage\Message::withBody()%s\Http\Message\StreamInterface, resource given
HttpMessage\Message::withBody() expects exactly 1 %s, 0 given
diff --git a/tests/Request/uri_err01.phpt b/tests/Request/uri_err01.phpt
index 8803d73..6903e8e 100644
--- a/tests/Request/uri_err01.phpt
+++ b/tests/Request/uri_err01.phpt
@@ -19,4 +19,4 @@ try {
?>
--EXPECTF--
HttpMessage\Request::withUri() expects exactly 1 %s, 0 given
-%sttpMessage\Request::withUri()%sPsr\Http\Message\UriInterface, string given
+%sttpMessage\Request::withUri()%s\Http\Message\UriInterface, string given
diff --git a/uri.c b/uri.c
index 1f5b4c6..77782cf 100644
--- a/uri.c
+++ b/uri.c
@@ -113,8 +113,11 @@ PHP_METHOD(Uri, __construct)
/* __toString */
-
+#if PHP_VERSION_ID >= 80000 && PHP_PSR_VERSION_ID >= 10200
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_HttpMessageUri_toString, 0, 0, IS_STRING, 0)
+#else
ZEND_BEGIN_ARG_INFO_EX(arginfo_HttpMessageUri_toString, 0, 0, 0)
+#endif
ZEND_END_ARG_INFO()
PHP_METHOD(Uri, __toString)
|