Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
.github export-ignore
.gitignore export-ignore
.php_cs export-ignore
.scrutinizer.yml export-ignore
.styleci.yml export-ignore
.travis.yml export-ignore
phpstan.neon.dist export-ignore
phpstan.neon.dist export-ignore
phpstan-baseline.neon export-ignore
psalm.baseline.xml export-ignore
psalm.xml export-ignore
Tests export-ignore
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: CI

on:
pull_request:

jobs:
build:
name: Test
runs-on: Ubuntu-20.04
strategy:
fail-fast: false
matrix:
php: [ '7.2', '7.3', '7.4', '8.0' ]
strategy: [ 'highest' ]
sf_version: ['']
include:
- php: 7.4
strategy: 'lowest'
- php: 7.3
sf_version: '3.*'
- php: 7.3
sf_version: '4.*'

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
tools: flex

- name: Download dependencies
uses: ramsey/composer-install@v1
env:
SYMFONY_REQUIRE: ${{ matrix.sf_version }}
with:
dependency-versions: ${{ matrix.strategy }}
composer-options: --no-interaction --prefer-dist --optimize-autoloader

- name: Install PHPUnit
run: ./vendor/bin/simple-phpunit install

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

96 changes: 86 additions & 10 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,99 @@ name: Static code analysis

on: [pull_request]


jobs:
phpstan:
name: PHPStan
runs-on: ubuntu-latest
runs-on: Ubuntu-20.04

steps:
- uses: actions/checkout@master
- name: Run PHPStan
uses: docker://jakzal/phpqa:php7.3-alpine
- name: Checkout code
uses: actions/checkout@v2

- name: Cache PHPStan
uses: actions/cache@v2
with:
path: .github/.cache/phpstan/
key: phpstan-${{ github.sha }}
restore-keys: phpstan-

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: none

- name: Download dependencies
uses: ramsey/composer-install@v1
with:
args: phpstan analyze
composer-options: --no-interaction --prefer-dist --optimize-autoloader

- name: Download PHPStan
run: composer bin phpstan update --no-interaction --no-progress

- name: Execute PHPStan
run: vendor/bin/phpstan analyze --no-progress

php-cs-fixer:
name: PHP-CS-Fixer
runs-on: ubuntu-latest
runs-on: Ubuntu-20.04

steps:
- uses: actions/checkout@master
- name: Run PHP-CS-Fixer
uses: docker://jakzal/phpqa:php7.3-alpine
- name: Checkout code
uses: actions/checkout@v2

- name: Cache PhpCsFixer
uses: actions/cache@v2
with:
args: php-cs-fixer fix --dry-run --diff-format udiff -vvv
path: .github/.cache/php-cs-fixer/
key: php-cs-fixer-${{ github.sha }}
restore-keys: php-cs-fixer-

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: none

- name: Download dependencies
uses: ramsey/composer-install@v1
with:
composer-options: --no-interaction --prefer-dist --optimize-autoloader

- name: Download PHP CS Fixer
run: composer bin php-cs-fixer update --no-interaction --no-progress

- name: Execute PHP CS Fixer
run: vendor/bin/php-cs-fixer fix --diff-format udiff --dry-run

psalm:
name: Psalm
runs-on: Ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Cache Psalm
uses: actions/cache@v2
with:
path: .github/.cache/psalm/
key: psalm-${{ github.sha }}
restore-keys: psalm-

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: none

- name: Download dependencies
uses: ramsey/composer-install@v1
with:
composer-options: --no-interaction --prefer-dist --optimize-autoloader

- name: Download Psalm
run: composer bin psalm update --no-interaction --no-progress

- name: Execute Psalm
run: vendor/bin/psalm --no-progress --output-format=github
9 changes: 0 additions & 9 deletions .scrutinizer.yml

This file was deleted.

63 changes: 0 additions & 63 deletions .travis.yml

This file was deleted.

6 changes: 6 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

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

## Unreleased

### Removed

- Support for PHP 7.1

## 0.12.1

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion Command/DownloadCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$message = 'The --cache option is deprecated as it\'s now the default behaviour of this command.';

$io->note($message);
@\trigger_error($message, E_USER_DEPRECATED);
@\trigger_error($message, \E_USER_DEPRECATED);
}

$configName = $input->getArgument('configuration');
Expand Down
2 changes: 1 addition & 1 deletion Controller/WebUIController.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ private function validateMessage(MessageInterface $message, array $validationGro
{
$errors = $this->validator->validate($message, null, $validationGroups);
if (\count($errors) > 0) {
throw MessageValidationException::create();
throw MessageValidationException::create();
}
}
}
31 changes: 22 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,20 +1,33 @@
.PHONY: ${TARGETS}

