ReplyToMessage::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 7
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 2
1
<?php
2
3
4
namespace TelegramBot\Entities;
5
6
/**
7
 * Class ReplyToMessage
8
 *
9
 * @todo Is this even required?!
10
 */
11
class ReplyToMessage extends Message
12
{
13
14
    /**
15
     * ReplyToMessage constructor.
16
     *
17
     * @param array $data
18
     * @param string $bot_username
19
     */
20
    public function __construct(array $data, string $bot_username = '')
21
    {
22
        //As explained in the documentation
23
        //Reply to message can't contain other reply to message entities
24
        unset($data['reply_to_message']);
25
26
        parent::__construct($data, $bot_username);
0 ignored issues
show
Unused Code introduced by
The call to TelegramBot\Entity::__construct() has too many arguments starting with $bot_username. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

26
        parent::/** @scrutinizer ignore-call */ 
27
                __construct($data, $bot_username);

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
27
    }
28
29
}
30