Send::money()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 9
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 4
dl 9
loc 9
rs 9.6666
c 0
b 0
f 0
1
<?php namespace FreedomCore\TrinityCore\Console\Commands;
2
3
use FreedomCore\TrinityCore\Console\Abstracts\BaseCommand;
4
use FreedomCore\TrinityCore\Support\Classes\Items;
5
6
/**
7
 * Class Send
8
 * @package FreedomCore\TrinityCore\Console\Commands
9
 * @codeCoverageIgnore
10
 */
11
class Send extends BaseCommand
12
{
13
14
    /**
15
     * Send Items To The Player
16
     * @param string $playerName
17
     * @param string $mailSubject
18
     * @param string $mailText
19
     * @param Items $items
20
     * @return array|string
21
     */
22 View Code Duplication
    public function items(string $playerName, string $mailSubject, string $mailText, Items $items)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
23
    {
24
        return $this->executeCommand(__FUNCTION__, [
25
            'playerName'    =>  $playerName,
26
            'mailSubject'   =>  $this->inQuotes($mailSubject),
27
            'mailText'      =>  $this->inQuotes($mailText),
28
            'items'         =>  $items->toCommandAttribute()
29
        ]);
30
    }
31
32
    /**
33
     * Send mail to the player
34
     * @param string $playerName
35
     * @param string $mailSubject
36
     * @param string $mailText
37
     * @return array|string
38
     */
39 View Code Duplication
    public function mail(string $playerName, string $mailSubject, string $mailText)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
40
    {
41
        return $this->executeCommand(__FUNCTION__, [
42
            'playerName'    =>  $playerName,
43
            'mailSubject'   =>  $this->inQuotes($mailSubject),
44
            'mailText'      =>  $this->inQuotes($mailText)
45
        ]);
46
    }
47
48
    /**
49
     * Send message to the player which will appear in the middle of the screen
50
     * @param string $playerName
51
     * @param string $message
52
     * @return array|string
53
     */
54
    public function message(string $playerName, string $message)
55
    {
56
        return $this->executeCommand(__FUNCTION__, get_defined_vars());
57
    }
58
59
    /**
60
     * Send money to the player
61
     * @param string $playerName
62
     * @param string $mailSubject
63
     * @param string $mailText
64
     * @param int $amount
65
     * @return array|string
66
     */
67 View Code Duplication
    public function money(string $playerName, string $mailSubject, string $mailText, int $amount)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
68
    {
69
        return $this->executeCommand(__FUNCTION__, [
70
            'playerName'    =>  $playerName,
71
            'mailSubject'   =>  $this->inQuotes($mailSubject),
72
            'mailText'      =>  $this->inQuotes($mailText),
73
            'amount'        =>  $amount
74
        ]);
75
    }
76
}
77