Code Duplication    Length = 14-15 lines in 2 locations

src/Model/Precipitation.php 1 location

@@ 70-84 (lines=15) @@
67
     * @param array $data
68
     * @return $this
69
     */
70
    public function setData(array $data)
71
    {
72
        if (
73
            !($trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS)) ||
74
            !(isset($trace[1]['class']) && in_array(ForecastItemInterface::class, class_implements($trace[1]['class'])))
75
        ) {
76
            trigger_error('Member not available: setData', E_USER_ERROR);
77
        }
78
79
        $this->intensity = $data['intensity'];
80
        $this->probability = $data['probability'];
81
        $this->type = $data['type'];
82
83
        return $this;
84
    }
85
}
86

src/Model/Wind.php 1 location

@@ 89-102 (lines=14) @@
86
     * @param array $data
87
     * @return $this
88
     */
89
    public function setData(array $data)
90
    {
91
        if (
92
            !($trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS)) ||
93
            !(isset($trace[1]['class']) && in_array(ForecastItemInterface::class, class_implements($trace[1]['class'])))
94
        ) {
95
            trigger_error('Member not available: setData', E_USER_ERROR);
96
        }
97
98
        $this->speed = $data['speed'];
99
        $this->degree = $data['degree'];
100
101
        return $this;
102
    }
103
104
    public function __toString()
105
    {