Skip to content

Commit

Permalink
Merge pull request #7 from meritoo/develop
Browse files Browse the repository at this point in the history
Release 0.4.0
  • Loading branch information
meritoo authored Jan 9, 2025
2 parents 2c7498a + bd0f93b commit 141248b
Show file tree
Hide file tree
Showing 62 changed files with 1,427 additions and 1,073 deletions.
143 changes: 143 additions & 0 deletions .github/workflows/verify-stability.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
name: Verify stability

on:
push:
branches:
- master
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
Validate:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: [ '8.2', '8.3' ]
env:
extensions: dom, fileinfo, intl, json, pcre, simplexml
key: cache-v1 # can be any string, change to clear the extension cache.
steps:
- name: Hello
run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- name: Checkout branch
uses: actions/checkout@v4
- name: Setup cache environment
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
key: ${{ env.key }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
- name: Validate Composer (composer.json and composer.lock)
uses: php-actions/composer@v6
with:
php_version: ${{ matrix.php-versions }}
php_extensions: intl
command: validate --strict --no-check-publish
- name: Cache Composer dependencies
id: composer-cache
uses: actions/cache@v4
with:
path: /tmp/composer-cache
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install Composer dependencies
uses: php-actions/composer@v6
with:
php_version: ${{ matrix.php-versions }}
php_extensions: intl
dev: no
PHPStan:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: [ '8.2', '8.3' ]
env:
extensions: dom, fileinfo, intl, json, pcre, simplexml
key: cache-v1 # can be any string, change to clear the extension cache.
needs: [ Validate ]
if: needs.Validate.result == 'success'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup cache environment
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
key: ${{ env.key }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
- name: Install Composer dependencies
uses: php-actions/composer@v6
with:
php_version: ${{ matrix.php-versions }}
php_extensions: intl
- name: Analyse code with PHPStan
run: vendor/bin/phpstan analyse --memory-limit 256M
PHPUnit:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: [ '8.2', '8.3' ]
env:
extensions: dom, fileinfo, intl, json, pcre, simplexml
key: cache-v1 # can be any string, change to clear the extension cache.
needs: [ PHPStan ]
if: needs.PHPStan.result == 'success'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup cache environment
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
key: ${{ env.key }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
- name: Install locales
run: |
sudo apt-get update \
&& sudo apt-get install -y --no-install-recommends --fix-missing \
locales
- name: Generate locales
run: |
sudo sed -i "s/^# de_DE/de_DE/g; \
s/^# es_ES/es_ES/g; \
s/^# en_GB/en_GB/g; \
s/^# en_US/en_US/g; \
s/^# fr_FR/fr_FR/g; \
s/^# it_IT/it_IT/g; \
s/^# pl_PL/pl_PL/g; \
s/^# ru_RU/ru_RU/g;" /etc/locale.gen \
&& sudo locale-gen
- name: Install Composer dependencies
uses: php-actions/composer@v6
with:
php_version: ${{ matrix.php-versions }}
php_extensions: intl
- name: Run PHPUnit tests
run: vendor/bin/phpunit --no-coverage
- name: Bye 👋
run: echo "🍏 This job's status is ${{ job.status }}."
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,33 @@

Common & useful classes, resources, extensions. Based on Symfony framework.

# 0.4.0

1. Support Symfony `5.4`
2. Pluralization in
translations [using the ICU MessageFormat](https://symfony.com/doc/current/reference/formats/message_format.html#pluralization)
3. Update the `meritoo/common-library` package to `^1.3`
4. Fix PHPStan errors
5. Bump minimum PHP version: `8.0` -> `8.2`
1. All the `*Type` classes, that extend `Meritoo\Common\Type\Base\BaseType` class, have been replaced by enumerations

| Before | After |
|-----------------------------------------------------------------------|---------------------------------------------------------|
| `Meritoo\CommonBundle\Type\DependencyInjection\ConfigurationFileType` | `Meritoo\CommonBundle\Enums\Date\ConfigurationFileType` |
| `Meritoo\CommonBundle\Type\Date\DateLength` | `Meritoo\CommonBundle\Enums\Date\DateLength` |
| `Meritoo\Common\Type\OopVisibilityType` | `Meritoo\Common\Enums\OopVisibility` |

2. Other than that:
- The following classes have been removed as not needed anymore:
- `Meritoo\CommonBundle\Exception\Type\Date\UnknownDateLengthException`
- `Meritoo\CommonBundle\Exception\Type\DependencyInjection\UnknownConfigurationFileTypeException`
- `Meritoo\Test\CommonBundle\DependencyInjection\Base\BaseExtension\UnknownServicesFileType\Extension`

# 0.3.1

1. Create `Meritoo\CommonBundle\Traits\Test\Entity\EntityTestCaseTrait::dropDatabase()` method for removing whole
database in PHPUnit tests

# 0.3.0

1. Support PHP 8.0+
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.0
0.4.0
15 changes: 8 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
}
],
"require": {
"php": "^8.0",
"php": "^8.2",
"ext-intl": "*",
"doctrine/annotations": "^1.13",
"meritoo/common-library": "^1.2",
"symfony/form": "^4.4|^5.2",
"symfony/framework-bundle": "^4.0|^5.4",
"symfony/twig-bundle": "^4.0|^5.4",
"symfony/validator": "^4.0|^5.4"
"doctrine/annotations": "^2.0",
"meritoo/common-library": "^1.3",
"symfony/form": "^5.4",
"symfony/framework-bundle": "^5.4",
"symfony/twig-bundle": "^5.4",
"symfony/validator": "^5.4"
},
"require-dev": {
"friends-of-phpspec/phpspec-code-coverage": "^6.1",
Expand All @@ -31,6 +31,7 @@
"sebastian/phpcpd": "^6.0",
"squizlabs/php_codesniffer": "^3.6",
"symfony/phpunit-bridge": "^6.0",
"symfony/translation": "^6.0",
"symfony/yaml": "^5.4",
"vimeo/psalm": "^4.22"
},
Expand Down
8 changes: 3 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
version: '3'

services:
#
# Required to run project
#
php:
image: meritoo/php:8.0
image: meritoo/php:8.2
container_name: ${DOCKER_CONTAINER_OWNER}-${DOCKER_CONTAINER_PROJECT}-php
entrypoint: php
command: -S 0.0.0.0:9999
Expand All @@ -14,7 +12,7 @@ services:
volumes:
- .:/var/www/application:cached
composer:
image: meritoo/php:8.0
image: meritoo/php:8.2
container_name: ${DOCKER_CONTAINER_OWNER}-${DOCKER_CONTAINER_PROJECT}-composer
entrypoint: php -d memory_limit=-1 /usr/local/bin/composer
volumes:
Expand All @@ -23,7 +21,7 @@ services:
# Required to run PHPUnit's tests
#
phpunit:
image: meritoo/php:8.0
image: meritoo/php:8.2
container_name: ${DOCKER_CONTAINER_OWNER}-${DOCKER_CONTAINER_PROJECT}-phpunit
entrypoint: ./vendor/bin/simple-phpunit
command: --version
Expand Down
2 changes: 1 addition & 1 deletion phpstan.neon.dist → phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ parameters:
paths:
- src
- tests
excludes_analyse:
excludePaths:
- %rootDir%/../../../tests/Resources/var/*
Loading

0 comments on commit 141248b

Please sign in to comment.