Skip to content

Commit 0b1317a

Browse files
authored
Merge pull request #2 from php-translation/master
Update `master` branch
2 parents d7aba90 + 4051a5b commit 0b1317a

File tree

78 files changed

+593
-430
lines changed

Some content is hidden

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

78 files changed

+593
-430
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
strategy:
1111
fail-fast: false
1212
matrix:
13-
php: [ '7.2', '7.3', '7.4', '8.0' ]
13+
php: [ '7.2', '7.3', '7.4', '8.0', '8.1' ]
1414
strategy: [ 'highest' ]
1515
sf_version: ['']
1616
include:
@@ -43,4 +43,3 @@ jobs:
4343

4444
- name: Run tests
4545
run: ./vendor/bin/simple-phpunit
46-

.github/workflows/static.yml

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -38,35 +38,13 @@ jobs:
3838

3939
php-cs-fixer:
4040
name: PHP-CS-Fixer
41-
runs-on: Ubuntu-20.04
42-
41+
runs-on: ubuntu-latest
4342
steps:
44-
- name: Checkout code
45-
uses: actions/checkout@v2
46-
47-
- name: Cache PhpCsFixer
48-
uses: actions/cache@v2
49-
with:
50-
path: .github/.cache/php-cs-fixer/
51-
key: php-cs-fixer-${{ github.sha }}
52-
restore-keys: php-cs-fixer-
53-
54-
- name: Setup PHP
55-
uses: shivammathur/setup-php@v2
56-
with:
57-
php-version: '7.4'
58-
coverage: none
59-
60-
- name: Download dependencies
61-
uses: ramsey/composer-install@v1
62-
with:
63-
composer-options: --no-interaction --prefer-dist --optimize-autoloader
64-
65-
- name: Download PHP CS Fixer
66-
run: composer bin php-cs-fixer update --no-interaction --no-progress
67-
68-
- name: Execute PHP CS Fixer
69-
run: vendor/bin/php-cs-fixer fix --diff-format udiff --dry-run
43+
- uses: actions/checkout@v2
44+
- name: PHP-CS-Fixer
45+
uses: docker://oskarstark/php-cs-fixer-ga
46+
with:
47+
args: --diff --dry-run
7048

7149
psalm:
7250
name: Psalm

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
/phpunit.xml
66
/vendor/
77
.php_cs.cache
8+
.php-cs-fixer.cache
89
.phpunit.result.cache

.php-cs-fixer.dist.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
$finder = PhpCsFixer\Finder::create()
4+
->exclude(__DIR__.'/vendor')
5+
->name('*.php')
6+
->in(__DIR__)
7+
;
8+
9+
$config = new PhpCsFixer\Config();
10+
return $config->setRules([
11+
'@Symfony' => true,
12+
'@Symfony:risky' => true,
13+
'array_syntax' => ['syntax' => 'short'],
14+
'native_function_invocation' => true,
15+
'ordered_imports' => true,
16+
'declare_strict_types' => false,
17+
'single_import_per_statement' => false,
18+
])
19+
->setRiskyAllowed(true)
20+
->setFinder($finder)
21+
;

.php_cs

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

Catalogue/CatalogueFetcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function getCatalogues(Configuration $config, array $locales = []): array
4646
foreach ($locales as $locale) {
4747
$currentCatalogue = new MessageCatalogue($locale);
4848
foreach ($dirs as $path) {
49-
if (\is_dir($path)) {
49+
if (is_dir($path)) {
5050
$this->reader->read($path, $currentCatalogue);
5151
}
5252
}

Catalogue/CatalogueManager.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function load(array $catalogues): void
4242
public function getDomains(): array
4343
{
4444
/** @var MessageCatalogueInterface $c */
45-
$c = \reset($this->catalogues);
45+
$c = reset($this->catalogues);
4646

4747
return $c->getDomains();
4848
}
@@ -107,7 +107,7 @@ public function findMessages(array $config = []): array
107107
}
108108
}
109109

