Skip to content

Commit aac9e31

Browse files
committed
code style
1 parent 2e66992 commit aac9e31

File tree

17 files changed

+217
-206
lines changed

17 files changed

+217
-206
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
"symfony/http-kernel": "^4.4 || ^5.2 || ^6.0"
2929
},
3030
"require-dev": {
31-
"contao/manager-plugin": "^2.0"
31+
"contao/manager-plugin": "^2.0",
32+
"friendsofphp/php-cs-fixer": "^2.16 || ^3.0"
3233
},
3334
"autoload": {
3435
"psr-4": {

src/ContaoManager/Plugin.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,25 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
/*
4-
* This file is part of the ContaoSwiper Bundle.
6+
* This file is part of the Contao Swiper Bundle.
57
*
6-
* (c) Fritz Michael Gschwantner <https://github.com/fritzmg>
8+
* (c) inspiredminds
79
*
8-
* For the full copyright and license information, please view the LICENSE
9-
* file that was distributed with this source code.
10+
* @license LGPL-3.0-or-later
1011
*/
1112

1213
namespace ContaoSwiperBundle\ContaoManager;
1314

14-
use ContaoSwiperBundle\ContaoSwiperBundle;
1515
use Contao\CoreBundle\ContaoCoreBundle;
1616
use Contao\ManagerPlugin\Bundle\BundlePluginInterface;
1717
use Contao\ManagerPlugin\Bundle\Config\BundleConfig;
1818
use Contao\ManagerPlugin\Bundle\Parser\ParserInterface;
19-
19+
use ContaoSwiperBundle\ContaoSwiperBundle;
2020

2121
/**
2222
* Plugin for the Contao Manager.
23-
*
24-
* @author Fritz Michael Gschwantner <[email protected]>
2523
*/
2624
class Plugin implements BundlePluginInterface
2725
{
@@ -32,7 +30,7 @@ public function getBundles(ParserInterface $parser): array
3230
{
3331
return [
3432
BundleConfig::create(ContaoSwiperBundle::class)
35-
->setLoadAfter([ContaoCoreBundle::class])
33+
->setLoadAfter([ContaoCoreBundle::class]),
3634
];
3735
}
3836
}

src/ContaoSwiperBundle.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
/*
4-
* This file is part of the ContaoSwiper Bundle.
6+
* This file is part of the Contao Swiper Bundle.
57
*
6-
* (c) Fritz Michael Gschwantner <https://github.com/fritzmg>
8+
* (c) inspiredminds
79
*
8-
* For the full copyright and license information, please view the LICENSE
9-
* file that was distributed with this source code.
10+
* @license LGPL-3.0-or-later
1011
*/
1112

1213
namespace ContaoSwiperBundle;

src/DependencyInjection/ContaoSwiperExtension.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
2+
23
declare(strict_types=1);
34

45
/*
5-
* This file is part of the ContaoSwiper Bundle.
6+
* This file is part of the Contao Swiper Bundle.
67
*
7-
* (c) Fritz Michael Gschwantner <https://github.com/fritzmg>
8+
* (c) inspiredminds
89
*
9-
* For the full copyright and license information, please view the LICENSE
10-
* file that was distributed with this source code.
10+
* @license LGPL-3.0-or-later
1111
*/
1212

1313
namespace ContaoSwiperBundle\DependencyInjection;

src/Elements/WrapperStart.php

Lines changed: 27 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
/*
4-
* This file is part of the ContaoSwiper Bundle.
6+
* This file is part of the Contao Swiper Bundle.
57
*
6-
* (c) Fritz Michael Gschwantner <https://github.com/fritzmg>
8+
* (c) inspiredminds
79
*
8-
* For the full copyright and license information, please view the LICENSE
9-
* file that was distributed with this source code.
10+
* @license LGPL-3.0-or-later
1011
*/
1112

1213
namespace ContaoSwiperBundle\Elements;
@@ -15,50 +16,44 @@
1516
use Contao\ContentElement;
1617
use Contao\System;
1718

18-
1919
/**
2020
* Front end content element "swiper" (wrapper start).
21-
*
22-
* @author Fritz Michael Gschwantner <[email protected]>
2321
*/
2422
class WrapperStart extends ContentElement
2523
{
26-
27-
/**
28-
* Template
29-
* @var string
30-
*/
31-
protected $strTemplate = 'ce_swiperStart';
32-
24+
/**
25+
* Template.
26+
*
27+
* @var string
28+
*/
29+
protected $strTemplate = 'ce_swiperStart';
3330

3431
/**
3532
* Display a wildcard in the back end.
3633
*/
3734
public function generate(): string
3835
{
39-
$request = System::getContainer()->get('request_stack')->getCurrentRequest();
36+
$request = System::getContainer()->get('request_stack')->getCurrentRequest();
4037

41-
if ($request && System::getContainer()->get('contao.routing.scope_matcher')->isBackendRequest($request))
42-
{
38+
if ($request && System::getContainer()->get('contao.routing.scope_matcher')->isBackendRequest($request)) {
4339
return (new BackendTemplate('be_wildcard'))->parse();
4440
}
4541

4642
return parent::generate();
4743
}
4844

49-
50-
/**
51-
* Generate the content element
52-
*/
53-
protected function compile(): void
54-
{
55-
// additional css classes
56-
$arrClasses = explode(' ', $this->cssID[1] ?? '');
57-
$arrClasses = System::getContainer()->get('fritzmg.contao_swiper.renderer')->addCssClasses($this, $arrClasses);
58-
59-
// set classes
60-
$arrCssID = $this->cssID;
61-
$arrCssID[1] = implode(' ', $arrClasses);
62-
$this->cssID = $arrCssID;
63-
}
45+
/**
46+
* Generate the content element.
47+
*/
48+
protected function compile(): void
49+
{
50+
// additional css classes
51+
$arrClasses = explode(' ', $this->cssID[1] ?? '');
52+
$arrClasses = System::getContainer()->get('fritzmg.contao_swiper.renderer')->addCssClasses($this, $arrClasses);
53+
54+
// set classes
55+
$arrCssID = $this->cssID;
56+
$arrCssID[1] = implode(' ', $arrClasses);
57+
$this->cssID = $arrCssID;
58+
}
6459
}

src/Elements/WrapperStop.php

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
/*
4-
* This file is part of the ContaoSwiper Bundle.
6+
* This file is part of the Contao Swiper Bundle.
57
*
6-
* (c) Fritz Michael Gschwantner <https://github.com/fritzmg>
8+
* (c) inspiredminds
79
*
8-
* For the full copyright and license information, please view the LICENSE
9-
* file that was distributed with this source code.
10+
* @license LGPL-3.0-or-later
1011
*/
1112

1213
namespace ContaoSwiperBundle\Elements;
@@ -17,40 +18,34 @@
1718
use Contao\System;
1819
use ContaoSwiperBundle\Renderer\SwiperRenderer;
1920

20-
2121
/**
2222
* Front end content element "swiper" (wrapper stop).
23-
*
24-
* @author Fritz Michael Gschwantner <[email protected]>
2523
*/
2624
class WrapperStop extends ContentElement
2725
{
28-
2926
/**
30-
* Template
27+
* Template.
28+
*
3129
* @var string
3230
*/
3331
protected $strTemplate = 'ce_swiperStop';
3432

35-
3633
/**
3734
* Display a wildcard in the back end.
3835
*/
3936
public function generate(): string
4037
{
41-
$request = System::getContainer()->get('request_stack')->getCurrentRequest();
38+
$request = System::getContainer()->get('request_stack')->getCurrentRequest();
4239

43-
if ($request && System::getContainer()->get('contao.routing.scope_matcher')->isBackendRequest($request))
44-
{
40+
if ($request && System::getContainer()->get('contao.routing.scope_matcher')->isBackendRequest($request)) {
4541
return (new BackendTemplate('be_wildcard'))->parse();
4642
}
4743

4844
return parent::generate();
4945
}
5046

51-
5247
/**
53-
* Generate the content element
48+
* Generate the content element.
5449
*/
5550
protected function compile(): void
5651
{
@@ -68,9 +63,9 @@ protected function compile(): void
6863
$this->sorting,
6964
'swiperStart',
7065
],
71-
'order' => "$t.sorting DESC",
72-
'limit' => 1,
73-
'return' => 'Model'
66+
'order' => "$t.sorting DESC",
67+
'limit' => 1,
68+
'return' => 'Model',
7469
]);
7570

7671
if (null !== $objContent) {

src/Migration/GroupWidgetMigration.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
declare(strict_types=1);
44

5+
/*
6+
* This file is part of the Contao Swiper Bundle.
7+
*
8+
* (c) inspiredminds
9+
*
10+
* @license LGPL-3.0-or-later
11+
*/
12+
513
namespace InspiredMinds\ContaoSwiperBundle\Migration;
614

715
use Contao\CoreBundle\Migration\AbstractMigration;

src/Renderer/SwiperRenderer.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
<?php
2+
23
declare(strict_types=1);
34

45
/*
5-
* This file is part of the ContaoSwiper Bundle.
6+
* This file is part of the Contao Swiper Bundle.
67
*
7-
* (c) Fritz Michael Gschwantner <https://github.com/fritzmg>
8+
* (c) inspiredminds
89
*
9-
* For the full copyright and license information, please view the LICENSE
10-
* file that was distributed with this source code.
10+
* @license LGPL-3.0-or-later
1111
*/
1212

13-
1413
namespace ContaoSwiperBundle\Renderer;
1514

1615
use Contao\ContentElement;

src/Resources/contao/config/config.php

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
/*
4-
* This file is part of the ContaoSwiper Bundle.
6+
* This file is part of the Contao Swiper Bundle.
57
*
6-
* (c) Fritz Michael Gschwantner <https://github.com/fritzmg>
8+
* (c) inspiredminds
79
*
8-
* For the full copyright and license information, please view the LICENSE
9-
* file that was distributed with this source code.
10+
* @license LGPL-3.0-or-later
1011
*/
1112

12-
13-
/**
13+
/*
1414
* Content elements
1515
*/
1616
$GLOBALS['TL_CTE']['slider']['swiperStart'] = 'ContaoSwiperBundle\Elements\WrapperStart';
1717
$GLOBALS['TL_CTE']['slider']['swiperStop'] = 'ContaoSwiperBundle\Elements\WrapperStop';
18-
unset($GLOBALS['TL_CTE']['slider']['sliderStart']);
19-
unset($GLOBALS['TL_CTE']['slider']['sliderStop']);
18+
unset($GLOBALS['TL_CTE']['slider']['sliderStart'], $GLOBALS['TL_CTE']['slider']['sliderStop']);
19+
2020
$GLOBALS['TL_LANG']['CTE']['swiperStart'] = &$GLOBALS['TL_LANG']['CTE']['sliderStart'];
2121
$GLOBALS['TL_LANG']['CTE']['swiperStop'] = &$GLOBALS['TL_LANG']['CTE']['sliderStop'];
2222

23-
24-
/**
23+
/*
2524
* Wrapper elements
2625
*/
2726
$GLOBALS['TL_WRAPPERS']['start'][] = 'swiperStart';

0 commit comments

Comments
 (0)