Passed
Pull Request — master (#76)
by
unknown
11:56
created

AnyIdType   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 5
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
eloc 2
c 1
b 0
f 1
dl 0
loc 5
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace hiqdev\php\billing\type;
4
5
/**
6
 * AnyIdType class.
7
 *
8
 * This class simplifies the creation of Type instances where the ID is always
9
 *  set to `Type::ANY`, which is used to represent a wildcard or "any" match for the ID.
10
 *  It reduces the repetitive creation of Type objects with `Type::ANY` as the ID.
11
 *
12
 *  Example:
13
 *  Instead of:
14
 *      new Type(Type::ANY, 'monthly,leasing');
15
 *  You can use:
16
 *      new AnyIdType('monthly,leasing');
17
 */
18
class AnyIdType extends Type
19
{
20
    public function __construct($name)
21
    {
22
        parent::__construct(self::ANY, $name);
23
    }
24
}
25