Skip to content

Commit 630ba51

Browse files
authoredMar 1, 2025··
Add PHP 8.4 tests (#64)
1 parent 2ff0c41 commit 630ba51

File tree

6 files changed

+40
-176
lines changed

6 files changed

+40
-176
lines changed
 

‎.docker/php/php84/Dockerfile

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# ----------------------
2+
# The FPM base container
3+
# ----------------------
4+
FROM php:8.4-cli-alpine AS dev
5+
6+
RUN apk add --no-cache --virtual .build-deps \
7+
$PHPIZE_DEPS
8+
9+
# Cleanup apk cache and temp files
10+
RUN rm -rf /var/cache/apk/* /tmp/*
11+
12+
# ----------------------
13+
# Composer install step
14+
# ----------------------
15+
16+
# Get latest Composer
17+
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
18+
19+
# ----------------------
20+
# The FPM production container
21+
# ----------------------
22+
FROM dev

‎.github/workflows/tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
fail-fast: true
1010
matrix:
1111
os: [ ubuntu-latest ]
12-
php: [ 8.1, 8.2, 8.3 ]
12+
php: [ 8.1, 8.2, 8.3, 8.4 ]
1313
dependency-version: [ prefer-lowest, prefer-stable ]
1414

1515
name: P${{ matrix.php }} - ${{ matrix.dependency-version }}

‎CHANGELOG.md

+2-171
Original file line numberDiff line numberDiff line change
@@ -1,174 +1,5 @@
11
# Changelog
22

3-
All notable changes to `cybercog/youtrack-rest-php` will be documented in this file.
3+
All notable changes to `cybercog/youtrack-rest-php` are documented in [PHP YouTrack REST releases] page.
44

5-
## [Unreleased]
6-
7-
## [8.0.0] - 2024-02-22
8-
9-
### Added
10-
11-
- ([#59]) Added Docker dev environment
12-
13-
### Changed
14-
15-
- ([#58]) Bumped minimum Guzzle version to v7
16-
- ([#59]) Raised minimum PHP version to v8.1
17-
- ([#60]) Enforced class properties strict types
18-
- ([#61]) Enforced readonly modifier on class properties
19-
20-
## [7.0.0] - 2022-10-02
21-
22-
### Changed
23-
24-
- ([#57]) Changed default endpoint prefix from `rest` to `api`
25-
26-
## [6.3.0] - 2021-01-01
27-
28-
### Added
29-
30-
- ([#51]) Added PHP 8.x support
31-
32-
## [6.2.2] - 2020-07-19
33-
34-
### Fixed
35-
36-
- ([#49]) Fixes from PHPStan static analysis
37-
38-
## [6.2.1] - 2020-07-19
39-
40-
### Fixed
41-
42-
- ([#48]) Fix $endpointPathPrefix class parameter
43-
44-
## [6.2.0] - 2019-10-18
45-
46-
### Added
47-
48-
- ([#43]) Configurable API endpoint prefix
49-
50-
## [6.1.0] - 2018-06-30
51-
52-
### Added
53-
54-
- ([#40]) Multipart requests support for attachments uploads
55-
56-
### Changed
57-
58-
- ([#41]) Add missing `array` type to `$options` argument of `buildOptions` method of `Cog\YouTrack\Rest\Client\YouTrackClient`
59-
60-
## [6.0.2] - 2017-01-10
61-
62-
### Changed
63-
64-
- `Cog\YouTrack\Rest\Client\YouTrackClient` endpoint prefix is relative now ([#39])
65-
66-
## [6.0.0] - 2017-11-20
67-
68-
### Changed
69-
70-
- `Cog\YouTrack\Rest\Authorizer\CookieAuthorizer` stopped to delegate client header manipulation to `Authenticator` ([#32])
71-
- `token` method added to `Cog\Contracts\YouTrack\Rest\Authenticator\Authenticator` contract
72-
- `Cog\Contracts\YouTrack\Rest\Client\Exceptions\ClientException` extends `RuntimeException` instead of `Exception`
73-
- `Cog\Contracts\YouTrack\Rest\Client\Exceptions\HttpClientException` extends `RuntimeException` instead of `Exception`
74-
- `Cog\Contracts\YouTrack\Rest\Authorizer\Exceptions\InvalidTokenException` renamed to `InvalidAuthorizationToken`
75-
76-
### Removed
77-
78-
- Dropped `putHeader` method from `Cog\Contracts\YouTrack\Rest\Client\Client` contract
79-
80-
## [5.0.0] - 2017-09-13
81-
82-
### Changed
83-
84-
- Exceptions moved to `Cog\Contracts\YouTrack` namespace ([#34]).
85-
86-
## [4.0.0] - 2017-08-27
87-
88-
### Changed
89-
90-
- Contracts extracted to `Cog\Contracts\YouTrack` package ([#32]).
91-
- `Cog\YouTrack\Rest\Authenticator\Contracts` moved to `Cog\Contracts\YouTrack\Rest\Authenticator`
92-
- `Cog\YouTrack\Rest\Authorizer\Contracts` moved to `Cog\Contracts\YouTrack\Rest\Authorizer`
93-
- `Cog\YouTrack\Rest\Client\Contracts` moved to `Cog\Contracts\YouTrack\Rest\Client`
94-
- `Cog\YouTrack\Rest\Client\HttpContracts` moved to `Cog\Contracts\YouTrack\Rest\HttpClient`
95-
- `Cog\YouTrack\Rest\Client\Response` moved to `Cog\Contracts\YouTrack\Rest\Response`
96-
97-
## [3.2.0] - 2017-07-29
98-
99-
### Changed
100-
101-
- `withHeader`, `withHeaders` methods to `Client` contract.
102-
- `isClientError` & `isServerError` asserts in `Response` contract.
103-
104-
### Updated
105-
106-
- `putHeader` method marked as deprecated to keep naming consistency and aliased to `withHeader`.
107-
108-
## [3.1.0] - 2017-05-25
109-
110-
### Added
111-
112-
- `isSuccess` & `isReponse` asserts to `Response` contract.
113-
- `header` & `body` methods to `Response` contract.
114-
115-
## [3.0.0] - 2017-05-22
116-
117-
### Added
118-
119-
- `Authenticator` contract and `CookieAuthenticator` implementation.
120-
- `HttpClient` contract and `GuzzleHttpClient` implementation.
121-
- `isStatusCode` assert to `Response` contract.
122-
123-
### Updated
124-
125-
- `CookieAuthorizer` constructor accepts `Authenticator` instead of credentials.
126-
- `TokenAuthorizer` constructor accepts string token instead of array.
127-
- `Authorizer` delegates authentication to `Authenticator`.
128-
- `Client` delegates HTTP requests to `HttpClient`.
129-
- Changed namespace of `AuthenticationException`.
130-
- `getHeaders` method was dropped from `Authorizer` contract.
131-
- `Response` interface methods `getResponse`, `getStatusCode`, `getCookie`, `getLocation` were renamed to `httpResponse`, `statusCode`, `cookie`, `location` respectively.
132-
- `User-Agent` header is more verbose.
133-
- REST Client version is defined in `Client` contract instead of each concrete implementation.
134-
- Additional param `$options` was added to `Client` methods: `request`, `get`, `post`, `put`, `delete`.
135-
136-
## [2.0.1] - 2017-05-21
137-
138-
- Dropped Client `getAuthorizer` & `setAuthorizer` rudiment methods.
139-
140-
## 1.0.0 - 2017-05-12
141-
142-
- Initial release.
143-
144-
[Unreleased]: https://github.com/cybercog/youtrack-rest-php/compare/8.0.0...master
145-
[8.0.0]: https://github.com/cybercog/youtrack-rest-php/compare/7.0.0...8.0.0
146-
[7.0.0]: https://github.com/cybercog/youtrack-rest-php/compare/6.3.0...7.0.0
147-
[6.3.0]: https://github.com/cybercog/youtrack-rest-php/compare/6.2.2...6.3.0
148-
[6.2.2]: https://github.com/cybercog/youtrack-rest-php/compare/6.2.1...6.2.2
149-
[6.2.1]: https://github.com/cybercog/youtrack-rest-php/compare/6.2.0...6.2.1
150-
[6.2.0]: https://github.com/cybercog/youtrack-rest-php/compare/6.1.0...6.2.0
151-
[6.1.0]: https://github.com/cybercog/youtrack-rest-php/compare/6.0.2...6.1.0
152-
[6.0.2]: https://github.com/cybercog/youtrack-rest-php/compare/6.0.1...6.0.2
153-
[6.0.0]: https://github.com/cybercog/youtrack-rest-php/compare/5.0.0...6.0.0
154-
[5.0.0]: https://github.com/cybercog/youtrack-rest-php/compare/4.0.0...5.0.0
155-
[4.0.0]: https://github.com/cybercog/youtrack-rest-php/compare/3.2.0...4.0.0
156-
[3.2.0]: https://github.com/cybercog/youtrack-rest-php/compare/3.1.1...3.2.0
157-
[3.1.0]: https://github.com/cybercog/youtrack-rest-php/compare/3.0.0...3.1.0
158-
[3.0.0]: https://github.com/cybercog/youtrack-rest-php/compare/2.0.1...3.0.0
159-
[2.0.1]: https://github.com/cybercog/youtrack-rest-php/compare/1.0.0...2.0.1
160-
161-
[#61]: https://github.com/cybercog/youtrack-rest-php/pull/61
162-
[#60]: https://github.com/cybercog/youtrack-rest-php/pull/60
163-
[#59]: https://github.com/cybercog/youtrack-rest-php/pull/59
164-
[#58]: https://github.com/cybercog/youtrack-rest-php/pull/58
165-
[#57]: https://github.com/cybercog/youtrack-rest-php/pull/57
166-
[#51]: https://github.com/cybercog/youtrack-rest-php/pull/51
167-
[#49]: https://github.com/cybercog/youtrack-rest-php/pull/49
168-
[#48]: https://github.com/cybercog/youtrack-rest-php/pull/48
169-
[#43]: https://github.com/cybercog/youtrack-rest-php/pull/43
170-
[#41]: https://github.com/cybercog/youtrack-rest-php/pull/41
171-
[#40]: https://github.com/cybercog/youtrack-rest-php/pull/40
172-
[#39]: https://github.com/cybercog/youtrack-rest-php/pull/39
173-
[#34]: https://github.com/cybercog/youtrack-rest-php/pull/34
174-
[#32]: https://github.com/cybercog/youtrack-rest-php/pull/32
5+
[PHP YouTrack REST releases]: https://github.com/cybercog/youtrack-rest-php/releases

‎docker-compose.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,14 @@ services:
3232
working_dir: /app
3333
volumes:
3434
- ./:/app
35+
36+
php84:
37+
container_name: php-youtrack-rest-84
38+
image: php-youtrack-rest
39+
build:
40+
context: ./
41+
dockerfile: ./.docker/php/php84/Dockerfile
42+
tty: true
43+
working_dir: /app
44+
volumes:
45+
- ./:/app

‎src/Authorizer/CookieAuthorizer.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function appendHeadersTo(
3636
$this->authenticator->authenticate($client);
3737

3838
$client->withHeader('Cookie', $this->authenticator->token());
39-
$client->withHeader('Accept', "application/json");
40-
$client->withHeader('Content-Type', "application/json");
39+
$client->withHeader('Accept', 'application/json');
40+
$client->withHeader('Content-Type', 'application/json');
4141
}
4242
}

‎src/Authorizer/TokenAuthorizer.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function appendHeadersTo(
3434
ClientInterface $client,
3535
): void {
3636
$client->withHeader('Authorization', "Bearer {$this->token}");
37-
$client->withHeader('Accept', "application/json");
38-
$client->withHeader('Content-Type', "application/json");
37+
$client->withHeader('Accept', 'application/json');
38+
$client->withHeader('Content-Type', 'application/json');
3939
}
4040
}

0 commit comments

Comments
 (0)
Please sign in to comment.