IsStringViewHelper::evaluateCondition()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 1
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 6
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ApacheSolrForTypo3\Tika\ViewHelpers\Backend;
6
7
/*
8
 * This file is part of the TYPO3 CMS project.
9
 *
10
 * It is free software; you can redistribute it and/or modify it under
11
 * the terms of the GNU General Public License, either version 2
12
 * of the License, or any later version.
13
 *
14
 * For the full copyright and license information, please read the
15
 * LICENSE.txt file that was distributed with this source code.
16
 *
17
 * The TYPO3 project - inspiring people to share!
18
 */
19
20
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractConditionViewHelper;
21
22
/**
23
 * Condition for checking if type is a string.
24
 *
25
 * @todo: Find TYPO3/Fluid core way for that trouble and reuse it on {@link \ApacheSolrForTypo3\Solr\ViewHelpers\Backend\IsStringViewHelper}
26
 */
27
class IsStringViewHelper extends AbstractConditionViewHelper
28
{
29
    /**
30
     * Initialize ViewHelper arguments
31
     *
32
     * @noinspection PhpUnused
33
     */
34
    public function initializeArguments()
35
    {
36
        parent::initializeArguments();
37
        $this->registerArgument('value', 'mixed', 'Value to be verified.', true);
38
    }
39
40
    /**
41
     * This method decides if the condition is true or false
42
     *
43
     * @param array $arguments ViewHelper arguments to evaluate the condition for this ViewHelper.
44
     * @return bool
45
     * @noinspection PhpMissingReturnTypeInspection
46
     * @noinspection PhpUnused
47
     */
48
    protected static function evaluateCondition($arguments = null)
49
    {
50
        return isset($arguments['value']) && is_string($arguments['value']);
51
    }
52
}
53