Skip to content

Commit bb858f1

Browse files
Merge pull request #6 from cleverage/prepare-release
Prepare release v2.0
2 parents 6b54876 + 4f2e383 commit bb858f1

Some content is hidden

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

41 files changed

+1149
-626
lines changed

.docker/compose.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
x-build-args: &build-args
2+
UID: "${UID:-1000}"
3+
GID: "${GID:-1000}"
4+
5+
name: cleverage-rest-process-bundle
6+
7+
services:
8+
php:
9+
build:
10+
context: php
11+
args:
12+
<<: *build-args
13+
volumes:
14+
- ../:/var/www

.docker/php/Dockerfile

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
FROM php:8.2-fpm-alpine
2+
3+
ARG UID
4+
ARG GID
5+
6+
RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"
7+
COPY /conf.d/ "$PHP_INI_DIR/conf.d/"
8+
9+
RUN apk update && apk add \
10+
tzdata \
11+
shadow \
12+
nano \
13+
bash \
14+
icu-dev \
15+
&& docker-php-ext-configure intl \
16+
&& docker-php-ext-install intl opcache \
17+
&& docker-php-ext-enable opcache
18+
19+
RUN ln -s /usr/share/zoneinfo/Europe/Paris /etc/localtime \
20+
&& sed -i "s/^;date.timezone =.*/date.timezone = Europe\/Paris/" $PHP_INI_DIR/php.ini
21+
22+
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
23+
24+
RUN usermod -u $UID www-data \
25+
&& groupmod -g $GID www-data
26+
27+
USER www-data:www-data
28+
29+
WORKDIR /var/www

.docker/php/conf.d/dev.ini

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
display_errors = 1
2+
error_reporting = E_ALL
3+
4+
opcache.validate_timestamps = 1
5+
opcache.revalidate_freq = 0

.github/ISSUE_TEMPLATE.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
## Description
2+
3+
<!-- Please describe the issue here -->
4+
5+
## Requirements
6+
7+
* Documentation updates
8+
- [ ] Reference
9+
- [ ] Changelog
10+
* [ ] Unit tests
11+
12+
## Breaking changes
13+
14+
<!-- Please list here every breaking changes this might induce with minor/major labels -->

.github/PULL_REQUEST_TEMPLATE.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
## Description
2+
3+
<!-- Please describe the PR purpose, with references to the issues -->
4+
5+
## Requirements
6+
7+
* Documentation updates
8+
- [ ] Reference
9+
- [ ] Changelog
10+
* [ ] Unit tests
11+
12+
## Breaking changes
13+
14+
<!-- Please list here every breaking changes this PR might induce with minor/major labels -->

.github/workflows/notifications.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Rocket chat notifications
2+
3+
# Controls when the action will run.
4+
on:
5+
push:
6+
tags:
7+
- '*'
8+
9+
jobs:
10+
notification:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Get the tag short reference
15+
id: get_tag
16+
run: echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
17+
18+
- name: Rocket.Chat Notification
19+
uses: madalozzo/Rocket.Chat.GitHub.Action.Notification@master
20+
with:
21+
type: success
22+
job_name: "[cleverage/rest-process-bundle](https://github.com/cleverage/rest-process-bundle) : ${{ steps.get_tag.outputs.TAG }} has been released"
23+
url: ${{ secrets.CLEVER_AGE_ROCKET_CHAT_WEBOOK_URL }}

.github/workflows/quality.yml

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Quality
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
phpstan:
14+
name: PHPStan
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
- name: Install PHP with extensions
20+
uses: shivammathur/setup-php@v2
21+
with:
22+
php-version: '8.2'
23+
coverage: none
24+
tools: composer:v2
25+
- name: Install Composer dependencies (locked)
26+
uses: ramsey/composer-install@v3
27+
- name: PHPStan
28+
run: vendor/bin/phpstan --no-progress --memory-limit=1G analyse --error-format=github
29+
30+
php-cs-fixer:
31+
name: PHP-CS-Fixer
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v4
36+
- name: Install PHP with extensions
37+
uses: shivammathur/setup-php@v2
38+
with:
39+
php-version: '8.2'
40+
coverage: none
41+
tools: composer:v2
42+
- name: Install Composer dependencies (locked)
43+
uses: ramsey/composer-install@v3
44+
- name: PHP-CS-Fixer
45+
run: vendor/bin/php-cs-fixer fix --diff --dry-run --show-progress=none
46+
47+
rector:
48+
name: Rector
49+
runs-on: ubuntu-latest
50+
steps:
51+
- name: Checkout code
52+
uses: actions/checkout@v4
53+
- name: Install PHP with extensions
54+
uses: shivammathur/setup-php@v2
55+
with:
56+
php-version: '8.2'
57+
coverage: none
58+
tools: composer:v2
59+
- name: Install Composer dependencies (locked)
60+
uses: ramsey/composer-install@v3
61+
- name: Rector
62+
run: vendor/bin/rector --no-progress-bar --dry-run