DIR := ${CURDIR}
QA_IMAGE := jakzal/phpqa:php7.3-alpine
# https://www.gnu.org/software/make/manual/html_node/Force-Targets.html
always:

cs-fix:
@docker run --rm -v $(DIR):/project -w /project $(QA_IMAGE) php-cs-fixer fix --diff-format udiff -vvv
cs-fix: vendor
vendor/bin/php-cs-fixer fix --diff-format udiff -vvv

cs-diff:
@docker run --rm -v $(DIR):/project -w /project $(QA_IMAGE) php-cs-fixer fix --diff-format udiff --dry-run -vvv
cs-diff: vendor
vendor/bin/php-cs-fixer fix --diff-format udiff --dry-run -vvv

phpstan:
@docker run --rm -v $(DIR):/project -w /project $(QA_IMAGE) phpstan analyze
phpstan: vendor
vendor/bin/phpstan analyze

phpunit:
psalm: vendor
vendor/bin/psalm

phpunit: vendor
@vendor/bin/phpunit

.PHONY: baseline
baseline: vendor ## Generate baseline files
vendor/bin/phpstan analyze --generate-baseline
vendor/bin/psalm --set-baseline=psalm.baseline.xml

static: cs-diff phpstan

test: static phpunit

vendor: always
composer update --no-interaction
composer bin all install --no-interaction
vendor/bin/simple-phpunit install
4 changes: 0 additions & 4 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
# Translation Bundle

[![Latest Version](https://img.shields.io/github/release/php-translation/symfony-bundle.svg?style=flat-square)](https://github.com/php-translation/symfony-bundle/releases)
[![Build Status](https://img.shields.io/travis/php-translation/symfony-bundle.svg?style=flat-square)](https://travis-ci.org/php-translation/symfony-bundle)
[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/php-translation/symfony-bundle.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-translation/symfony-bundle)
[![Quality Score](https://img.shields.io/scrutinizer/g/php-translation/symfony-bundle.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-translation/symfony-bundle)
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/c289ebe2-41c4-429f-afba-de2f905b9bdb/mini.png)](https://insight.sensiolabs.com/projects/c289ebe2-41c4-429f-afba-de2f905b9bdb)
[![Total Downloads](https://img.shields.io/packagist/dt/php-translation/symfony-bundle.svg?style=flat-square)](https://packagist.org/packages/php-translation/symfony-bundle)


**Symfony integration for PHP Translation**

## Install
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ protected function registerCompilerPass(ContainerBuilder $container): void
$container->addCompilerPass(new ExternalTranslatorPass());
}

/**
* @test
*/
public function if_compiler_pass_collects_services_by_adding_method_calls_these_will_exist(): void
public function testIfCompilerPassCollectsServicesByAddingMethodCallsTheseWillExist(): void
{
$collectingService = new Definition();
$this->setDefinition('php_translation.translator_service.external_translator', $collectingService);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ protected function registerCompilerPass(ContainerBuilder $container): void
$container->addCompilerPass(new ExtractorPass());
}

/**
* @test
*/
public function if_compiler_pass_collects_services_by_adding_method_calls_these_will_exist(): void
public function testIfCompilerPassCollectsServicesByAddingMethodCallsTheseWillExist(): void
{
$collectingService = new Definition();
$this->setDefinition(Extractor::class, $collectingService);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ protected function registerCompilerPass(ContainerBuilder $container): void
$container->addCompilerPass(new StoragePass());
}

/**
* @test
*/
public function if_compiler_pass_collects_services_by_adding_method_calls_these_will_exist(): void
public function testIfCompilerPassCollectsServicesByAddingMethodCallsTheseWillExist(): void
{
$collectingService = new Definition();
$this->setDefinition('php_translation.storage.foobar', $collectingService);
Expand Down
2 changes: 1 addition & 1 deletion Twig/Visitor/DefaultApplyingNodeVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function doEnterNode(Node $node, Environment $env): Node
}

if (!$transNode instanceof FilterExpression) {
throw new \RuntimeException(\sprintf('The "desc" filter must be applied after a "trans", or "transchoice" filter.'));
throw new \RuntimeException('The "desc" filter must be applied after a "trans", or "transchoice" filter.');
}

$wrappingNode = $node->getNode('node');
Expand Down
Loading