‪TYPO3CMS  11.5
ConditionMatcherUserFuncs.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
18 namespace {
20  {
21  return count(func_get_args()) === 0;
22  }
23 
25  {
26  return func_num_args() === 1;
27  }
28 
30  {
31  return func_num_args() === 3;
32  }
33 
34  function ‪user_testFunctionWithThreeArgumentsSpaces(...$arguments): bool
35  {
36  $result = true;
37  foreach ($arguments as $argument) {
38  $result &= (trim($argument) == $argument);
39  }
40  return $result;
41  }
42 
43  function ‪user_testFunctionWithSpaces($value): bool
44  {
45  return $value === ' 3, 4, 5, 6 ';
46  }
47 
48  function ‪user_testFunction(): bool
49  {
50  return true;
51  }
52 
53  function ‪user_testFunctionFalse(): bool
54  {
55  return false;
56  }
57 
58  function ‪user_testFunctionWithQuoteMissing($value): bool
59  {
60  return $value === 'value "';
61  }
62 
63  function ‪user_testQuotes($value): bool
64  {
65  return $value === '1 " 2';
66  }
67 
69  {
74  public static function ‪isTrue($value): bool
75  {
76  return (bool)$value;
77  }
78  }
79 }
‪user_testFunctionWithSpaces
‪user_testFunctionWithSpaces($value)
Definition: ConditionMatcherUserFuncs.php:43
‪user_testFunctionWithNoArgument
‪user_testFunctionWithNoArgument()
Definition: ConditionMatcherUserFuncs.php:19
‪user_testQuotes
‪user_testQuotes($value)
Definition: ConditionMatcherUserFuncs.php:63
‪user_testFunctionWithThreeArguments
‪user_testFunctionWithThreeArguments()
Definition: ConditionMatcherUserFuncs.php:29
‪user_testFunction
‪user_testFunction()
Definition: ConditionMatcherUserFuncs.php:48
‪ConditionMatcherUserFunctions
Definition: ConditionMatcherUserFuncs.php:69
‪ConditionMatcherUserFunctions\isTrue
‪static bool isTrue($value)
Definition: ConditionMatcherUserFuncs.php:74
‪user_testFunctionWithSingleArgument
‪user_testFunctionWithSingleArgument()
Definition: ConditionMatcherUserFuncs.php:24
‪user_testFunctionWithQuoteMissing
‪user_testFunctionWithQuoteMissing($value)
Definition: ConditionMatcherUserFuncs.php:58
‪user_testFunctionWithThreeArgumentsSpaces
‪user_testFunctionWithThreeArgumentsSpaces(... $arguments)
Definition: ConditionMatcherUserFuncs.php:34
‪user_testFunctionFalse
‪user_testFunctionFalse()
Definition: ConditionMatcherUserFuncs.php:53