Skip to content

Commit 9305aa0

Browse files
authored
Merge branch 'phiamo:master' into master
2 parents 383c254 + 0379e3f commit 9305aa0

File tree

12 files changed

+74
-61
lines changed

12 files changed

+74
-61
lines changed

.github/workflows/continuous-integration.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ jobs:
1111
- name: 'Setup PHP'
1212
uses: 'shivammathur/setup-php@v2'
1313
with:
14-
php-version: '7.2'
14+
php-version: '8.1'
1515
coverage: 'none'
1616
extensions: 'json, mbstring, tokenizer'
17-
tools: 'composer-normalize, php-cs-fixer:2.18.6'
17+
tools: 'composer-normalize, php-cs-fixer:3.11.0'
1818

1919
- name: 'Display tools versions'
2020
run: |
2121
composer-normalize --version
2222
php-cs-fixer --version
2323
2424
- name: 'Check PHP code'
25-
run: 'php-cs-fixer fix --diff --dry-run --allow-risky=yes --using-cache=false'
25+
run: 'php-cs-fixer fix --diff --dry-run --allow-risky=yes --using-cache=no'
2626

2727
- name: 'Check composer.json'
2828
run: 'composer-normalize --diff --dry-run --no-update-lock'
@@ -39,6 +39,7 @@ jobs:
3939
- '7.3'
4040
- '7.4'
4141
- '8.0'
42+
- '8.1'
4243
symfony:
4344
- '5.*'
4445
twig:
@@ -81,7 +82,7 @@ jobs:
8182
env:
8283
SYMFONY_REQUIRE: '${{ matrix.symfony }}'
8384
run: |
84-
composer global require --no-progress --no-scripts --no-plugins symfony/flex
85+
composer require --no-progress --no-scripts --no-plugins symfony/flex
8586
composer update --no-interaction --no-progress --ansi ${{ matrix.composer_flags }}
8687
8788
- name: 'Run unit tests'
Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
$header = <<<EOF
3+
$header = <<<'EOF'
44
This file is part of the MopaBootstrapBundle.
55
66
(c) Philipp A. Mohrenweiser <phiamo@googlemail.com>
@@ -9,20 +9,25 @@
99
file that was distributed with this source code.
1010
EOF;
1111

12-
return PhpCsFixer\Config::create()
12+
$finder = PhpCsFixer\Finder::create()
13+
->exclude([
14+
'vendor',
15+
])
16+
->in(__DIR__)
17+
;
18+
19+
return ($config = new PhpCsFixer\Config())
1320
->setRules([
1421
'@Symfony' => true,
1522
'array_syntax' => ['syntax' => 'short'],
1623
'header_comment' => ['header' => $header],
1724
'full_opening_tag' => false,
1825
'list_syntax' => ['syntax' => 'short'],
1926
'native_constant_invocation' => true,
20-
'native_function_invocation' => true,
27+
'native_function_invocation' => [
28+
'include' => ['@all'],
29+
],
2130
'yoda_style' => false,
2231
])
23-
->setFinder(
24-
PhpCsFixer\Finder::create()
25-
->exclude('vendor')
26-
->in(__DIR__)
27-
)
32+
->setFinder($finder)
2833
;

