Skip to content

Commit 2831832

Browse files
fix(deps): Upgrade JanePHP, improve CI, remove PHP 8.0, add Symfony 8 support (#189)
* fix(ci): Add PHP up to 8.5, remove PHP 8.0, add Symfony 8 support * Fix tests * Upgrade Jane and rebuild the client * Fix PHP 8.5, update README and changelog
1 parent 1bf31dc commit 2831832

467 files changed

Lines changed: 28092 additions & 64170 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ jobs:
4545
fail-fast: false
4646
max-parallel: 1 # Avoid rate-limit issue on Slack API
4747
matrix:
48-
php-version: [ '8.0', '8.1', '8.2' ]
48+
php-version: [ '8.1', '8.2', '8.3', '8.4', '8.5' ]
4949
composer-flags: [ '' ]
5050
name: [ '' ]
5151
include:
52-
- php-version: 8.0
52+
- php-version: 8.1
5353
composer-flags: '--prefer-lowest'
5454
name: '(prefer lowest dependencies)'
5555

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
## Unreleased
44

5+
## 4.9.0 (2026-03-10)
6+
7+
* Upgrade JanePHP generated code
8+
* Dropped PHP 8.O support
9+
* Added Symfony 8 support
10+
* Removed `filesUpload` as it's not working anymore on Slack
11+
* New `filesUploadV2` argument to publish in a thread
12+
513
## 4.8.0 (2025-04-01)
614

715
* Upgrade JanePHP generated code

README.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
# A PHP client for Slack's API
1+
<h1 align="center">
2+
<a href="https://github.com/jolicode/slack-php-api"><img src="https://jolicode.com/media/original/oss/headers/slack-php-api.png" alt="Slack PHP API"></a>
3+
<br />
4+
The Complete Slack SDK for PHP
5+
<br />
6+
<sub><em><h6>An automatically generated and up-to-date SDK.</h6></em></sub>
7+
</h1>
8+
9+
<div align="center">
10+
11+
[![PHP Version Require](http://poser.pugx.org/jolicode/slack-php-api/require/php)](https://packagist.org/packages/jolicode/slack-php-api)
12+
[![Monthly Downloads](http://poser.pugx.org/jolicode/slack-php-api/d/monthly)](https://packagist.org/packages/jolicode/slack-php-api)
13+
14+
</div>
215

316
There is a bunch of existing PHP clients for Slack. But some are not up-to-date
417
or miss features, some only cover a small part of the API and most are simply
@@ -8,7 +21,7 @@ This SDK is generated automatically with [JanePHP](https://github.com/janephp/ja
821
from the [official Slack API specs](https://github.com/slackapi/slack-api-specs).
922

1023
It also provides a **full object-oriented interface** for all the endpoints,
11-
requests and responses of the Slack Web API.
24+
requests, and responses of the Slack Web API.
1225

1326
## Installation
1427

@@ -55,7 +68,21 @@ Finally, some meta documentation:
5568
* [versioning and branching models](VERSIONING.md)
5669
* [contribution instructions](CONTRIBUTING.md)
5770

71+
## ⚠ Word of Warning
72+
73+
Slack decided a long time ago to abandon https://github.com/slackapi/slack-api-specs which held the reference
74+
OpenAPI specification for the Slack API. This is a bummer for open-source, open formats, and interoperability.
75+
This library survives on [patches from the community](resources/slack-openapi-sorted.patch)
76+
to make the schema up to date and to add missing features.
77+
5878
## License
5979

6080
This library is licensed under the MIT License - see the [LICENSE](LICENSE.md)
6181
file for details.
82+
83+
This project is not affiliated with Slack Technologies, LLC.
84+
85+
<br><br>
86+
<div align="center">
87+
<a href="https://jolicode.com/"><img src="https://jolicode.com/media/original/oss/footer-github.png?v3" alt="JoliCode is sponsoring this project"></a>
88+
</div>

composer.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,22 @@
2727
},
2828
"require": {
2929
"ext-curl": "*",
30-
"php": ">=8.0",
31-
"jane-php/open-api-runtime": "^7.7",
30+
"php": ">=8.1",
31+
"jane-php/open-api-runtime": "^7.10",
3232
"psr/http-client-implementation": "*",
3333
"php-http/client-common": "^1.9 || ^2.0",
3434
"php-http/discovery": "^1.11",
3535
"php-http/multipart-stream-builder": "^1.1"
3636
},
3737
"require-dev": {
38-
"jane-php/open-api-2": "~v7.6.0",
39-
"symfony/http-client": "^6.0 || ^7.0",
38+
"jane-php/open-api-2": "^7.10",
39+
"symfony/http-client": "^6.0 || ^7.0 || ^8.0",
4040
"nyholm/psr7": "^1.2",
4141
"friendsofphp/php-cs-fixer": "^3.2.2",
42-
"symfony/phpunit-bridge": "^6.0 || ^7.0",
42+
"symfony/phpunit-bridge": "^6.0 || ^7.0 || ^8.0",
4343
"opis/json-schema": "^1.0",
44-
"symfony/console": "^6.0 || ^7.0",
45-
"symfony/process": "^6.0 || ^7.0"
44+
"symfony/console": "^6.0 || ^7.0 || ^8.0",
45+
"symfony/process": "^6.0 || ^7.0 || ^8.0"
4646
},
4747
"conflict": {
4848
"php-http/httplug": "< 2.0"

generated/Client.php

Lines changed: 176 additions & 176 deletions
Large diffs are not rendered by default.

generated/Normalizer/AdminAppsApprovePostResponse200Normalizer.php

Lines changed: 48 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -16,141 +16,75 @@
1616
use Jane\Component\JsonSchemaRuntime\Reference;
1717
use JoliCode\Slack\Api\Runtime\Normalizer\CheckArray;
1818
use JoliCode\Slack\Api\Runtime\Normalizer\ValidatorTrait;
19-
use Symfony\Component\HttpKernel\Kernel;
2019
use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface;
2120
use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait;
2221
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
2322
use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface;
2423
use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait;
2524
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
2625

27-
if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR_VERSION === 6 && Kernel::MINOR_VERSION === 4)) {
28-
class AdminAppsApprovePostResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface
26+
class AdminAppsApprovePostResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface
27+
{
28+
use CheckArray;
29+
use DenormalizerAwareTrait;
30+
use NormalizerAwareTrait;
31+
use ValidatorTrait;
32+
33+
public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool
2934
{
30-
use CheckArray;
31-
use DenormalizerAwareTrait;
32-
use NormalizerAwareTrait;
33-
use ValidatorTrait;
35+
return \JoliCode\Slack\Api\Model\AdminAppsApprovePostResponse200::class === $type;
36+
}
3437

35-
public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool
36-
{
37-
return \JoliCode\Slack\Api\Model\AdminAppsApprovePostResponse200::class === $type;
38-
}
38+
public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool
39+
{
40+
return \is_object($data) && \JoliCode\Slack\Api\Model\AdminAppsApprovePostResponse200::class === \get_class($data);
41+
}
3942

40-
public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool
41-
{
42-
return \is_object($data) && \JoliCode\Slack\Api\Model\AdminAppsApprovePostResponse200::class === \get_class($data);
43+
public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed
44+
{
45+
if (isset($data['$ref'])) {
46+
return new Reference($data['$ref'], $context['document-origin']);
4347
}
44-
45-
public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed
46-
{
47-
if (isset($data['$ref'])) {
48-
return new Reference($data['$ref'], $context['document-origin']);
49-
}
50-
if (isset($data['$recursiveRef'])) {
51-
return new Reference($data['$recursiveRef'], $context['document-origin']);
52-
}
53-
$object = new \JoliCode\Slack\Api\Model\AdminAppsApprovePostResponse200();
54-
if (null === $data || false === \is_array($data)) {
55-
return $object;
56-
}
57-
if (\array_key_exists('ok', $data) && null !== $data['ok']) {
58-
$object->setOk($data['ok']);
59-
unset($data['ok']);
60-
} elseif (\array_key_exists('ok', $data) && null === $data['ok']) {
61-
$object->setOk(null);
62-
}
63-
foreach ($data as $key => $value) {
64-
if (preg_match('/.*/', (string) $key)) {
65-
$object[$key] = $value;
66-
}
67-
}
68-
48+
if (isset($data['$recursiveRef'])) {
49+
return new Reference($data['$recursiveRef'], $context['document-origin']);
50+
}
51+
$object = new \JoliCode\Slack\Api\Model\AdminAppsApprovePostResponse200();
52+
if (\array_key_exists('ok', $data) && \is_int($data['ok'])) {
53+
$data['ok'] = (bool) $data['ok'];
54+
}
55+
if (null === $data || false === \is_array($data)) {
6956
return $object;
7057
}
71-
72-
public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
73-
{
74-
$data = [];
75-
$data['ok'] = $object->getOk();
76-
foreach ($object as $key => $value) {
77-
if (preg_match('/.*/', (string) $key)) {
78-
$data[$key] = $value;
79-
}
58+
if (\array_key_exists('ok', $data) && null !== $data['ok']) {
59+
$object->setOk($data['ok']);
60+
unset($data['ok']);
61+
} elseif (\array_key_exists('ok', $data) && null === $data['ok']) {
62+
$object->setOk(null);
63+
}
64+
foreach ($data as $key => $value) {
65+
if (preg_match('/.*/', (string) $key)) {
66+
$object[$key] = $value;
8067
}
81-
82-
return $data;
8368
}
8469

85-
public function getSupportedTypes(?string $format = null): array
86-
{
87-
return [\JoliCode\Slack\Api\Model\AdminAppsApprovePostResponse200::class => false];
88-
}
70+
return $object;
8971
}
90-
} else {
91-
class AdminAppsApprovePostResponse200Normalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface
92-
{
93-
use CheckArray;
94-
use DenormalizerAwareTrait;
95-
use NormalizerAwareTrait;
96-
use ValidatorTrait;
97-
98-
public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool
99-
{
100-
return \JoliCode\Slack\Api\Model\AdminAppsApprovePostResponse200::class === $type;
101-
}
102-
103-
public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool
104-
{
105-
return \is_object($data) && \JoliCode\Slack\Api\Model\AdminAppsApprovePostResponse200::class === \get_class($data);
106-
}
10772

108-
public function denormalize($data, $type, $format = null, array $context = [])
109-
{
110-
if (isset($data['$ref'])) {
111-
return new Reference($data['$ref'], $context['document-origin']);
112-
}
113-
if (isset($data['$recursiveRef'])) {
114-
return new Reference($data['$recursiveRef'], $context['document-origin']);
115-
}
116-
$object = new \JoliCode\Slack\Api\Model\AdminAppsApprovePostResponse200();
117-
if (null === $data || false === \is_array($data)) {
118-
return $object;
119-
}
120-
if (\array_key_exists('ok', $data) && null !== $data['ok']) {
121-
$object->setOk($data['ok']);
122-
unset($data['ok']);
123-
} elseif (\array_key_exists('ok', $data) && null === $data['ok']) {
124-
$object->setOk(null);
125-
}
126-
foreach ($data as $key => $value) {
127-
if (preg_match('/.*/', (string) $key)) {
128-
$object[$key] = $value;
129-
}
73+
public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
74+
{
75+
$dataArray = [];
76+
$dataArray['ok'] = $data->getOk();
77+
foreach ($data as $key => $value) {
78+
if (preg_match('/.*/', (string) $key)) {
79+
$dataArray[$key] = $value;
13080
}
131-
132-
return $object;
13381
}
13482

135-
/**
136-
* @return array|string|int|float|bool|\ArrayObject|null
137-
*/
138-
public function normalize($object, $format = null, array $context = [])
139-
{
140-
$data = [];
141-
$data['ok'] = $object->getOk();
142-
foreach ($object as $key => $value) {
143-
if (preg_match('/.*/', (string) $key)) {
144-
$data[$key] = $value;
145-
}
146-
}
147-
148-
return $data;
149-
}
83+
return $dataArray;
84+
}
15085

151-
public function getSupportedTypes(?string $format = null): array
152-
{
153-
return [\JoliCode\Slack\Api\Model\AdminAppsApprovePostResponse200::class => false];
154-
}
86+
public function getSupportedTypes(?string $format = null): array
87+
{
88+
return [\JoliCode\Slack\Api\Model\AdminAppsApprovePostResponse200::class => false];
15589
}
15690
}

0 commit comments

Comments
 (0)