Skip to content

Commit

Permalink
Merge c3e391c into 224e0fd
Browse files Browse the repository at this point in the history
  • Loading branch information
SonataCI committed Feb 12, 2020
2 parents 224e0fd + c3e391c commit 65a0657
Show file tree
Hide file tree
Showing 10 changed files with 91 additions and 41 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ services:

dist: xenial

addons:
apt:
packages:
- libxml2-utils

cache:
pip: true
directories:
Expand All @@ -41,8 +36,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
Original file line number Diff line number Diff line change
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
4 changes: 3 additions & 1 deletion src/Block/Service/AbstractCategoriesBlockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ public function buildEditForm(FormMapper $formMapper, BlockInterface $block)
],
]);

$formMapper->add(ImmutableArrayType::class, [
$formMapper->add(
ImmutableArrayType::class,
[
'keys' => [
['title', TextType::class, [
'required' => false,
Expand Down
3 changes: 2 additions & 1 deletion src/Block/Service/AbstractCollectionsBlockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ public function buildEditForm(FormMapper $formMapper, BlockInterface $block)

$formMapper->add(
'settings',
ImmutableArrayType::class, [
ImmutableArrayType::class,
[
'keys' => [
['title', TextType::class, [
'required' => false,
Expand Down
5 changes: 4 additions & 1 deletion src/Block/Service/AbstractTagsBlockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ public function buildEditForm(FormMapper $formMapper, BlockInterface $block)
],
]);

$formMapper->add('settings', ImmutableArrayType::class, [
$formMapper->add(
'settings',
ImmutableArrayType::class,
[
'keys' => [
['title', TextType::class, [
'required' => false,
Expand Down
30 changes: 17 additions & 13 deletions tests/Controller/CategoryAdminControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,16 +249,14 @@ protected function setUp(): void
$this->admin->expects($this->any())
->method('generateUrl')
->willReturnCallback(

static function ($name, array $parameters = [], $absolute = false) {
$result = $name;
if (!empty($parameters)) {
$result .= '?'.http_build_query($parameters);
}

return $result;
static function ($name, array $parameters = [], $absolute = false) {
$result = $name;
if (!empty($parameters)) {
$result .= '?'.http_build_query($parameters);
}

return $result;
}
);

$this->admin->expects($this->any())
Expand All @@ -280,7 +278,9 @@ public function testListActionWithoutFilter(): void

$result = $this->controller->listAction($this->request);
$this->assertInstanceOf(
RedirectResponse::class, $result);
RedirectResponse::class,
$result
);
$this->assertSame('tree?hide_context=0', $result->getTargetUrl());
}

Expand Down Expand Up @@ -322,8 +322,10 @@ public function testListAction($context): void
->method('getPersistentParameter')
->willReturn($context);

$this->assertInstanceOf(Response::class,
$this->controller->listAction($this->request));
$this->assertInstanceOf(
Response::class,
$this->controller->listAction($this->request)
);
}

public function listActionData()
Expand Down Expand Up @@ -387,8 +389,10 @@ public function testTreeAction($context, $categories): void
->method('getRootCategoriesSplitByContexts')
->willReturn($categoriesMock);

$this->assertInstanceOf(Response::class,
$this->controller->treeAction($this->request));
$this->assertInstanceOf(
Response::class,
$this->controller->treeAction($this->request)
);
}

public function treeActionData()
Expand Down

0 comments on commit 65a0657

Please sign in to comment.