DependencyInjection/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
class Configuration implements ConfigurationInterface
1919
{
20-
const KEY = 'mopa_bootstrap';
20+
public const KEY = 'mopa_bootstrap';
2121

2222
/**
2323
* {@inheritdoc}

Form/Type/FormActionsType.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ public function buildForm(FormBuilderInterface $builder, array $options)
4242
* @param $name
4343
* @param $config
4444
*
45-
* @throws \InvalidArgumentException
46-
*
4745
* @return ButtonBuilder
46+
*
47+
* @throws \InvalidArgumentException
4848
*/
4949
protected function createButton($builder, $name, $config)
5050
{

Tests/Form/AbstractDivLayoutTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ protected function getWidgetCollectionFormTypeExtension()
250250
*/
251251
protected function assertMatchesXpath($html, $expression, $count = 1)
252252
{
253-
$dom = new \DomDocument('UTF-8');
253+
$dom = new \DOMDocument('UTF-8');
254254
try {
255255
// Wrap in <root> node so we can load HTML with multiple tags at
256256
// the top level

Tests/Form/AddonLayoutTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ public function testTextPrepend()
3030

3131
$this->assertMatchesXpath(
3232
$html,
33-
'
33+
<<<'EOT'
3434
/div[@class="input-group"]
3535
[
3636
./span[@class="input-group-addon"][.="[trans]foo[/trans]"]
3737
/following-sibling::input[@type="text"][@id="name"][@name="name"]
3838
]
39-
'
39+
EOT
4040
);
4141
}
4242

@@ -55,7 +55,7 @@ public function testIconPrepend()
5555

5656
$this->assertMatchesXpath(
5757
$html,
58-
'
58+
<<<'EOT'
5959
/div[@class="input-group"]
6060
[
6161
./span[@class="input-group-addon"]
@@ -64,7 +64,7 @@ public function testIconPrepend()
6464
]
6565
/following-sibling::input[@type="text"][@id="name"][@name="name"]
6666
]
67-
'
67+
EOT
6868
);
6969
}
7070

@@ -83,13 +83,13 @@ public function testTextAppend()
8383

8484
$this->assertMatchesXpath(
8585
$html,
86-
'
86+
<<<'EOT'
8787
/div[@class="input-group"]
8888
[
8989
./input[@type="text"][@id="name"][@name="name"]
9090
/following-sibling::span[@class="input-group-addon"][.="[trans]foo[/trans]"]
9191
]
92-
'
92+
EOT
9393
);
9494
}
9595

@@ -108,7 +108,7 @@ public function testIconAppend()
108108

109109
$this->assertMatchesXpath(
110110
$html,
111-
'
111+
<<<'EOT'
112112
/div[@class="input-group"]
113113
[
114114
./input[@type="text"][@id="name"][@name="name"]
@@ -117,7 +117,7 @@ public function testIconAppend()
117117
./i[@class="icon-cog"]
118118
]
119119
]
120-
'
120+
EOT
121121
);
122122
}
123123
}

Tests/Form/CollectionLayoutTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function testDefaultCollection()
3535
$html = $this->renderWidget($view);
3636
$this->assertMatchesXpath(
3737
$this->removeBreaks($html),
38-
'
38+
<<<'EOT'
3939
/fieldset
4040
[
4141
./div[@class="form-group"]
@@ -99,7 +99,7 @@ public function testDefaultCollection()
9999
]
100100
]
101101
]
102-
'
102+
EOT
103103
);
104104
}
105105

@@ -122,7 +122,7 @@ public function testChildrenNotHorizontal()
122122
$html = $this->renderWidget($view);
123123
$this->assertMatchesXpath(
124124
$this->removeBreaks($html),
125-
'
125+
<<<'EOT'
126126
/fieldset
127127
[
128128
./div[@class="form-group"]
@@ -177,7 +177,7 @@ public function testChildrenNotHorizontal()
177177
]
178178
]
179179
]
180-
'
180+
EOT
181181
);
182182
}
183183

@@ -201,7 +201,7 @@ public function testChildrenHorizontal()
201201
$html = $this->renderWidget($view);
202202
$this->assertMatchesXpath(
203203
$this->removeBreaks($html),
204-
'
204+
<<<'EOT'
205205
/fieldset
206206
[
207207
./div[@class="form-group"]
@@ -263,7 +263,7 @@ public function testChildrenHorizontal()
263263
]
264264
]
265265
]
266-
'
266+
EOT
267267
);
268268
}
269269

@@ -286,7 +286,7 @@ public function testAllNotHorizontal()
286286
$html = $this->renderWidget($view);
287287
$this->assertMatchesXpath(
288288
$this->removeBreaks($html),
289-
'
289+
<<<'EOT'
290290
/fieldset
291291
[
292292
./div[@class="form-group"]
@@ -338,7 +338,7 @@ public function testAllNotHorizontal()
338338
]
339339
]
340340
]
341-
'
341+
EOT
342342
);
343343
}
344344
}

