File tree Expand file tree Collapse file tree 16 files changed +73
-2
lines changed Expand file tree Collapse file tree 16 files changed +73
-2
lines changed Original file line number Diff line number Diff line change 4
4
5
5
namespace Bakame \Http \StructuredFields ;
6
6
7
+ use function base64_decode ;
8
+ use function base64_encode ;
9
+ use function preg_match ;
10
+
7
11
final class ByteSequence implements StructuredField
8
12
{
9
13
private function __construct (private string $ value )
Original file line number Diff line number Diff line change 4
4
5
5
namespace Bakame \Http \StructuredFields ;
6
6
7
+ use function var_export ;
8
+
7
9
/**
8
10
* @coversDefaultClass \Bakame\Http\StructuredFields\ByteSequence
9
11
*/
Original file line number Diff line number Diff line change 7
7
use Countable ;
8
8
use Iterator ;
9
9
use IteratorAggregate ;
10
+ use function array_key_exists ;
11
+ use function array_keys ;
12
+ use function array_values ;
13
+ use function count ;
14
+ use function implode ;
15
+ use function preg_match ;
10
16
11
17
/**
12
18
* @implements IteratorAggregate<array-key, Item|InnerList>
Original file line number Diff line number Diff line change 4
4
5
5
namespace Bakame \Http \StructuredFields ;
6
6
7
+ use function iterator_to_array ;
8
+ use function var_export ;
9
+
7
10
final class DictionaryTest extends StructuredFieldTest
8
11
{
9
12
/** @var array|string[] */
Original file line number Diff line number Diff line change 7
7
use Countable ;
8
8
use Iterator ;
9
9
use IteratorAggregate ;
10
+ use function array_map ;
11
+ use function array_splice ;
12
+ use function array_values ;
13
+ use function count ;
10
14
11
15
/**
12
16
* @implements IteratorAggregate<array-key, Item>
Original file line number Diff line number Diff line change 5
5
namespace Bakame \Http \StructuredFields ;
6
6
7
7
use PHPUnit \Framework \TestCase ;
8
+ use function iterator_to_array ;
9
+ use function var_export ;
8
10
9
11
/**
10
12
* @coversDefaultClass \Bakame\Http\StructuredFields\InnerList
Original file line number Diff line number Diff line change 4
4
5
5
namespace Bakame \Http \StructuredFields ;
6
6
7
+ use function in_array ;
8
+ use function is_bool ;
9
+ use function is_float ;
10
+ use function is_int ;
11
+ use function is_string ;
12
+ use function json_encode ;
13
+ use function preg_match ;
14
+ use function preg_replace ;
15
+ use function round ;
16
+ use function str_contains ;
17
+ use function strlen ;
18
+ use function substr ;
19
+ use function trim ;
20
+
7
21
final class Item implements StructuredField, SupportsParameters
8
22
{
9
23
private function __construct (
@@ -30,7 +44,7 @@ public static function from(
30
44
iterable $ parameters = []
31
45
): self {
32
46
return new self (match (true ) {
33
- is_integer ($ value ) => self ::filterInteger ($ value ),
47
+ is_int ($ value ) => self ::filterInteger ($ value ),
34
48
is_float ($ value ) => self ::filterDecimal ($ value ),
35
49
is_string ($ value ) => self ::filterString ($ value ),
36
50
default => $ value ,
@@ -182,7 +196,7 @@ private static function parseString(string $string): array
182
196
$ string = substr ($ string , 1 );
183
197
$ returnValue = '' ;
184
198
185
- while (strlen ( $ string) ) {
199
+ while ('' !== $ string ) {
186
200
$ char = $ string [0 ];
187
201
$ string = substr ($ string , 1 );
188
202
Original file line number Diff line number Diff line change 5
5
namespace Bakame \Http \StructuredFields ;
6
6
7
7
use ArrayObject ;
8
+ use function var_export ;
8
9
9
10
final class ItemTest extends StructuredFieldTest
10
11
{
Original file line number Diff line number Diff line change 7
7
use Countable ;
8
8
use Iterator ;
9
9
use IteratorAggregate ;
10
+ use function array_map ;
11
+ use function array_splice ;
12
+ use function array_values ;
13
+ use function count ;
14
+ use function implode ;
15
+ use function is_int ;
10
16
11
17
/**
12
18
* @implements IteratorAggregate<array-key, Item|InnerList>
Original file line number Diff line number Diff line change 7
7
use Countable ;
8
8
use Iterator ;
9
9
use IteratorAggregate ;
10
+ use function array_key_exists ;
11
+ use function array_keys ;
12
+ use function array_values ;
13
+ use function count ;
14
+ use function explode ;
15
+ use function ltrim ;
16
+ use function preg_match ;
17
+ use function rtrim ;
18
+ use function trim ;
10
19
11
20
/**
12
21
* @implements IteratorAggregate<string, Item>
Original file line number Diff line number Diff line change 4
4
5
5
namespace Bakame \Http \StructuredFields ;
6
6
7
+ use function iterator_to_array ;
8
+ use function var_export ;
9
+
7
10
/**
8
11
* @coversDefaultClass \Bakame\Http\StructuredFields\Parameters
9
12
*/
Original file line number Diff line number Diff line change 4
4
5
5
namespace Bakame \Http \StructuredFields ;
6
6
7
+ use function in_array ;
8
+ use function ltrim ;
9
+ use function ord ;
10
+ use function preg_match ;
11
+ use function preg_quote ;
12
+ use function strlen ;
13
+ use function substr ;
14
+
7
15
/**
8
16
* A parser to create HTTP Structured Fields value objects from HTTP textual representation.
9
17
*
Original file line number Diff line number Diff line change 8
8
use IteratorAggregate ;
9
9
use JsonException ;
10
10
use RuntimeException ;
11
+ use function fclose ;
12
+ use function fopen ;
13
+ use function is_resource ;
14
+ use function json_decode ;
15
+ use function stream_get_contents ;
11
16
12
17
/**
13
18
* @implements IteratorAggregate<string, TestUnit>
Original file line number Diff line number Diff line change 5
5
namespace Bakame \Http \StructuredFields ;
6
6
7
7
use JsonException ;
8
+ use function json_decode ;
8
9
9
10
final class TestUnit
10
11
{
Original file line number Diff line number Diff line change 4
4
5
5
namespace Bakame \Http \StructuredFields ;
6
6
7
+ use function preg_match ;
8
+
7
9
final class Token implements StructuredField
8
10
{
9
11
public function __construct (private string $ value )
Original file line number Diff line number Diff line change 5
5
namespace Bakame \Http \StructuredFields ;
6
6
7
7
use PHPUnit \Framework \TestCase ;
8
+ use function var_export ;
8
9
9
10
/**
10
11
* @coversDefaultClass \Bakame\Http\StructuredFields\Token
You can’t perform that action at this time.
0 commit comments