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

messageOrigin   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 12
c 1
b 0
f 0
dl 0
loc 35
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 origin of a message.
9
 */
10
class messageOrigin 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 = ['sender_user' => 'BPT\types\user', 'sender_chat' => 'BPT\types\chat', 'chat' => 'BPT\types\chat'];
13
14
    /** Could be "user" or "hidden_user" or "chat" or "channel" */
15
    public string $type;
16
17
    /** Date the message was sent originally in Unix time */
18
    public int $date;
19
20
    /** `user` only. User that sent the message originally */
21
    public null|user $sender_user = null;
22
23
    /** `hidden_user` only. Name of the user that sent the message originally */
24
    public null|string $sender_user_name = null;
25
26
    /** `chat` only. Chat that sent the message originally */
27
    public null|chat $sender_chat = null;
28
29
    /**
30
     * `chat` and `channel` only. Signature of the original post author, For messages originally sent by an anonymous
31
     * chat administrator, original message author signature
32
     */
33
    public null|string $author_signature = null;
34
35
    /** `channel` only. Channel chat to which the message was originally sent */
36
    public null|chat $chat = null;
37
38
    /** `channel` only. Unique message identifier inside the chat */
39
    public null|int $message_id = null;
40
41
42
    public function __construct(stdClass|null $object = null) {
43
        if ($object != null) {
44
            parent::__construct($object, self::subs);
45
        }
46
    }
47
}