SupplierController   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 15
c 1
b 0
f 0
dl 0
loc 31
rs 10
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A detailAction() 0 5 1
A removeMetatags() 0 15 3
1
<?php
2
3
/**
4
 * @license GPLv3, http://www.gnu.org/copyleft/gpl.html
5
 * @copyright Metaways Infosystems GmbH, 2012
6
 * @copyright Aimeos (aimeos.org), 2014-2020
7
 * @package TYPO3
8
 */
9
10
11
namespace Aimeos\Aimeos\Controller;
12
13
14
use Aimeos\Aimeos\Base;
15
use TYPO3\CMS\Core\Utility\GeneralUtility;
0 ignored issues
show
Bug introduced by
The type TYPO3\CMS\Core\Utility\GeneralUtility was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
16
17
18
/**
19
 * Aimeos supplier controller.
20
 *
21
 * @package TYPO3
22
 */
23
class SupplierController extends AbstractController
24
{
25
    /**
26
     * Renders the supplier detail section.
27
     */
28
    public function detailAction()
29
    {
30
        $this->removeMetatags();
31
        $client = \Aimeos\Client\Html::create($this->context(), 'supplier/detail');
32
        return $this->getClientOutput($client);
33
    }
34
35
36
    /**
37
     * Removes the meta tags if available
38
     */
39
    protected function removeMetatags()
40
    {
41
        if (class_exists('\TYPO3\CMS\Core\MetaTag\MetaTagManagerRegistry')
42
            && !\Aimeos\Aimeos\Base::getExtConfig('typo3Metatags', true)
43
        ) {
44
            $registry = GeneralUtility::makeInstance('TYPO3\CMS\Core\MetaTag\MetaTagManagerRegistry');
45
46
            $registry->getManagerForProperty('keywords')->removeProperty('keywords');
47
            $registry->getManagerForProperty('description')->removeProperty('description');
48
            $registry->getManagerForProperty('og:type')->removeProperty('og:type');
49
            $registry->getManagerForProperty('og:title')->removeProperty('og:title');
50
            $registry->getManagerForProperty('og:url')->removeProperty('og:url');
51
            $registry->getManagerForProperty('og:description')->removeProperty('og:description');
52
            $registry->getManagerForProperty('og:image')->removeProperty('og:image');
53
            $registry->getManagerForProperty('twitter:card')->removeProperty('twitter:card');
54
        }
55
    }
56
}
57