Passed
Push — main ( 1f3d08...95c480 )
by Miaad
10:28
created

shippingQuery::answer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 3
dl 0
loc 2
rs 10
1
<?php
2
3
namespace BPT\types;
4
5
use BPT\telegram\telegram;
6
use stdClass;
7
8
/**
9
 * This object contains information about an incoming shipping query.
10
 */
11
class shippingQuery 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...
12
    /** Keep all of properties which has sub properties */
13
    private const subs = ['from' => 'BPT\types\user', 'shipping_address' => 'BPT\types\shippingAddress'];
14
15
    /** Unique query identifier */
16
    public string $id;
17
18
    /** User who sent the query */
19
    public user $from;
20
21
    /** Bot specified invoice payload */
22
    public string $invoice_payload;
23
24
    /** User specified shipping address */
25
    public shippingAddress $shipping_address;
26
27
28
    public function __construct(stdClass|null $object = null) {
29
        if ($object != null) {
30
            parent::__construct($object, self::subs);
31
        }
32
    }
33
34
    public function answer (bool $ok, null|array $shipping_options = null, string|null $error_message = null): responseError|bool {
35
        return telegram::answerShippingQuery($ok, $this->id, $shipping_options, $error_message);
36
    }
37
}
38