Skip to content

Commit 6954b40

Browse files
Merge pull request #7 from cleverage/prepare-release
Prepare release v2.0
2 parents 6d5a7f4 + eeaf870 commit 6954b40

36 files changed

+1076
-357
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-flysystem-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/flysystem-process-bundle](https://github.com/cleverage/flysystem-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/FlysystemProcessBundle 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/FlysystemProcessBundle 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

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
v2.0
2+
------
3+
4+
## BC breaks
5+
6+
* [#5](https://github.com/cleverage/flysystem-process-bundle/issues/5) Replace "oneup/flysystem-bundle": ">1.0,<4.0" by "league/flysystem-bundle": "^3.0"
7+
* [#5](https://github.com/cleverage/flysystem-process-bundle/issues/5) Update Tasks for "league/flysystem-bundle": "^3.0"
8+
* [#6](https://github.com/cleverage/flysystem-process-bundle/issues/6) Update services according to Symfony best practices. Services should not use autowiring or autoconfiguration. Instead, all services should be defined explicitly.
9+
Services must be prefixed with the bundle alias instead of using fully qualified class names => `cleverage_flysystem_process`
10+
11+
### Changes
12+
13+
* [#3](https://github.com/cleverage/flysystem-process-bundle/issues/3) Add Makefile & .docker for local standalone usage
14+
* [#3](https://github.com/cleverage/flysystem-process-bundle/issues/3) Add rector, phpstan & php-cs-fixer configurations & apply it
15+
* [#4](https://github.com/cleverage/flysystem-process-bundle/issues/4) Remove `sidus/base-bundle` dependency
16+
17+
### Fixes
18+
19+
v1.0.1
20+
------
21+
22+
### Fixes
23+
24+
* Fixed dependencies after removing sidus/base-bundle from the base process bundle
25+
26+
v1.0.0
27+
------
28+
29+
* Initial release

CONTRIBUTING.md

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
Contributing
2+
============
3+
4+
First of all, **thank you** for contributing, **you are awesome**!
5+
6+
Here are a few rules to follow in order to ease code reviews, and discussions before
7+
maintainers accept and merge your work.
8+
9+
You MUST run the quality & test suites.
10+
11+
You SHOULD write (or update) unit tests.
12+
13+
You SHOULD write documentation.
14+
15+
Please, write [commit messages that make sense](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html),
16+
and [rebase your branch](https://git-scm.com/book/en/v2/Git-Branching-Rebasing) before submitting your Pull Request.
17+
18+
One may ask you to [squash your commits](https://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html)
19+
too. This is used to "clean" your Pull Request before merging it (we don't want
20+
commits such as `fix tests`, `fix 2`, `fix 3`, etc.).
21+
22+
Thank you!
23+
24+
## Running the quality & test suites
25+
26+
Tests suite uses Docker environments in order to be idempotent to OS's. More than this
27+
PHP version is written inside the Dockerfile; this assures to test the bundle with
28+
the same resources. No need to have PHP installed.
29+
30+
You only need Docker set it up.
31+
32+
To allow testing environments more smooth we implemented **Makefile**.
33+
You have two commands available:
34+
35+
```bash
36+
make quality
37+
```
38+
39+
```bash
40+
make tests
41+
```
42+
43+
## Deprecations notices
44+
45+
When a feature should be deprecated, or when you have a breaking change for a future version, please :
46+
* [Fill an issue](https://github.com/cleverage/flysystem-process-bundle/issues/new)
47+
* Add TODO comments with the following format: `@TODO deprecated v2.0`
48+
* Trigger a deprecation error: `@trigger_error('This feature will be deprecated in v2.0', E_USER_DEPRECATED);`
49+
50+
You can check which deprecation notice is triggered in tests
51+
* `make bash`
52+
* `SYMFONY_DEPRECATIONS_HELPER=0 ./vendor/bin/phpunit`

0 commit comments

Comments
 (0)