File tree Expand file tree Collapse file tree 7 files changed +22
-26
lines changed Expand file tree Collapse file tree 7 files changed +22
-26
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ Shop at your favorite stores today and experience the freedom to pay later with
13
13
SDK covers all of Klarna API: https://developers.klarna.com/api/
14
14
15
15
### Prerequisites
16
- * PHP 7 .1 or above
16
+ * PHP 8 .1 or above
17
17
* [ API credentials] ( #api-credentials )
18
18
* [ Composer] ( https://getcomposer.org/ ) (optional)
19
19
Original file line number Diff line number Diff line change 21
21
},
22
22
"require-dev" : {
23
23
"phpunit/phpunit" : " ~10.0" ,
24
- "squizlabs/php_codesniffer" : " 1.5.* " ,
24
+ "squizlabs/php_codesniffer" : " ^3.0 " ,
25
25
"phpmd/phpmd" : " 2.1.*" ,
26
- "phploc/phploc" : " 2.0.*" ,
27
26
"php-coveralls/php-coveralls" : " ^2.1" ,
28
27
"apigen/apigen" : " 4.1.*" ,
29
28
"klarna/apigen-theme" : " 2.1.0"
38
37
],
39
38
"analyze" : [
40
39
" mkdir -p build/logs" ,
41
- " vendor/bin/phploc --log-csv build/logs/phploc.csv src/ tests/" ,
42
- " mkdir -p build/pdepend" ,
43
- " vendor/bin/pdepend --jdepend-xml=build/logs/jdepend.xml --jdepend-chart=build/pdepend/dependencies.svg --overview-pyramid=build/pdepend/overview-pyramid.svg src/" ,
44
- " vendor/bin/phpmd src/,tests/ xml phpmd.xml --reportfile build/logs/pmd.xml || true" ,
45
- " vendor/bin/phpcs --standard=PSR2 --report=checkstyle --report-file=build/logs/checkstyle.xml --extensions=php src/ tests/" ,
46
- " vendor/bin/phpcpd --log-pmd build/logs/pmd-cpd.xml src/ tests/ || true"
40
+ " vendor/bin/phpcs --standard=PSR2 --report=checkstyle --report-file=build/logs/checkstyle.xml --extensions=php src/ tests/"
47
41
]
48
42
}
49
43
}
Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ public function setLocation($url)
106
106
/**
107
107
* Overrides: Stores the ID KEY field in order to restore it after exchanging the array without
108
108
* the ID field.
109
- *
109
+ *
110
110
* @param array $array Data to be exchanged
111
111
*/
112
112
public function exchangeArray ($ array ): array
Original file line number Diff line number Diff line change @@ -104,8 +104,9 @@ public function setHeaders(array $headers)
104
104
$ this ->headerNames = $ this ->headers = [];
105
105
foreach ($ headers as $ header => $ value ) {
106
106
if (is_int ($ header )) {
107
- // Numeric array keys are converted to int by PHP but having a header name '123' is not forbidden by the spec
108
- // and also allowed in withHeader(). So we need to cast it to string again for the following assertion to pass.
107
+ // Numeric array keys are converted to int by PHP but having a header name '123' is not forbidden
108
+ // by the spec and also allowed in withHeader().
109
+ // So we need to cast it to string again for the following assertion to pass.
109
110
$ header = (string ) $ header ;
110
111
}
111
112
$ this ->assertHeader ($ header );
Original file line number Diff line number Diff line change @@ -88,7 +88,8 @@ public function __construct(
88
88
89
89
if ($ userAgent === null ) {
90
90
$ class = new \ReflectionClass ($ client );
91
- $ version = $ class ->hasConstant ('MAJOR_VERSION ' ) ? $ class ->getConstant ('MAJOR_VERSION ' ) : $ class ->getConstant ('VERSION ' );
91
+ $ version = $ class ->hasConstant ('MAJOR_VERSION ' ) ? $ class ->getConstant ('MAJOR_VERSION ' ) :
92
+ $ class ->getConstant ('VERSION ' );
92
93
$ userAgent = UserAgent::createDefault (['Guzzle/ ' . $ version ]);
93
94
}
94
95
$ this ->userAgent = $ userAgent ;
Original file line number Diff line number Diff line change @@ -117,6 +117,6 @@ public function testHandlingExceptionsUnauthorized()
117
117
118
118
putenv ('PASSWORD=wrong_password ' );
119
119
$ output = $ this ->execFile ($ this ->rootPath . '/docs/examples/CheckoutAPI/handling_exceptions.php ' );
120
- $ this ->assertTrue ($ this ->isTextPresents ('Unexpected response HTTP status 401 ' , $ output ));
120
+ $ this ->assertTrue ($ this ->isTextPresents ('Code: 401 ' , $ output ));
121
121
}
122
122
}
Original file line number Diff line number Diff line change @@ -74,12 +74,12 @@ public function testCreate()
74
74
->will ($ this ->returnValue ('{} ' ));
75
75
76
76
77
- $ this ->response ->expects ($ this ->exactly (2 ))
78
- ->method ('getHeader ' )
79
- ->willReturnMap ([
80
- ['Content-Type ' , ['application/json ' ]],
81
- ['Location ' , ['http://somewhere/a-path ' ]]
82
- ]);
77
+ $ this ->response ->expects ($ this ->exactly (2 ))
78
+ ->method ('getHeader ' )
79
+ ->willReturnMap ([
80
+ ['Content-Type ' , ['application/json ' ]],
81
+ ['Location ' , ['http://somewhere/a-path ' ]]
82
+ ]);
83
83
84
84
$ order = new Order ($ this ->connector );
85
85
$ location = $ order ->create ($ data )
@@ -126,12 +126,12 @@ public function testCreateNoContentType()
126
126
->method ('getStatus ' )
127
127
->will ($ this ->returnValue ('201 ' ));
128
128
129
- $ this ->response
130
- ->expects ($ this ->exactly (1 ))
131
- ->method ('getHeader ' )
132
- ->willReturnMap ([
133
- ['Content-Type ' , []]
134
- ]);
129
+ $ this ->response
130
+ ->expects ($ this ->exactly (1 ))
131
+ ->method ('getHeader ' )
132
+ ->willReturnMap ([
133
+ ['Content-Type ' , []]
134
+ ]);
135
135
136
136
$ order = new Order ($ this ->connector );
137
137
You can’t perform that action at this time.
0 commit comments