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

preCheckoutQuery::answer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 2
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 pre-checkout query.
10
 */
11
class preCheckoutQuery 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', 'order_info' => 'BPT\types\orderInfo'];
14
15
    /** Unique query identifier */
16
    public string $id;
17
18
    /** User who sent the query */
19
    public user $from;
20
21
    /** Three-letter ISO 4217 currency code */
22
    public string $currency;
23
24
    /**
25
     * Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$
26
     * 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the
27
     * decimal point for each currency (2 for the majority of currencies).
28
     */
29
    public int $total_amount;
30
31
    /** Bot specified invoice payload */
32
    public string $invoice_payload;
33
34
    /** Optional. Identifier of the shipping option chosen by the user */
35
    public null|string $shipping_option_id = null;
36
37
    /** Optional. Order information provided by the user */
38
    public null|orderInfo $order_info = null;
39
40
41
    public function __construct(stdClass|null $object = null) {
42
        if ($object != null) {
43
            parent::__construct($object, self::subs);
44
        }
45
    }
46
47
    public function answer (bool $ok, string|null $error_message = null): responseError|bool {
48
        return telegram::answerPreCheckoutQuery($ok, $this->id, $error_message);
49
    }
50
}
51