@@ -33,16 +33,16 @@ |
||
33 | 33 | public function init(): Decorator |
34 | 34 | { |
35 | 35 | // Add the appropriate class to form labels |
36 | - $this->rules[] = new Rule([], Label::class, [static::DEFAULT_LABEL_CLASS]); |
|
36 | + $this->rules[ ] = new Rule([ ], Label::class, [ static::DEFAULT_LABEL_CLASS ]); |
|
37 | 37 | |
38 | 38 | // Add the appropriate class to form labels |
39 | - $this->rules[] = new Rule([], Input::class, [static::DEFAULT_INPUT_CLASS]); |
|
40 | - $this->rules[] = new Rule([], Textarea::class, [static::DEFAULT_INPUT_CLASS]); |
|
41 | - $this->rules[] = new Rule([], Select::class, [static::DEFAULT_INPUT_CLASS]); |
|
42 | - $this->rules[] = new Rule([], FormGroup::class, [static::DEFAULT_FORM_GROUP_CLASS]); |
|
43 | - $this->rules[] = new Rule([], DefaultButtons::class, [static::DEFAULT_BUTTONS_CLASS]); |
|
44 | - $this->rules[] = new Rule([Button::INTENT_FORM], Button::class, [static::DEFAULT_BUTTON_CLASS]); |
|
45 | - $this->rules[] = new Rule([], CheckboxGroup::class, [], [], [$this, 'decorateCheckboxGroup']); |
|
39 | + $this->rules[ ] = new Rule([ ], Input::class, [ static::DEFAULT_INPUT_CLASS ]); |
|
40 | + $this->rules[ ] = new Rule([ ], Textarea::class, [ static::DEFAULT_INPUT_CLASS ]); |
|
41 | + $this->rules[ ] = new Rule([ ], Select::class, [ static::DEFAULT_INPUT_CLASS ]); |
|
42 | + $this->rules[ ] = new Rule([ ], FormGroup::class, [ static::DEFAULT_FORM_GROUP_CLASS ]); |
|
43 | + $this->rules[ ] = new Rule([ ], DefaultButtons::class, [ static::DEFAULT_BUTTONS_CLASS ]); |
|
44 | + $this->rules[ ] = new Rule([ Button::INTENT_FORM ], Button::class, [ static::DEFAULT_BUTTON_CLASS ]); |
|
45 | + $this->rules[ ] = new Rule([ ], CheckboxGroup::class, [ ], [ ], [ $this, 'decorateCheckboxGroup' ]); |
|
46 | 46 | |
47 | 47 | return $this; |
48 | 48 | } |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | |
10 | 10 | return [ |
11 | 11 | Module::IDENTIFIER => 'AbterPhp\Bootstrap4Website', |
12 | - Module::DEPENDENCIES => ['AbterPhp\Website'], |
|
12 | + Module::DEPENDENCIES => [ 'AbterPhp\Website' ], |
|
13 | 13 | Module::ENABLED => true, |
14 | 14 | Module::HTTP_BOOTSTRAPPERS => [ |
15 | 15 | Bootstrappers\Events\Listeners::class, |
@@ -17,11 +17,11 @@ discard block |
||
17 | 17 | Module::EVENTS => [ |
18 | 18 | WebsiteEvent::WEBSITE_READY => [ |
19 | 19 | /** @see \AbterPhp\Bootstrap4Website\Events\Listeners\WebsiteDecorator::handle */ |
20 | - Priorities::NORMAL => [sprintf('%s@handle', Events\Listeners\WebsiteDecorator::class)], |
|
20 | + Priorities::NORMAL => [ sprintf('%s@handle', Events\Listeners\WebsiteDecorator::class) ], |
|
21 | 21 | ], |
22 | 22 | Event::FORM_READY => [ |
23 | 23 | /** @see \AbterPhp\Bootstrap4Website\Events\Listeners\FormDecorator::handle */ |
24 | - Priorities::EXTREME_LOW => [sprintf('%s@handle', Events\Listeners\FormDecorator::class)], |
|
24 | + Priorities::EXTREME_LOW => [ sprintf('%s@handle', Events\Listeners\FormDecorator::class) ], |
|
25 | 25 | ], |
26 | 26 | ], |
27 | 27 | Module::RESOURCE_PATH => realpath(__DIR__ . '/resources'), |
@@ -29,7 +29,7 @@ |
||
29 | 29 | { |
30 | 30 | $form = $event->getForm(); |
31 | 31 | |
32 | - $nodes = array_merge([$form], $form->getExtendedDescendantNodes()); |
|
32 | + $nodes = array_merge([ $form ], $form->getExtendedDescendantNodes()); |
|
33 | 33 | |
34 | 34 | $this->formDecorator->init()->decorate($nodes); |
35 | 35 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $viewMock |
32 | 32 | ->expects($this->exactly(2)) |
33 | 33 | ->method('setVar') |
34 | - ->withConsecutive(['preHeader', static::HEADER], ['preFooter', static::FOOTER]); |
|
34 | + ->withConsecutive([ 'preHeader', static::HEADER ], [ 'preFooter', static::FOOTER ]); |
|
35 | 35 | |
36 | 36 | /** @var WebsiteReady|MockObject $stubWebsiteReady */ |
37 | 37 | $stubWebsiteReady = $this->createMock(WebsiteReady::class); |
@@ -52,12 +52,12 @@ discard block |
||
52 | 52 | $viewMock |
53 | 53 | ->expects($this->exactly(2)) |
54 | 54 | ->method('getVar') |
55 | - ->withConsecutive(['preHeader'], ['preFooter']) |
|
55 | + ->withConsecutive([ 'preHeader' ], [ 'preFooter' ]) |
|
56 | 56 | ->willReturnOnConsecutiveCalls($setHeader, $setFooter); |
57 | 57 | $viewMock |
58 | 58 | ->expects($this->exactly(2)) |
59 | 59 | ->method('setVar') |
60 | - ->withConsecutive(['preHeader', static::HEADER . $setHeader], ['preFooter', static::FOOTER . $setFooter]); |
|
60 | + ->withConsecutive([ 'preHeader', static::HEADER . $setHeader ], [ 'preFooter', static::FOOTER . $setFooter ]); |
|
61 | 61 | |
62 | 62 | /** @var WebsiteReady|MockObject $stubWebsiteReady */ |
63 | 63 | $stubWebsiteReady = $this->createMock(WebsiteReady::class); |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | |
31 | 31 | public function testHandle() |
32 | 32 | { |
33 | - $nodes = ['foo', 'bar']; |
|
33 | + $nodes = [ 'foo', 'bar' ]; |
|
34 | 34 | |
35 | 35 | $formStub = $this->createMock(IForm::class); |
36 | 36 | $formStub |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | $this->formDecoratorMock |
44 | 44 | ->expects($this->once()) |
45 | 45 | ->method('decorate') |
46 | - ->with([$formStub, 'foo', 'bar']); |
|
46 | + ->with([ $formStub, 'foo', 'bar' ]); |
|
47 | 47 | |
48 | 48 | $this->sut->handle($event); |
49 | 49 | } |
@@ -35,9 +35,9 @@ discard block |
||
35 | 35 | public function decorateProvider(): array |
36 | 36 | { |
37 | 37 | return [ |
38 | - 'label' => [new Label(''), Form::DEFAULT_LABEL_CLASS], |
|
39 | - 'textarea' => [new Textarea('', ''), Form::DEFAULT_INPUT_CLASS], |
|
40 | - 'select' => [new Select('', ''), Form::DEFAULT_INPUT_CLASS], |
|
38 | + 'label' => [ new Label(''), Form::DEFAULT_LABEL_CLASS ], |
|
39 | + 'textarea' => [ new Textarea('', ''), Form::DEFAULT_INPUT_CLASS ], |
|
40 | + 'select' => [ new Select('', ''), Form::DEFAULT_INPUT_CLASS ], |
|
41 | 41 | 'form-group' => [ |
42 | 42 | new FormGroup( |
43 | 43 | $this->createMock(IElement::class), |
@@ -45,8 +45,8 @@ discard block |
||
45 | 45 | ), |
46 | 46 | Form::DEFAULT_FORM_GROUP_CLASS, |
47 | 47 | ], |
48 | - 'default-buttons' => [new DefaultButtons(''), Form::DEFAULT_BUTTONS_CLASS], |
|
49 | - 'buttons' => [new Button(null, [Button::INTENT_FORM]), Form::DEFAULT_BUTTON_CLASS], |
|
48 | + 'default-buttons' => [ new DefaultButtons(''), Form::DEFAULT_BUTTONS_CLASS ], |
|
49 | + 'buttons' => [ new Button(null, [ Button::INTENT_FORM ]), Form::DEFAULT_BUTTON_CLASS ], |
|
50 | 50 | ]; |
51 | 51 | } |
52 | 52 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public function testDecorate(INode $node, string $contains) |
60 | 60 | { |
61 | - $this->sut->decorate([$node]); |
|
61 | + $this->sut->decorate([ $node ]); |
|
62 | 62 | |
63 | 63 | $this->assertStringContainsString($contains, (string)$node); |
64 | 64 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | |
80 | 80 | $node = new CheckboxGroup($inputMock, $labelMock); |
81 | 81 | |
82 | - $this->sut->decorate([$node]); |
|
82 | + $this->sut->decorate([ $node ]); |
|
83 | 83 | |
84 | 84 | $this->assertStringContainsString( |
85 | 85 | Form::CHECKBOX_GROUP_CLASS, |