Skip to content
This repository has been archived by the owner on Jul 28, 2022. It is now read-only.

Commit

Permalink
Merge 508a6ed into b9de523
Browse files Browse the repository at this point in the history
  • Loading branch information
SonataCI committed Feb 12, 2020
2 parents b9de523 + 508a6ed commit 81f6195
Show file tree
Hide file tree
Showing 11 changed files with 81 additions and 32 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/lint.yml
@@ -0,0 +1,63 @@
on: [push, pull_request]

name: Lint

jobs:
php-cs-fixer:
name: PHP-CS-Fixer

runs-on: ubuntu-latest

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

- name: "Run PHP-CS-Fixer"
uses: docker://oskarstark/php-cs-fixer-ga:2.16.1
with:
args: --ansi --verbose --diff --dry-run

composer-normalize:
name: composer-normalize

runs-on: ubuntu-latest

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

- name: "Run composer-normalize"
uses: docker://localheinz/composer-normalize-action:0.5.2
with:
args: --dry-run

yaml-files:
name: YAML files

runs-on: ubuntu-latest

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

- name: "Install Ruby 2.6"
uses: actions/setup-ruby@v1
with:
ruby-version: '2.6'
- run: gem install yaml-lint
- name: "Linting..."
run: make lint-yaml

xml-files:
name: XML files

runs-on: ubuntu-latest

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

- run: sudo apt-get install libxml2-utils

- name: "Linting..."
run: make lint-xml
1 change: 1 addition & 0 deletions .php_cs.dist
Expand Up @@ -26,6 +26,7 @@ $rules = [
'header_comment' => [
'header' => $header,
],
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'],
'no_extra_blank_lines' => true,
'no_php4_constructor' => true,
'no_superfluous_phpdoc_tags' => ['allow_mixed' => true],
Expand Down
7 changes: 0 additions & 7 deletions .travis.yml
Expand Up @@ -17,11 +17,6 @@ php:

dist: xenial

addons:
apt:
packages:
- libxml2-utils

cache:
pip: true
directories:
Expand All @@ -38,8 +33,6 @@ env:
matrix:
fast_finish: true
include:
- php: '7.3'
env: TARGET=lint
- php: '7.2'
env: COMPOSER_FLAGS="--prefer-lowest"
- php: '7.3'
Expand Down
6 changes: 0 additions & 6 deletions .travis/check_relevant_lint.sh

This file was deleted.

11 changes: 0 additions & 11 deletions .travis/install_lint.sh

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -6,7 +6,7 @@ all:
@echo "Please choose a task."
.PHONY: all

lint: lint-composer lint-yaml lint-composer lint-xml lint-php
lint: lint-composer lint-yaml lint-xml lint-php
.PHONY: lint

lint-composer:
Expand Down
3 changes: 2 additions & 1 deletion src/Command/ConsumerHandlerCommand.php
Expand Up @@ -115,7 +115,8 @@ public function execute(InputInterface $input, OutputInterface $output)

$currentMemory = memory_get_usage(true);

$output->writeln(sprintf('<comment>OK! </comment> - %0.04fs, %ss, %s, %s - %s = %s, %0.02f%%',
$output->writeln(sprintf(
'<comment>OK! </comment> - %0.04fs, %ss, %s, %s - %s = %s, %0.02f%%',
microtime(true) - $start,
$date->format('U') - $message->getCreatedAt()->format('U'),
$this->formatMemory($currentMemory - $memoryUsage),
Expand Down
3 changes: 2 additions & 1 deletion src/Command/RestartCommand.php
Expand Up @@ -61,7 +61,8 @@ public function execute(InputInterface $input, OutputInterface $output)
$input->getOption('pause'),
$input->getOption('batch-size'),
$input->getOption('max-attempts'),
$input->getOption('attempt-delay'));
$input->getOption('attempt-delay')
);
} else {
$messages = $this->getErroneousMessageSelector()->getMessages(
$input->getOption('type'),
Expand Down
3 changes: 2 additions & 1 deletion src/DependencyInjection/SonataNotificationExtension.php
Expand Up @@ -324,7 +324,8 @@ protected function configureRabbitmq(ContainerBuilder $container, array $config)
foreach ($deadLetterRoutingKeys as $key) {
if (!\in_array($key, $routingKeys, true)) {
throw new \RuntimeException(sprintf(
'You must configure the queue having the routing_key "%s" same as dead_letter_routing_key', $key
'You must configure the queue having the routing_key "%s" same as dead_letter_routing_key',
$key
));
}
}
Expand Down
11 changes: 8 additions & 3 deletions tests/DependencyInjection/SonataNotificationExtensionTest.php
Expand Up @@ -173,7 +173,8 @@ private function getContainerBuilder(array $bundles = [])
$container = new ContainerBuilder();

$containerBundles = array_merge(
['SonataNotificationBundle' => SonataNotificationBundle::class], $bundles
['SonataNotificationBundle' => SonataNotificationBundle::class],
$bundles
);
$container->setParameter('kernel.bundles', $containerBundles);

Expand Down Expand Up @@ -201,14 +202,18 @@ private function getContainerBuilder(array $bundles = [])
private function assertAlias($alias, $service)
{
$this->assertSame(
$alias, (string) $this->container->getAlias($service), sprintf('%s alias is correct', $service)
$alias,
(string) $this->container->getAlias($service),
sprintf('%s alias is correct', $service)
);
}

private function assertParameter($expectedValue, $name)
{
$this->assertSame(
$expectedValue, $this->container->getParameter($name), sprintf('%s parameter is correct', $name)
$expectedValue,
$this->container->getParameter($name),
sprintf('%s parameter is correct', $name)
);
}

Expand Down
3 changes: 2 additions & 1 deletion tests/Iterator/MessageManagerMessageIterator.php
Expand Up @@ -29,7 +29,8 @@ public function __construct(ManagerRegistry $registry, $pause = 0, $batchSize =
new MessageManagerMock(Message::class, $registry),
[],
$pause,
$batchSize);
$batchSize
);
}

/**
Expand Down

0 comments on commit 81f6195

Please sign in to comment.