Temperature.php 460 B

1234567891011121314151617181920212223
  1. <?php
  2. namespace App\Yr\Forecast\Tabular\Time;
  3. /**
  4. * Temperature
  5. *
  6. * @author Joachim M. Giæver (joachim[]giaever.org)
  7. */
  8. class Temperature extends AbstractUnit {
  9. const DEFAULT_VARIANCE = 2;
  10. /**
  11. * @param \SimpleXMLElement $xml XML containing the temperature
  12. */
  13. public function __construct(?\SimpleXMLElement $xml) {
  14. parent::__construct(
  15. (float)$xml['value'],
  16. (string)$xml['unit']
  17. );
  18. }
  19. }