This repository was archived by the owner on Jan 30, 2020. It is now read-only.
File tree 39 files changed +271
-182
lines changed
39 files changed +271
-182
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ All notable changes to this project will be documented in this file, in reverse
44
44
45
45
### Fixed
46
46
47
- - Nothing .
47
+ - [ # 204 ] ( https://github.com/zendframework/zend-http/pull/204 ) fixes numerous header classes to cast field value to string (since ` HeaderInterface::getFieldValue() ` specifies a return value of a string) .
48
48
49
49
## 2.11.0 - 2019-12-03
50
50
Original file line number Diff line number Diff line change @@ -27,14 +27,12 @@ public static function fromString($headerLine)
27
27
);
28
28
}
29
29
30
- $ header = new static ($ value );
31
-
32
- return $ header ;
30
+ return new static ($ value );
33
31
}
34
32
35
33
public function __construct ($ rangeUnit = null )
36
34
{
37
- if ($ rangeUnit ) {
35
+ if ($ rangeUnit !== null ) {
38
36
$ this ->setRangeUnit ($ rangeUnit );
39
37
}
40
38
}
@@ -58,7 +56,7 @@ public function setRangeUnit($rangeUnit)
58
56
59
57
public function getRangeUnit ()
60
58
{
61
- return $ this ->rangeUnit ;
59
+ return ( string ) $ this ->rangeUnit ;
62
60
}
63
61
64
62
public function toString ()
Original file line number Diff line number Diff line change @@ -37,14 +37,12 @@ public static function fromString($headerLine)
37
37
throw new Exception \InvalidArgumentException ('Invalid header line for Age string: " ' . $ name . '" ' );
38
38
}
39
39
40
- $ header = new static ($ value );
41
-
42
- return $ header ;
40
+ return new static ($ value );
43
41
}
44
42
45
43
public function __construct ($ deltaSeconds = null )
46
44
{
47
- if ($ deltaSeconds ) {
45
+ if ($ deltaSeconds !== null ) {
48
46
$ this ->setDeltaSeconds ($ deltaSeconds );
49
47
}
50
48
}
@@ -62,11 +60,11 @@ public function getFieldName()
62
60
/**
63
61
* Get header value (number of seconds)
64
62
*
65
- * @return int
63
+ * @return string
66
64
*/
67
65
public function getFieldValue ()
68
66
{
69
- return $ this ->getDeltaSeconds ();
67
+ return ( string ) $ this ->getDeltaSeconds ();
70
68
}
71
69
72
70
/**
Original file line number Diff line number Diff line change @@ -31,14 +31,12 @@ public static function fromString($headerLine)
31
31
}
32
32
33
33
// @todo implementation details
34
- $ header = new static ($ value );
35
-
36
- return $ header ;
34
+ return new static ($ value );
37
35
}
38
36
39
37
public function __construct ($ value = null )
40
38
{
41
- if ($ value ) {
39
+ if ($ value !== null ) {
42
40
HeaderValue::assertValid ($ value );
43
41
$ this ->value = $ value ;
44
42
}
@@ -51,7 +49,7 @@ public function getFieldName()
51
49
52
50
public function getFieldValue ()
53
51
{
54
- return $ this ->value ;
52
+ return ( string ) $ this ->value ;
55
53
}
56
54
57
55
public function toString ()
Original file line number Diff line number Diff line change @@ -31,14 +31,12 @@ public static function fromString($headerLine)
31
31
}
32
32
33
33
// @todo implementation details
34
- $ header = new static ($ value );
35
-
36
- return $ header ;
34
+ return new static ($ value );
37
35
}
38
36
39
37
public function __construct ($ value = null )
40
38
{
41
- if ($ value ) {
39
+ if ($ value !== null ) {
42
40
HeaderValue::assertValid ($ value );
43
41
$ this ->value = $ value ;
44
42
}
@@ -51,7 +49,7 @@ public function getFieldName()
51
49
52
50
public function getFieldValue ()
53
51
{
54
- return $ this ->value ;
52
+ return ( string ) $ this ->value ;
55
53
}
56
54
57
55
public function toString ()
Original file line number Diff line number Diff line change @@ -31,14 +31,12 @@ public static function fromString($headerLine)
31
31
}
32
32
33
33
// @todo implementation details
34
- $ header = new static ($ value );
35
-
36
- return $ header ;
34
+ return new static ($ value );
37
35
}
38
36
39
37
public function __construct ($ value = null )
40
38
{
41
- if ($ value ) {
39
+ if ($ value !== null ) {
42
40
HeaderValue::assertValid ($ value );
43
41
$ this ->value = $ value ;
44
42
}
@@ -51,7 +49,7 @@ public function getFieldName()
51
49
52
50
public function getFieldValue ()
53
51
{
54
- return $ this ->value ;
52
+ return ( string ) $ this ->value ;
55
53
}
56
54
57
55
public function toString ()
Original file line number Diff line number Diff line change @@ -30,14 +30,12 @@ public static function fromString($headerLine)
30
30
}
31
31
32
32
// @todo implementation details
33
- $ header = new static ($ value );
34
-
35
- return $ header ;
33
+ return new static ($ value );
36
34
}
37
35
38
36
public function __construct ($ value = null )
39
37
{
40
- if ($ value ) {
38
+ if ($ value !== null ) {
41
39
HeaderValue::assertValid ($ value );
42
40
$ this ->value = $ value ;
43
41
}
@@ -50,7 +48,7 @@ public function getFieldName()
50
48
51
49
public function getFieldValue ()
52
50
{
53
- return $ this ->value ;
51
+ return ( string ) $ this ->value ;
54
52
}
55
53
56
54
public function toString ()
Original file line number Diff line number Diff line change @@ -31,14 +31,12 @@ public static function fromString($headerLine)
31
31
}
32
32
33
33
// @todo implementation details
34
- $ header = new static ($ value );
35
-
36
- return $ header ;
34
+ return new static ($ value );
37
35
}
38
36
39
37
public function __construct ($ value = null )
40
38
{
41
- if ($ value ) {
39
+ if ($ value !== null ) {
42
40
HeaderValue::assertValid ($ value );
43
41
$ this ->value = $ value ;
44
42
}
@@ -51,7 +49,7 @@ public function getFieldName()
51
49
52
50
public function getFieldValue ()
53
51
{
54
- return $ this ->value ;
52
+ return ( string ) $ this ->value ;
55
53
}
56
54
57
55
public function toString ()
Original file line number Diff line number Diff line change @@ -31,9 +31,7 @@ public static function fromString($headerLine)
31
31
}
32
32
33
33
// @todo implementation details
34
- $ header = new static ($ value );
35
-
36
- return $ header ;
34
+ return new static ($ value );
37
35
}
38
36
39
37
public function __construct ($ value = null )
@@ -51,7 +49,7 @@ public function getFieldName()
51
49
52
50
public function getFieldValue ()
53
51
{
54
- return $ this ->value ;
52
+ return ( string ) $ this ->value ;
55
53
}
56
54
57
55
public function toString ()
Original file line number Diff line number Diff line change @@ -28,14 +28,12 @@ public static function fromString($headerLine)
28
28
}
29
29
30
30
// @todo implementation details
31
- $ header = new static ($ value );
32
-
33
- return $ header ;
31
+ return new static ($ value );
34
32
}
35
33
36
34
public function __construct ($ value = null )
37
35
{
38
- if ($ value ) {
36
+ if ($ value !== null ) {
39
37
HeaderValue::assertValid ($ value );
40
38
$ this ->value = $ value ;
41
39
}
@@ -48,7 +46,7 @@ public function getFieldName()
48
46
49
47
public function getFieldValue ()
50
48
{
51
- return $ this ->value ;
49
+ return ( string ) $ this ->value ;
52
50
}
53
51
54
52
public function toString ()
Original file line number Diff line number Diff line change @@ -31,14 +31,12 @@ public static function fromString($headerLine)
31
31
}
32
32
33
33
// @todo implementation details
34
- $ header = new static ($ value );
35
-
36
- return $ header ;
34
+ return new static ($ value );
37
35
}
38
36
39
37
public function __construct ($ value = null )
40
38
{
41
- if ($ value ) {
39
+ if ($ value !== null ) {
42
40
HeaderValue::assertValid ($ value );
43
41
$ this ->value = $ value ;
44
42
}
@@ -51,7 +49,7 @@ public function getFieldName()
51
49
52
50
public function getFieldValue ()
53
51
{
54
- return $ this ->value ;
52
+ return ( string ) $ this ->value ;
55
53
}
56
54
57
55
public function toString ()
Original file line number Diff line number Diff line change @@ -31,14 +31,12 @@ public static function fromString($headerLine)
31
31
}
32
32
33
33
// @todo implementation details
34
- $ header = new static (strtolower ($ value ));
35
-
36
- return $ header ;
34
+ return new static (strtolower ($ value ));
37
35
}
38
36
39
37
public function __construct ($ value = null )
40
38
{
41
- if ($ value ) {
39
+ if ($ value !== null ) {
42
40
HeaderValue::assertValid ($ value );
43
41
$ this ->value = $ value ;
44
42
}
@@ -51,7 +49,7 @@ public function getFieldName()
51
49
52
50
public function getFieldValue ()
53
51
{
54
- return $ this ->value ;
52
+ return ( string ) $ this ->value ;
55
53
}
56
54
57
55
public function toString ()
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ public static function fromString($headerLine)
69
69
70
70
public function __construct ($ value = null , $ mediaType = null )
71
71
{
72
- if ($ value ) {
72
+ if ($ value !== null ) {
73
73
HeaderValue::assertValid ($ value );
74
74
$ this ->value = $ value ;
75
75
}
@@ -146,7 +146,7 @@ public function getFieldName()
146
146
public function getFieldValue ()
147
147
{
148
148
if (null !== $ this ->value ) {
149
- return $ this ->value ;
149
+ return ( string ) $ this ->value ;
150
150
}
151
151
return $ this ->assembleValue ();
152
152
}
@@ -172,7 +172,7 @@ public function setMediaType($mediaType)
172
172
*/
173
173
public function getMediaType ()
174
174
{
175
- return $ this ->mediaType ;
175
+ return ( string ) $ this ->mediaType ;
176
176
}
177
177
178
178
/**
Original file line number Diff line number Diff line change @@ -28,14 +28,12 @@ public static function fromString($headerLine)
28
28
}
29
29
30
30
// @todo implementation details
31
- $ header = new static ($ value );
32
-
33
- return $ header ;
31
+ return new static ($ value );
34
32
}
35
33
36
34
public function __construct ($ value = null )
37
35
{
38
- if ($ value ) {
36
+ if ($ value !== null ) {
39
37
HeaderValue::assertValid ($ value );
40
38
$ this ->value = $ value ;
41
39
}
@@ -48,7 +46,7 @@ public function getFieldName()
48
46
49
47
public function getFieldValue ()
50
48
{
51
- return $ this ->value ;
49
+ return ( string ) $ this ->value ;
52
50
}
53
51
54
52
public function toString ()
Original file line number Diff line number Diff line change @@ -28,14 +28,12 @@ public static function fromString($headerLine)
28
28
}
29
29
30
30
// @todo implementation details
31
- $ header = new static ($ value );
32
-
33
- return $ header ;
31
+ return new static ($ value );
34
32
}
35
33
36
34
public function __construct ($ value = null )
37
35
{
38
- if ($ value ) {
36
+ if ($ value !== null ) {
39
37
HeaderValue::assertValid ($ value );
40
38
$ this ->value = $ value ;
41
39
}
@@ -48,7 +46,7 @@ public function getFieldName()
48
46
49
47
public function getFieldValue ()
50
48
{
51
- return $ this ->value ;
49
+ return ( string ) $ this ->value ;
52
50
}
53
51
54
52
public function toString ()
Original file line number Diff line number Diff line change @@ -28,14 +28,12 @@ public static function fromString($headerLine)
28
28
}
29
29
30
30
// @todo implementation details
31
- $ header = new static ($ value );
32
-
33
- return $ header ;
31
+ return new static ($ value );
34
32
}
35
33
36
34
public function __construct ($ value = null )
37
35
{
38
- if ($ value ) {
36
+ if ($ value !== null ) {
39
37
HeaderValue::assertValid ($ value );
40
38
$ this ->value = $ value ;
41
39
}
@@ -48,7 +46,7 @@ public function getFieldName()
48
46
49
47
public function getFieldValue ()
50
48
{
51
- return $ this ->value ;
49
+ return ( string ) $ this ->value ;
52
50
}
53
51
54
52
public function toString ()
You can’t perform that action at this time.
0 commit comments