Tests/Form/LegendLayoutTest.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ public function testAsterisk()
2727
$html = $this->renderLabel($view);
2828
$this->assertMatchesXpath(
2929
$this->removeBreaks($html),
30-
'
30+
<<<'EOT'
3131
/label[@for="name"][@class="control-label col-sm-3 required"]
3232
[
3333
./span[@class="asterisk"][.="*"]
3434
]
35-
'
35+
EOT
3636
);
3737
}
3838

@@ -48,15 +48,15 @@ public function testRenderFieldset()
4848

4949
$this->assertMatchesXpath(
5050
$html,
51-
'
51+
<<<'EOT'
5252
/form
5353
[
5454
./fieldset
5555
[
5656
./div[@class="form-group"]
5757
]
5858
]
59-
'
59+
EOT
6060
);
6161
}
6262

@@ -72,12 +72,12 @@ public function testNoRenderFieldset()
7272

7373
$this->assertMatchesXpath(
7474
$html,
75-
'
75+
<<<'EOT'
7676
/form
7777
[
7878
./div[@class="form-group"]
7979
]
80-
'
80+
EOT
8181
);
8282
}
8383

@@ -93,7 +93,7 @@ public function testRenderLegend()
9393

9494
$this->assertMatchesXpath(
9595
$html,
96-
'
96+
<<<'EOT'
9797
/form
9898
[
9999
./fieldset
@@ -102,7 +102,7 @@ public function testRenderLegend()
102102
/following-sibling::div[@class="form-group"]
103103
]
104104
]
105-
'
105+
EOT
106106
);
107107
}
108108

@@ -118,15 +118,15 @@ public function testNoRenderLegend()
118118

119119
$this->assertMatchesXpath(
120120
$html,
121-
'
121+
<<<'EOT'
122122
/form
123123
[
124124
./fieldset
125125
[
126126
not(./legend)
127127
]
128128
]
129-
'
129+
EOT
130130
);
131131
}
132132

@@ -142,7 +142,7 @@ public function testLegendTag()
142142

143143
$this->assertMatchesXpath(
144144
$html,
145-
'
145+
<<<'EOT'
146146
/form
147147
[
148148
./fieldset
@@ -151,7 +151,7 @@ public function testLegendTag()
151151
/following-sibling::div[@class="form-group"]
152152
]
153153
]
154-
'
154+
EOT
155155
);
156156
}
157157

@@ -166,12 +166,12 @@ public function testLabelRender()
166166
$html = $this->renderRow($view);
167167
$this->assertMatchesXpath(
168168
$this->removeBreaks($html),
169-
'
169+
<<<'EOT'
170170
/div[@class="form-group"]
171171
[
172172
not(./label)
173173
]
174-
'
174+
EOT
175175
);
176176
}
177177
}

Tests/Form/SimpleDivLayoutTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,13 @@ public function testHorizontalRow()
2929

3030
$this->assertMatchesXpath(
3131
$html,
32-
'/div[@class="form-group"]
32+
<<<'EOT'
33+
/div[@class="form-group"]
3334
[
3435
./label[@for="name"][@class="control-label col-sm-3 required"]
3536
/following-sibling::div[@class="col-sm-9"]
3637
]
37-
'
38+
EOT
3839
);
3940
}
4041

@@ -51,13 +52,13 @@ public function testInlineRow()
5152

5253
$this->assertMatchesXpath(
5354
$html,
54-
'
55+
<<<'EOT'
5556
/div[@class="form-group"]
5657
[
5758
./label[@for="name"][@class="required"]
5859
/following-sibling::input[@type="text"][@id="name"][@name="name"][@required="required"]
5960
]
60-
'
61+
EOT
6162
);
6263
}
6364
}

0 commit comments

Comments
 (0)