Skip to content

Commit 4a4fd0b

Browse files
Adding test coverage for PHP 8.4
Bumping dev dependencies
1 parent c9046fa commit 4a4fd0b

File tree

15 files changed

+77
-70
lines changed

15 files changed

+77
-70
lines changed

.github/workflows/php.yml renamed to .github/workflows/coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
php-version: [8.2, 8.3]
17+
php-version: [8.2, 8.3, 8.4]
1818

1919
runs-on: ubuntu-latest
2020

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
vendor/
22
build/
3+
.vscode/
34
.phpunit.cache/
4-
composer.lock
5-
.phpunit.result.cache
5+
composer.lock

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 nimbly.io
3+
Copyright (c) 2025 nimbly.io
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
analyze:
2+
vendor/bin/psalm
3+
14
test:
2-
vendor/bin/phpunit
5+
vendor/bin/phpunit --display-deprecations
36

47
coverage:
5-
php -d xdebug.mode=coverage vendor/bin/phpunit --coverage-clover=build/logs/clover.xml
6-
7-
analyze:
8-
vendor/bin/psalm
8+
php -d xdebug.mode=coverage vendor/bin/phpunit --display-deprecations --coverage-clover=build/logs/clover.xml

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
# Shuttle
22
[![Latest Stable Version](https://img.shields.io/packagist/v/nimbly/Shuttle.svg?style=flat-square)](https://packagist.org/packages/nimbly/Shuttle)
3-
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/nimbly/shuttle/php.yml?style=flat-square)](https://github.com/nimbly/Shuttle/actions/workflows/php.yml)
3+
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/nimbly/shuttle/coverage.yml?style=flat-square)](https://github.com/nimbly/Shuttle/actions/workflows/coverage.yml)
44
[![Codecov branch](https://img.shields.io/codecov/c/github/nimbly/shuttle/master?style=flat-square)](https://app.codecov.io/github/nimbly/Shuttle)
55
[![License](https://img.shields.io/github/license/nimbly/Shuttle.svg?style=flat-square)](https://packagist.org/packages/nimbly/Shuttle)
66

77

88
A simple PSR-18 HTTP client library.
99

10+
## Requirements
11+
12+
* PHP 8.2+
13+
* ext-curl
14+
1015
## Installation
16+
1117
```bash
1218
composer require nimbly/shuttle
1319
```
@@ -17,6 +23,7 @@ composer require nimbly/shuttle
1723
* cURL (default) and Stream Context handlers supported.
1824
* Middleware support out of the box.
1925
* Easy body transformations when creating requests with JsonBody and FormBody helper classes.
26+
* Support for multipart form bodies.
2027

2128
## Not features
2229
* Asynchronous calls.

composer.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,8 @@
3232
}
3333
},
3434
"require-dev": {
35-
"vimeo/psalm": "^5.0",
36-
"phpunit/phpunit": "^9.0",
37-
"php-coveralls/php-coveralls": "^2.1",
35+
"vimeo/psalm": "^6.0",
36+
"phpunit/phpunit": "^10.0",
3837
"symfony/var-dumper": "^5.0",
3938
"guzzlehttp/psr7": "^2.7"
4039
},

phpunit.xml

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,23 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.4/phpunit.xsd"
4-
bootstrap="vendor/autoload.php"
5-
cacheResultFile=".phpunit.cache/test-results"
6-
executionOrder="depends,defects"
7-
forceCoversAnnotation="true"
8-
beStrictAboutCoversAnnotation="true"
9-
beStrictAboutOutputDuringTests="true"
10-
beStrictAboutTodoAnnotatedTests="true"
11-
failOnRisky="true"
12-
failOnWarning="true"
13-
verbose="true"
14-
colors="true">
15-
<testsuites>
16-
<testsuite name="default">
17-
<directory suffix="Test.php">tests</directory>
18-
</testsuite>
19-
</testsuites>
20-
21-
<coverage cacheDirectory=".phpunit.cache/code-coverage"
22-
processUncoveredFiles="true">
23-
<include>
24-
<directory suffix=".php">src</directory>
25-
</include>
26-
</coverage>
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
4+
bootstrap="vendor/autoload.php"
5+
executionOrder="depends,defects"
6+
beStrictAboutOutputDuringTests="true"
7+
failOnRisky="true"
8+
failOnWarning="true"
9+
colors="true"
10+
cacheDirectory=".phpunit.cache"
11+
requireCoverageMetadata="true"
12+
beStrictAboutCoverageMetadata="true">
13+
<testsuites>
14+
<testsuite name="default">
15+
<directory suffix="Test.php">tests</directory>
16+
</testsuite>
17+
</testsuites>
18+
<source>
19+
<include>
20+
<directory suffix=".php">src</directory>
21+
</include>
22+
</source>
2723
</phpunit>

psalm.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
88
findUnusedBaselineEntry="false"
99
findUnusedCode="false"
10+
ensureOverrideAttribute="false"
1011
>
1112
<projectFiles>
1213
<directory name="src" />

src/Body/BufferBody.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ public function getContentType(): string
3939
public function getMultiPart(string $boundary, ?string $name = null): string
4040
{
4141
return \sprintf(
42-
"\r\n--%s\r\nContent-Disposition: form-data; name=\"%s\"\r\nContent-Type: %s\r\n\r\n%s",
42+
"\r\n--%s".
43+
"\r\nContent-Disposition: form-data; name=\"%s\"".
44+
"\r\nContent-Type: %s".
45+
"\r\n\r\n%s",
4346
$boundary,
4447
$name ?? "form",
4548
$this->getContentType(),

src/Body/FileUploadBody.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Psr\Http\Message\StreamInterface;
88

99
/**
10-
* Useable only within in a MultpartFormBody.
10+
* Useable only within a MultpartFormBody instance.
1111
*/
1212
class FileUploadBody extends BufferBody
1313
{
@@ -62,7 +62,11 @@ public function getMultiPart(string $boundary, ?string $name = null): string
6262
}
6363

6464
return \sprintf(
65-
"\r\n--%s\r\nContent-Disposition: form-data; name=\"%s\"; filename=\"%s\"\r\nContent-Type: %s\r\nContent-Length: %s\r\n\r\n%s",
65+
"\r\n--%s".
66+
"\r\nContent-Disposition: form-data; name=\"%s\"; filename=\"%s\"".
67+
"\r\nContent-Type: %s".
68+
"\r\nContent-Length: %s".
69+
"\r\n\r\n%s",
6670
$boundary,
6771
$name ?? "file",
6872
$this->file_name,

0 commit comments

Comments
 (0)