Skip to content

Commit a388f4b

Browse files
committed
Call class with ::class and do not use contao class from global namespace
1 parent e35a820 commit a388f4b

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

src/MetaModels/Attribute/Checkbox/AttributeTypeFactory.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* This file is part of MetaModels/attribute_checkbox.
55
*
6-
* (c) 2012-2016 The MetaModels team.
6+
* (c) 2012-2018 The MetaModels team.
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.
@@ -13,7 +13,8 @@
1313
* @package MetaModels
1414
* @subpackage AttributeCheckbox
1515
* @author Christian Schiffler <c.schiffler@cyberspectrum.de>
16-
* @copyright 2012-2016 The MetaModels team.
16+
* @author Sven Baumann <baumann.sv@gmail.com>
17+
* @copyright 2012-2018 The MetaModels team.
1718
* @license https://github.com/MetaModels/attribute_checkbox/blob/master/LICENSE LGPL-3.0
1819
* @filesource
1920
*/
@@ -36,6 +37,6 @@ public function __construct()
3637

3738
$this->typeName = 'checkbox';
3839
$this->typeIcon = 'system/modules/metamodelsattribute_checkbox/html/checkbox.png';
39-
$this->typeClass = 'MetaModels\Attribute\Checkbox\Checkbox';
40+
$this->typeClass = Checkbox::class;
4041
}
4142
}

src/MetaModels/Events/Attribute/Checkbox/Listener.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
namespace MetaModels\Events\Attribute\Checkbox;
2424

25+
use Contao\FilesModel;
2526
use ContaoCommunityAlliance\DcGeneral\Contao\DataDefinition\Definition\Contao2BackendViewDefinition;
2627
use ContaoCommunityAlliance\DcGeneral\Contao\DataDefinition\Definition\Contao2BackendViewDefinitionInterface;
2728
use ContaoCommunityAlliance\DcGeneral\DataDefinition\Definition\View\ToggleCommand;
@@ -75,8 +76,8 @@ protected function buildCommand($attribute)
7576
);
7677
$extra = $toggle->getExtra();
7778
$extra['icon'] = 'visible.gif';
78-
$objIconEnabled = \FilesModel::findByUuid($attribute->get('check_listviewicon'));
79-
$objIconDisabled = \FilesModel::findByUuid($attribute->get('check_listviewicondisabled'));
79+
$objIconEnabled = FilesModel::findByUuid($attribute->get('check_listviewicon'));
80+
$objIconDisabled = FilesModel::findByUuid($attribute->get('check_listviewicondisabled'));
8081

8182
if ($attribute->get('check_listview') == 1 && $objIconEnabled->path && $objIconDisabled->path) {
8283
$extra['icon'] = $objIconEnabled->path;

src/MetaModels/Filter/Setting/Published/FilterSettingTypeFactory.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* This file is part of MetaModels/attribute_checkbox.
55
*
6-
* (c) 2012-2016 The MetaModels team.
6+
* (c) 2012-2018 The MetaModels team.
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.
@@ -13,7 +13,8 @@
1313
* @package MetaModels
1414
* @subpackage AttributeCheckbox
1515
* @author Christian Schiffler <c.schiffler@cyberspectrum.de>
16-
* @copyright 2012-2016 The MetaModels team.
16+
* @author Sven Baumann <baumann.sv@gmail.com>
17+
* @copyright 2012-2018 The MetaModels team.
1718
* @license https://github.com/MetaModels/attribute_checkbox/blob/master/LICENSE LGPL-3.0
1819
* @filesource
1920
*/
@@ -36,7 +37,7 @@ public function __construct()
3637
$this
3738
->setTypeName('checkbox_published')
3839
->setTypeIcon('system/modules/metamodels/html/visible.png')
39-
->setTypeClass('MetaModels\Filter\Setting\Published\Checkbox')
40+
->setTypeClass(Checkbox::class)
4041
->allowAttributeTypes('checkbox');
4142
}
4243
}

0 commit comments

Comments
 (0)