110-
$messages = \array_filter($messages, static function (CatalogueMessage $m) use ($isNew, $isObsolete, $isApproved, $isEmpty) {
110+
$messages = array_filter($messages, static function (CatalogueMessage $m) use ($isNew, $isObsolete, $isApproved, $isEmpty) {
111111
if (null !== $isNew && $m->isNew() !== $isNew) {
112112
return false;
113113
}

Catalogue/Operation/ReplaceOperation.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ protected function processDomain($domain): void
3737
'new' => [],
3838
'obsolete' => [],
3939
];
40-
if (\defined(\sprintf('%s::INTL_DOMAIN_SUFFIX', MessageCatalogueInterface::class))) {
40+
if (\defined(sprintf('%s::INTL_DOMAIN_SUFFIX', MessageCatalogueInterface::class))) {
4141
$intlDomain = $domain.MessageCatalogueInterface::INTL_DOMAIN_SUFFIX;
4242
} else {
4343
$intlDomain = $domain;
@@ -140,12 +140,12 @@ private function doMergeMetadata(array $source, array $target): array
140140
// If both arrays, do recursive call
141141
$source[$key] = $this->doMergeMetadata($source[$key], $value);
142142
}
143-
// Else, use value form $source
143+
// Else, use value form $source
144144
} else {
145145
// Add new value
146146
$source[$key] = $value;
147147
}
148-
// if sequential
148+
// if sequential
149149
} elseif (!\in_array($value, $source, true)) {
150150
$source[] = $value;
151151
}
@@ -160,6 +160,6 @@ public function isArrayAssociative(array $arr): bool
160160
return false;
161161
}
162162

163-
return \array_keys($arr) !== \range(0, \count($arr) - 1);
163+
return array_keys($arr) !== range(0, \count($arr) - 1);
164164
}
165165
}

Changelog.md

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

33
The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release.
44

5+
## 0.12.7
6+
7+
### Fixed
8+
9+
* fix: check if session is available by @robbedg in https://github.com/php-translation/symfony-bundle/pull/478
10+
11+
## 0.12.6
12+
13+
### Fixed
14+
15+
* fix: used finder->exclude instead of notPath for excludedDirs by @seizan8 in https://github.com/php-translation/symfony-bundle/pull/474
16+
17+
## 0.12.5
18+
19+
### Added
20+
21+
* Add testing on the newest PHP 8.1 to the CI config by @bocharsky-bw in https://github.com/php-translation/symfony-bundle/pull/465
22+
* Allow Symfony 6 by @bocharsky-bw in https://github.com/php-translation/symfony-bundle/pull/464
23+
24+
### Removed
25+
26+
* refac: remove AbstractController from EditInPlaceController by @gimler in https://github.com/php-translation/symfony-bundle/pull/459
27+
* Stop extending AbstractController to fix some deprecations by @bocharsky-bw in https://github.com/php-translation/symfony-bundle/pull/460
28+
29+
### Changed
30+
31+
* Use autowiring for SymfonyProfilerController by @bocharsky-bw in https://github.com/php-translation/symfony-bundle/pull/461
32+
* Use a different image for PHP CS Fixer to get latest and upgrade config #471
33+
34+
### Fixed
35+
36+
* Fix Cannot autowire service "php_translation.data_collector" error in… by @axi in https://github.com/php-translation/symfony-bundle/pull/463
37+
* Fix yaml indentation to 4 spaces by @bocharsky-bw in https://github.com/php-translation/symfony-bundle/pull/462
38+
* Fix for deprecated session service in Symfony 6 by @robbedg in https://github.com/php-translation/symfony-bundle/pull/468
39+
* Fix return type and implement getCatalogues() https://github.com/php-translation/symfony-bundle/pull/470
40+
41+
## 0.12.4
42+
43+
### Fixed
44+
45+
- Fix extractor parameters #438
46+
- Make Profiler service an optional argument for SymfonyProfilerController #440
47+
- Update ExtractCommand.php #435
48+
- Fix tests on Symfony 5.3 #443
49+
- Suppress getMasterRequest() deprecation message #444
50+
- Suppress deprecations on deprecating legacy services #445
51+
- Fix PHPUnit deprecations #447
52+
- Fix broken tests #458
53+
- Register visitor tag also for TranslateAnnotationVisitor and Knp visitors #451
54+
55+
### Removed
56+
57+
- Drop SensioLabs (Symfony) insight badge #441
58+
559
## 0.12.3
660

761
### Fixed

Command/BundleTrait.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ trait BundleTrait
2020
private function configureBundleDirs(InputInterface $input, Configuration $config): void
2121
{
2222
if ($bundleName = $input->getOption('bundle')) {
23-
if (0 === \strpos($bundleName, '@')) {
24-
if (false === $pos = \strpos($bundleName, '/')) {
25-
$bundleName = \substr($bundleName, 1);
23+
if (0 === strpos($bundleName, '@')) {
24+
if (false === $pos = strpos($bundleName, '/')) {
25+
$bundleName = substr($bundleName, 1);
2626
} else {
27-
$bundleName = \substr($bundleName, 1, $pos - 2);
27+
$bundleName = substr($bundleName, 1, $pos - 2);
2828
}
2929
}
3030

0 commit comments

Comments
 (0)