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/Model/Hour.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
 *
4
 * PHP version 5.5
5
 *
6
 * @package Forecast\Model
7
 * @author  Sergey V.Kuzin <[email protected]>
8
 * @license MIT
9
 */
10
declare(strict_types=1);
11
namespace Forecast\Model;
12
13
14
use Forecast\ForecastItemInterface;
15
16
class Hour implements  ForecastItemInterface
0 ignored issues
show
Expected 1 space before "ForecastItemInterface"; 2 found
Loading history...
17
{
18
    /** @var \DateTime  */
19
    protected $date;
20
    protected $summary;
21
22
    /** @var Temperature  */
23
    protected $temperature;
24
25
    /** @var Wind */
26
    protected $wind;
27
28
    /** @var Humidity */
29
    protected $humidity;
30
31
    /** @var Precipitation */
32
    protected $precipitation;
33
34
    /** @var string */
35
    protected $icon;
36
37
    /**
38
     * @api
39
     *
40
     * @return string
41
     */
42
    public function getSummary(): string
43
    {
44
        return $this->summary;
45
    }
46
47
    /**
48
     * @api
49
     *
50
     * @return Temperature
51
     */
52
    public function getTemperature(): Temperature
53
    {
54
        return $this->temperature;
55
    }
56
57
    /**
58
     * @api
59
     *
60
     * @return Wind
61
     */
62
    public function getWind(): Wind
63
    {
64
        return $this->wind;
65
    }
66
67
    /**
68
     * @api
69
     *
70
     * @return string
71
     */
72
    public function __toString(): string 
73
    {
74
        return (string)$this->getSummary();
75
    }
76
77
    /**
78
     * @return \DateTime
79
     */
80
    public function getDate(): \DateTime
81
    {
82
        return $this->date;
83
    }
84
85
    /**
86
     * @param array $data
87
     * @return ForecastItemInterface
88
     */
89
    public function setData(array $data): ForecastItemInterface
90
    {
91
        $this->date = $data['date'];
92
        $this->summary = $data['summary'];
93
        $this->temperature = (new Temperature())->setData($data['temperature']);
94
        $this->wind = (new Wind())->setData($data['wind']);
95
        $this->humidity = (new Humidity())->setData($data['humidity']);
96
        $this->precipitation = (new Precipitation())->setData($data['precipitation']);
97
        $this->icon = $data['icon'];
98
        return $this;
99
    }
100
101
    /**
102
     * @return Humidity
103
     */
104
    public function getHumidity(): Humidity
105
    {
106
        return $this->humidity;
107
    }
108
109
    /**
110
     * @return Precipitation
111
     */
112
    public function getPrecipitation(): Precipitation
113
    {
114
        return $this->precipitation;
115
    }
116
117
    /**
118
     * @return string
119
     */
120
    public function getIcon(): string
121
    {
122
        return $this->icon;
123
    }
124
}
125