This repository was archived by the owner on Jan 30, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +8
-11
lines changed Expand file tree Collapse file tree 3 files changed +8
-11
lines changed 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 @@ -16,6 +16,7 @@ class HeaderTest extends TestCase
16
16
public function header ()
17
17
{
18
18
// @codingStandardsIgnoreStart
19
+ yield Header \AcceptRanges::class => [Header \AcceptRanges::class, 'Accept-Ranges ' ];
19
20
yield Header \AuthenticationInfo::class => [Header \AuthenticationInfo::class, 'Authentication-Info ' ];
20
21
yield Header \Authorization::class => [Header \Authorization::class, 'Authorization ' ];
21
22
yield Header \ContentDisposition::class => [Header \ContentDisposition::class, 'Content-Disposition ' ];
You can’t perform that action at this time.
0 commit comments