Skip to content

Commit a130d68

Browse files
authored
Merge pull request #12 from phpugph/1.0
1.0
2 parents 041bf63 + 4568d2e commit a130d68

File tree

5 files changed

+16
-15
lines changed

5 files changed

+16
-15
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
],
99
"license": "MIT",
1010
"require-dev": {
11+
"php-coveralls/php-coveralls": "2.5.2",
1112
"phpunit/phpunit": "9.5.21",
12-
"squizlabs/php_codesniffer": "3.7.1",
13-
"php-coveralls/php-coveralls": "2.5.2"
13+
"squizlabs/php_codesniffer": "3.7.1"
1414
},
1515
"require": {
1616
"php": ">=8.1"

src/Curl/CurlHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class CurlHandler implements ArrayAccess
126126
*
127127
* @return mixed
128128
*/
129-
public function __call($name, $args)
129+
public function __call(string $name, $args)
130130
{
131131
if (strpos($name, 'set') === 0) {
132132
//'AutoReferer' => CURLOPT_AUTOREFERER,

src/IO/Request/ServerTrait.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ trait ServerTrait
2424
*/
2525
public function getMethod()
2626
{
27-
return strtoupper((string) $this->get('method'));
27+
return strtoupper($this->get('method') ?? '');
2828
}
2929

3030
/**
@@ -113,7 +113,7 @@ public function isCLI(): bool
113113
*/
114114
public function isMethod(string $method): bool
115115
{
116-
return strtoupper($method) === strtoupper((string) $this->get('method'));
116+
return strtoupper($method) === strtoupper($this->get('method') ?? '');
117117
}
118118

119119
/**
@@ -177,7 +177,7 @@ public function setHost(string $protocol)
177177
$hostpath = substr($hostpath, 0, strpos($hostpath, '?') + 1);
178178
}
179179

180-
$hostdir = pathinfo($hostpath, PATHINFO_DIRNAME);
180+
$hostdir = pathinfo($hostpath ?? '', PATHINFO_DIRNAME);
181181

182182
$this->setDot('host.protocol', $protocol);
183183

src/IO/Response/ContentTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function getContent()
3535
public function hasContent(): bool
3636
{
3737
$body = $this->get('body');
38-
return !is_null($body) && strlen((string) $body);
38+
return !is_null($body) && strlen($body);
3939
}
4040

4141
/**

src/Image/ImageHandler.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -288,14 +288,15 @@ public function crop($width = null, $height = null)
288288

289289
//render the image
290290
imagecopyresampled(
291-
$crop,
292-
$this->resource,
293-
0, 0,
294-
floor($xPosition),
295-
floor($yPosition),
296-
floor($width),
297-
floor($height),
298-
floor($orgWidth),
291+
$crop,
292+
$this->resource,
293+
0,
294+
0,
295+
floor($xPosition),
296+
floor($yPosition),
297+
floor($width),
298+
floor($height),
299+
floor($orgWidth),
299300
floor($orgHeight)
300301
);
301302

0 commit comments

Comments
 (0)