.github/workflows/test.yml

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
test:
14+
name: PHP ${{ matrix.php-version }} + ${{ matrix.dependencies }} + ${{ matrix.variant }}
15+
runs-on: ubuntu-latest
16+
continue-on-error: ${{ matrix.allowed-to-fail }}
17+
env:
18+
SYMFONY_REQUIRE: ${{matrix.symfony-require}}
19+
20+
strategy:
21+
matrix:
22+
php-version:
23+
- '8.2'
24+
- '8.3'
25+
dependencies: [highest]
26+
allowed-to-fail: [false]
27+
symfony-require: ['']
28+
variant: [normal]
29+
include:
30+
- php-version: '8.2'
31+
dependencies: highest
32+
allowed-to-fail: false
33+
symfony-require: 6.4.*
34+
variant: symfony/symfony:"6.4.*"
35+
- php-version: '8.2'
36+
dependencies: highest
37+
allowed-to-fail: false
38+
symfony-require: 7.1.*
39+
variant: symfony/symfony:"7.1.*"
40+
- php-version: '8.3'
41+
dependencies: highest
42+
allowed-to-fail: false
43+
symfony-require: 6.4.*
44+
variant: symfony/symfony:"6.4.*"
45+
- php-version: '8.3'
46+
dependencies: highest
47+
allowed-to-fail: false
48+
symfony-require: 7.1.*
49+
variant: symfony/symfony:"7.1.*"
50+
51+
steps:
52+
- name: Checkout
53+
uses: actions/checkout@v4
54+
- name: Install PHP with extensions
55+
uses: shivammathur/setup-php@v2
56+
with:
57+
php-version: ${{ matrix.php-version }}
58+
coverage: pcov
59+
tools: composer:v2, flex
60+
- name: Add PHPUnit matcher
61+
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
62+
- name: Install variant
63+
if: matrix.variant != 'normal' && !startsWith(matrix.variant, 'symfony/symfony')
64+
run: composer require ${{ matrix.variant }} --no-update
65+
- name: Install Composer dependencies (${{ matrix.dependencies }})
66+
uses: ramsey/composer-install@v3
67+
with:
68+
dependency-versions: ${{ matrix.dependencies }}
69+
- name: Run Tests with coverage
70+
run: vendor/bin/phpunit -c phpunit.xml.dist --coverage-clover build/logs/clover.xml
71+
#- name: Send coverage to Codecov
72+
# uses: codecov/codecov-action@v4
73+
# with:
74+
# files: build/logs/clover.xml

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
11
/composer.lock
22
/vendor
3+
.env
4+
.idea
5+
/phpunit.xml
6+
.phpunit.result.cache
7+
.phpunit.cache
8+
.php-cs-fixer.cache
9+
coverage-report

.php-cs-fixer.dist.php

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the CleverAge/RestProcessBundle package.
5+
*
6+
* Copyright (c) Clever-Age
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
if (!file_exists(__DIR__.'/src')) {
13+
exit(0);
14+
}
15+
16+
$fileHeaderComment = <<<'EOF'
17+
This file is part of the CleverAge/RestProcessBundle package.
18+
19+
Copyright (c) Clever-Age
20+
21+
For the full copyright and license information, please view the LICENSE
22+
file that was distributed with this source code.
23+
EOF;
24+
25+
return (new PhpCsFixer\Config())
26+
->setRules([
27+
'@PHP71Migration' => true,
28+
'@PHP82Migration' => true,
29+
'@PHPUnit75Migration:risky' => true,
30+
'@Symfony' => true,
31+
'@Symfony:risky' => true,
32+
'protected_to_private' => false,
33+
'native_constant_invocation' => ['strict' => false],
34+
'header_comment' => ['header' => $fileHeaderComment],
35+
'modernize_strpos' => true,
36+
'get_class_to_class_keyword' => true,
37+
])
38+
->setRiskyAllowed(true)
39+
->setFinder(
40+
(new PhpCsFixer\Finder())
41+
->in(__DIR__.'/src')
42+
->in(__DIR__.'/tests')
43+
->append([__FILE__])
44+
)
45+
->setCacheFile('.php-cs-fixer.cache')
46+
;

CHANGELOG.md

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
v2.0
2+
------
3+
4+
## BC breaks
5+
6+
* [#3](https://github.com/cleverage/rest-process-bundle/issues/3) Replace `nategood/httpful` dependency by `symfony/http-client`
7+
* [#3](https://github.com/cleverage/rest-process-bundle/issues/5) Update Tasks for "symfony/http-client": "^6.4|^7.1"
8+
* [#4](https://github.com/cleverage/rest-process-bundle/issues/4) Update services according to Symfony best practices.
9+
Services should not use autowiring or autoconfiguration. Instead, all services should be defined explicitly.
10+
Services must be prefixed with the bundle alias instead of using fully qualified class names => `cleverage_rest_process`
11+
* RequestTask : `query_parameters` option is deprecated, use `data` instead
12+
* Remove RequestTransformer, use RequestTask instead.
13+
14+
### Changes
15+
16+
* [#1](https://github.com/cleverage/rest-process-bundle/issues/1) Add Makefile & .docker for local standalone usage
17+
* [#1](https://github.com/cleverage/rest-process-bundle/issues/1) Add rector, phpstan & php-cs-fixer configurations & apply it
18+
* [#2](https://github.com/cleverage/rest-process-bundle/issues/2) Remove `sidus/base-bundle` dependency
19+
20+
### Fixes
21+
22+
v1.0.4
23+
------
24+
25+
### Changes
26+
27+
* Fixed dependencies after removing sidus/base-bundle from the base process bundle
28+
29+
v1.0.3
30+
------
31+
32+
### Changes
33+
34+
* Minor refactoring in RequestTask to allow override of options more easily
35+
36+
v1.0.2
37+
------
38+
39+
### Fixes
40+
41+
* Fixing trailing '?'/'&' in request uri
42+
43+
v1.0.1
44+
------
45+
46+
### Changes
47+
48+
* Adding debug information in RequestTask
49+
50+
v1.0.0
51+
------
52+
53+
* Initial release

0 commit comments

Comments
 (0)