Issues (19)

Security Analysis    no request data  

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

src/Message/Font.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/*
3
 * This file is part of the slince/smartqq package.
4
 *
5
 * (c) Slince <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Slince\SmartQQ\Message;
12
13
class Font
14
{
15
    /**
16
     * 名称.
17
     *
18
     * @var string
19
     */
20
    protected $name;
21
22
    /**
23
     * 颜色.
24
     *
25
     * @var string
26
     */
27
    protected $color;
28
29
    /**
30
     * 字号.
31
     *
32
     * @var string
33
     */
34
    protected $size;
35
36
    /**
37
     * 风格,具体不知效果.
38
     *
39
     * @var string
40
     */
41
    protected $style;
42
43
    public function __construct($name, $color, $size, array $style = [])
44
    {
45
        $this->name = $name;
46
        $this->color = $color;
47
        $this->size = $size;
48
        $this->style = $style;
0 ignored issues
show
Documentation Bug introduced by
It seems like $style of type array is incompatible with the declared type string of property $style.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
49
    }
50
51
    /**
52
     * @param string $name
53
     */
54
    public function setName($name)
55
    {
56
        $this->name = $name;
57
    }
58
59
    /**
60
     * @param string $color
61
     */
62
    public function setColor($color)
63
    {
64
        $this->color = $color;
65
    }
66
67
    /**
68
     * @param string $size
69
     */
70
    public function setSize($size)
71
    {
72
        $this->size = $size;
73
    }
74
75
    /**
76
     * @param string $style
77
     */
78
    public function setStyle($style)
79
    {
80
        $this->style = $style;
81
    }
82
83
    /**
84
     * @return string
85
     */
86
    public function getName()
87
    {
88
        return $this->name;
89
    }
90
91
    /**
92
     * @return string
93
     */
94
    public function getColor()
95
    {
96
        return $this->color;
97
    }
98
99
    /**
100
     * @return string
101
     */
102
    public function getSize()
103
    {
104
        return $this->size;
105
    }
106
107
    /**
108
     * @return string
109
     */
110
    public function getStyle()
111
    {
112
        return $this->style;
113
    }
114
115
    /**
116
     * 转换成数组.
117
     *
118
     * @return array
119
     */
120
    public function toArray()
121
    {
122
        return [
123
            'name' => $this->name,
124
            'size' => $this->size,
125
            'style' => $this->style,
126
            'color' => $this->color,
127
        ];
128
    }
129
130
    /**
131
     * 创建一个默认字体.
132
     *
133
     * @return static
134
     */
135
    public static function createDefault()
136
    {
137
        return new static('微软雅黑', '000000', 10, [0, 0, 0]);
138
    }
139
}
140