Skip to content

Commit d4183d8

Browse files
authored
Fix a warning when serializing metadata (#9)
This addresses warnings like... ``` Failed to save key "{key}" of type Webfactory\Bundle\PolyglotBundle\Doctrine\TranslatableClassMetadata: Cache key "..." has non-serializable Webfactory\Bundle\PolyglotBundle\Doctrine\TranslatableClassMetadata value. ``` ... that occur when the Cache Driver used (in Doctrine) is the file-based implementation from symfony/cache.
1 parent 814a923 commit d4183d8

32 files changed

+346
-281
lines changed

.coveralls.yml

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/workflows/dependencies.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Dependencies
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
env:
10+
PHP_VERSION: 7.2
11+
12+
jobs:
13+
composer-require-checker:
14+
name: Check missing composer requirements
15+
runs-on: ubuntu-18.04
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Konfiguriere PHP-Version und -Einstellungen im Worker-Node
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: ${{ env.PHP_VERSION }}
22+
tools: composer:v2
23+
ini-values: variables_order=EGPCS
24+
- name: Cache Composer Dependencies
25+
uses: actions/cache@v1
26+
with:
27+
path: vendor/
28+
key: composer-${{ env.PHP_VERSION }}-${{ hashFiles('composer.*') }}
29+
restore-keys: |
30+
composer-${{ env.PHP_VERSION }}-${{ github.ref }}
31+
composer-${{ env.PHP_VERSION }}-
32+
- run: |
33+
composer install --no-interaction --no-scripts --no-progress --no-suggest
34+
composer show
35+
- name: ComposerRequireChecker
36+
uses: docker://webfactory/composer-require-checker:2.1.0

.github/workflows/fix-cs-php.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Update this by running
2+
# curl https://gist.githubusercontent.com/mpdude/ca93a185bcbf56eb7e341632ad4f8263/raw/fix-cs-php.yml > .github/workflows/fix-cs-php.yml
3+
4+
on:
5+
push:
6+
branches:
7+
- master
8+
pull_request:
9+
10+
name: Coding Standards
11+
12+
jobs:
13+
open-pr-for-cs-violations:
14+
name: PHP-CS-Fixer
15+
runs-on: ubuntu-18.04
16+
steps:
17+
18+
- name: Checkout code
19+
uses: actions/checkout@v2
20+
with:
21+
ref: ${{ github.head_ref }}
22+
23+
- name: Run PHP-CS-Fixer
24+
uses: docker://oskarstark/php-cs-fixer-ga:2.16.7
25+
26+
- name: Create PR for CS fixups
27+
uses: peter-evans/create-pull-request@c7f493a8000b8aeb17a1332e326ba76b57cb83eb
28+
id: create-pull-request
29+
with:
30+
token: ${{ secrets.GITHUB_TOKEN }}
31+
title: Fix coding standards in ${{ github.ref }}
32+
branch: php-cs-fixer/${{ github.ref }}
33+
assignees: ${{ github.actor }}
34+
labels: php-cs-fixer
35+
body: Please merge these changes into the ${{ github.ref }} branch to fix coding standard violations.
36+
commit-message: Apply php-cs-fixer changes as of ${{ github.sha }}
37+
38+
- name: Leave a notice in the discussion when fixing code in a Pull Request
39+
uses: docker://mpdude/comment-on-pr:v1.2.0
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
if: steps.create-pull-request.outputs.pr_number # only if PR was created in the previous step
43+
continue-on-error: true # continue on failure - necessary when the current branch does not have a pending PR
44+
with:
45+
msg: |
46+
@${{ github.actor }} please apply the coding standard fixes from #${{ steps.create-pull-request.outputs.pr_number }}
47+
48+
- name: Fail the workflow when necessary CS fixes were detected
49+
run: echo "Failing workflow run because CS violations were detected." && exit 1
50+
if: steps.create-pull-request.outputs.pr_number

.github/workflows/tests.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
env:
10+
PHP_VERSION: 7.2
11+
12+
jobs:
13+
PHPUnit:
14+
name: PHPUnit
15+
runs-on: ubuntu-18.04
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Konfiguriere PHP-Version und -Einstellungen im Worker-Node
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: ${{ env.PHP_VERSION }}
22+
tools: composer:v2
23+
ini-values: variables_order=EGPCS
24+
- name: Cache Composer Dependencies
25+
uses: actions/cache@v1
26+
with:
27+
path: vendor/
28+
key: composer-${{ env.PHP_VERSION }}-${{ hashFiles('composer.*') }}
29+
restore-keys: |
30+
composer-${{ env.PHP_VERSION }}-${{ github.ref }}
31+
composer-${{ env.PHP_VERSION }}-
32+
- run: |
33+
composer install --no-interaction --no-scripts --no-progress --no-suggest
34+
composer show
35+
- run: vendor/bin/phpunit

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
vendor/
2-
.idea/
32
composer.lock
3+
phpunit.xml$
4+
.php_cs.cache

.php_cs.dist

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
return PhpCsFixer\Config::create()
4+
->setRules([
5+
'@Symfony' => true,
6+
'@Symfony:risky' => true,
7+
'array_syntax' => array('syntax' => 'short'),
8+
'no_unreachable_default_argument_value' => false,
9+
'braces' => array('allow_single_line_closure' => true),
10+
'heredoc_to_nowdoc' => false,
11+
'phpdoc_annotation_without_dot' => false,
12+
])
13+
->setRiskyAllowed(true)
14+
->setFinder(
15+
PhpCsFixer\Finder::create()
16+
->in(__DIR__)
17+
->notPath('vendor/')
18+
)
19+
;

.scrutinizer.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# ![webfactory Logo](https://www.webfactory.de/bundles/webfactorytwiglayout/img/logo.png) WebfactoryPolyglotBundle
22

3-
[![Build Status](https://scrutinizer-ci.com/g/webfactory/WebfactoryPolyglotBundle/badges/build.png?b=master)](https://scrutinizer-ci.com/g/webfactory/WebfactoryPolyglotBundle/build-status/master)
4-
[![Code Coverage](https://scrutinizer-ci.com/g/webfactory/WebfactoryPolyglotBundle/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/webfactory/WebfactoryPolyglotBundle/?branch=master)
5-
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/webfactory/WebfactoryPolyglotBundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/webfactory/WebfactoryPolyglotBundle/?branch=master)
3+
![Tests](https://github.com/webfactory/WebfactoryPolyglotBundle/workflows/Tests/badge.svg)
4+
![Dependencies](https://github.com/webfactory/WebfactoryPolyglotBundle/workflows/Dependencies/badge.svg)
65

76
A bundle to simplify translations for Doctrine entities.
87

@@ -263,7 +262,7 @@ this information in an attribute. This would allow each record to have its own p
263262

264263
## Credits, Copyright and License
265264

266-
Copyright 2012-2017 webfactory GmbH, Bonn. Code released under [the MIT license](LICENSE).
265+
This Bundle was written by webfactory GmbH, Bonn, Germany. We're a software development agency with a focus on PHP (mostly [Symfony](http://github.com/symfony/symfony)). If you're a developer looking for new challenges, we'd like to hear from you!
267266

268267
- <https://www.webfactory.de>
269268
- <https://twitter.com/webfactory>

composer.json

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,19 @@
1313
],
1414

1515
"autoload": {
16-
"psr-0": { "Webfactory\\Bundle\\PolyglotBundle": "src" }
16+
"psr-4": { "Webfactory\\Bundle\\PolyglotBundle\\": "src" }
17+
},
18+
"autoload-dev": {
19+
"psr-4": { "Webfactory\\Bundle\\PolyglotBundle\\Tests\\": "tests" }
1720
},
1821

1922
"require": {
23+
"php": "^7.2",
24+
"doctrine/annotations": "^1.11",
25+
"doctrine/collections": "^1.0",
26+
"doctrine/persistence": "^1.3.8",
2027
"doctrine/orm": "~2.2",
21-
"php": "^5.5|^7.0",
28+
"psr/log": "^1.0",
2229
"symfony/config": "^2.0|^3.0|^4.0",
2330
"symfony/dependency-injection": "^2.0|^3.0|^4.0",
2431
"symfony/event-dispatcher": "^2.0|^3.0|^4.0",
@@ -27,9 +34,9 @@
2734

2835
"require-dev": {
2936
"phpunit/phpunit": "^5.7",
30-
"symfony/debug": "^2.8|^3.0|^4.0",
31-
"symfony/phpunit-bridge": "dev-master",
32-
"webfactory/doctrine-orm-test-infrastructure": "~1.0"
37+
"symfony/error-handler": "^4.4",
38+
"symfony/phpunit-bridge": "*",
39+
"webfactory/doctrine-orm-test-infrastructure": "^1.9"
3340
},
3441

3542
"config": {

0 commit comments

Comments
 (0)