Passed
Push — main ( 8c6c55...1af2d8 )
by Miaad
12:23 queued 14s
created

chatBoostSource   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 2
1
<?php
2
3
namespace BPT\types;
4
5
use stdClass;
6
7
/**
8
 * This object describes the source of a chat boost.
9
 */
10
class chatBoostSource extends types {
0 ignored issues
show
Bug introduced by
The type BPT\types\types 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...
11
    /** Keep all properties which has sub properties */
12
    private const subs = ['user' => 'BPT\types\user'];
13
14
    /** Could be "premium", "gift_code" or "giveaway" */
15
    public string $source;
16
17
    /**
18
     * User(premium) that boosted the chat,
19
     * Or User(gift_code) for which the gift code was created
20
     * Or User(giveaway) that won the prize in the giveaway if any
21
     */
22
    public null|user $user = null;
23
24
    /**
25
     * `giveaway` only. Identifier of a message in the chat with the giveaway; the message could have been deleted
26
     * already. May be 0 if the message isn't sent yet.
27
     */
28
    public null|int $giveaway_message_id = null;
29
30
    /** `giveaway` only. Optional. True, if the giveaway was completed, but there was no user to win the prize */
31
    public null|bool $is_unclaimed = null;
32
33
34
    public function __construct(stdClass|null $object = null) {
35
        if ($object != null) {
36
            parent::__construct($object, self::subs);
37
        }
38
    }
39
}