Skip to content

[Insight] Object parameters should be type hinted - in Cmfcmf/OpenWeatherMap/CurrentWeather.php, line 96 #30

@hubdotcom

Description

@hubdotcom

in Cmfcmf/OpenWeatherMap/CurrentWeather.php, line 96

The parameter xml, which is an object, should be typehinted.

     * @param        $xml
     * @param string $units
     *
     * @internal
     */
    public function __construct($xml, $units)
    {
        $this->city = new City($xml->city['id'], $xml->city['name'], $xml->city->coord['lon'], $xml->city->coord['lat'], $xml->city->country);
        $this->temperature = new Temperature(new Unit($xml->temperature['value'], $xml->temperature['unit']), new Unit($xml->temperature['min'], $xml->temperature['unit']), new Unit($xml->temperature['max'], $xml->temperature['unit']));
        $this->humidity = new Unit($xml->humidity['value'], $xml->humidity['unit']);
        $this->pressure = new Unit($xml->pressure['value'], $xml->pressure['unit']);

Posted from SensioLabsInsight

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions