Skip to content

Commit

Permalink
Merge pull request #2 from rugaard/develop
Browse files Browse the repository at this point in the history
Fix incorrect namespaces of Unit classes (#1).
  • Loading branch information
rugaard authored Jul 15, 2020
2 parents 31adedc + a96153b commit 99188ec
Show file tree
Hide file tree
Showing 24 changed files with 74 additions and 74 deletions.
4 changes: 2 additions & 2 deletions src/DTO/Measurements/Humidity.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

use Rugaard\DMI\Contracts\Unit;
use Rugaard\DMI\DTO\AbstractDTO;
use Rugaard\DMI\DTO\Units\Percentage;
use Rugaard\DMI\Units\Percentage;

/**
* Class Humidity.
Expand Down Expand Up @@ -105,4 +105,4 @@ public function __toString() : string
{
return round($this->getValue()) . $this->getUnit();
}
}
}
4 changes: 2 additions & 2 deletions src/DTO/Measurements/Precipitation.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

use Rugaard\DMI\Contracts\Unit;
use Rugaard\DMI\DTO\AbstractDTO;
use Rugaard\DMI\DTO\Units\Length\Millimeter;
use Rugaard\DMI\Units\Length\Millimeter;

/**
* Class Precipitation.
Expand Down Expand Up @@ -228,4 +228,4 @@ public function __toString() : string
{
return number_format(round($this->getValue(), 1), 1, '.', '') . ' ' . $this->getUnit();
}
}
}
4 changes: 2 additions & 2 deletions src/DTO/Measurements/Pressure.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

use Rugaard\DMI\Contracts\Unit;
use Rugaard\DMI\DTO\AbstractDTO;
use Rugaard\DMI\DTO\Units\Pressure\Hectopascal;
use Rugaard\DMI\Units\Pressure\Hectopascal;

/**
* Class Pressure.
Expand Down Expand Up @@ -105,4 +105,4 @@ public function __toString() : string
{
return round($this->getValue()) . ' ' . $this->getUnit();
}
}
}
4 changes: 2 additions & 2 deletions src/DTO/Measurements/Temperature.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

use Rugaard\DMI\Contracts\Unit;
use Rugaard\DMI\DTO\AbstractDTO;
use Rugaard\DMI\DTO\Units\Temperature\Celsius;
use Rugaard\DMI\Units\Temperature\Celsius;

/**
* Class Temperature.
Expand Down Expand Up @@ -171,4 +171,4 @@ public function __toString() : string
{
return floor($this->getValue()) . $this->getUnit();
}
}
}
4 changes: 2 additions & 2 deletions src/DTO/Measurements/Visibility.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

use Rugaard\DMI\Contracts\Unit;
use Rugaard\DMI\DTO\AbstractDTO;
use Rugaard\DMI\DTO\Units\Length\Meter;
use Rugaard\DMI\Units\Length\Meter;

/**
* Class Visibility.
Expand Down Expand Up @@ -105,4 +105,4 @@ public function __toString() : string
{
return floor($this->getValue()) . ' ' . $this->getUnit();
}
}
}
4 changes: 2 additions & 2 deletions src/DTO/Measurements/Wind/Gust.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

use Rugaard\DMI\Contracts\Unit;
use Rugaard\DMI\DTO\AbstractDTO;
use Rugaard\DMI\DTO\Units\Speed\MetersPerSecond;
use Rugaard\DMI\Units\Speed\MetersPerSecond;

/**
* Class Gust.
Expand Down Expand Up @@ -105,4 +105,4 @@ public function __toString() : string
{
return number_format(round($this->getValue(), 1), 1, '.', '') . ' ' . $this->getUnit();
}
}
}
4 changes: 2 additions & 2 deletions src/DTO/Measurements/Wind/Speed.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

use Rugaard\DMI\Contracts\Unit;
use Rugaard\DMI\DTO\AbstractDTO;
use Rugaard\DMI\DTO\Units\Speed\MetersPerSecond;
use Rugaard\DMI\Units\Speed\MetersPerSecond;

/**
* Class Speed.
Expand Down Expand Up @@ -171,4 +171,4 @@ public function __toString() : string
{
return number_format(round($this->getValue(), 1), 1, '.', '') . ' ' . $this->getUnit();
}
}
}
20 changes: 10 additions & 10 deletions src/Support/Units.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
declare(strict_types=1);

use Rugaard\DMI\Contracts\Unit;
use Rugaard\DMI\DTO\Units\Bearing;
use Rugaard\DMI\DTO\Units\Percentage;
use Rugaard\DMI\DTO\Units\Length\Centimeter;
use Rugaard\DMI\DTO\Units\Length\Meter;
use Rugaard\DMI\DTO\Units\Length\Millimeter;
use Rugaard\DMI\DTO\Units\Pressure\Hectopascal;
use Rugaard\DMI\DTO\Units\Speed\MetersPerSecond;
use Rugaard\DMI\DTO\Units\Temperature\Celsius;
use Rugaard\DMI\DTO\Units\Time\Hour;
use Rugaard\DMI\Units\Bearing;
use Rugaard\DMI\Units\Percentage;
use Rugaard\DMI\Units\Length\Centimeter;
use Rugaard\DMI\Units\Length\Meter;
use Rugaard\DMI\Units\Length\Millimeter;
use Rugaard\DMI\Units\Pressure\Hectopascal;
use Rugaard\DMI\Units\Speed\MetersPerSecond;
use Rugaard\DMI\Units\Temperature\Celsius;
use Rugaard\DMI\Units\Time\Hour;

if (!function_exists('getUnitByAbbreviation')) {
/**
Expand Down Expand Up @@ -59,4 +59,4 @@ function getUnitByAbbreviation(string $unitAbbreviation) :? Unit
return null;
}
}
}
}
6 changes: 3 additions & 3 deletions src/Units/Bearing.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php
declare(strict_types=1);

namespace Rugaard\DMI\DTO\Units;
namespace Rugaard\DMI\Units;

use Rugaard\DMI\Contracts\Unit;

/**
* Class Bearing.
*
* @package Rugaard\DMI\DTO\Units
* @package Rugaard\DMI\Units
*/
class Bearing implements Unit
{
Expand Down Expand Up @@ -55,4 +55,4 @@ public function __toString() : string
{
return $this->getAbbreviation();
}
}
}
6 changes: 3 additions & 3 deletions src/Units/Length/Centimeter.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php
declare(strict_types=1);

namespace Rugaard\DMI\DTO\Units\Length;
namespace Rugaard\DMI\Units\Length;

use Rugaard\DMI\Contracts\Unit;

/**
* Class Centimeter.
*
* @package Rugaard\DMI\DTO\Units\Length
* @package Rugaard\DMI\Units\Length
*/
class Centimeter implements Unit
{
Expand Down Expand Up @@ -55,4 +55,4 @@ public function __toString() : string
{
return $this->getAbbreviation();
}
}
}
6 changes: 3 additions & 3 deletions src/Units/Length/Meter.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php
declare(strict_types=1);

namespace Rugaard\DMI\DTO\Units\Length;
namespace Rugaard\DMI\Units\Length;

use Rugaard\DMI\Contracts\Unit;

/**
* Class Meter.
*
* @package Rugaard\DMI\DTO\Units\Length
* @package Rugaard\DMI\Units\Length
*/
class Meter implements Unit
{
Expand Down Expand Up @@ -55,4 +55,4 @@ public function __toString() : string
{
return $this->getAbbreviation();
}
}
}
6 changes: 3 additions & 3 deletions src/Units/Length/Millimeter.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php
declare(strict_types=1);

namespace Rugaard\DMI\DTO\Units\Length;
namespace Rugaard\DMI\Units\Length;

use Rugaard\DMI\Contracts\Unit;

/**
* Class Millimeter.
*
* @package Rugaard\DMI\DTO\Units\Length
* @package Rugaard\DMI\Units\Length
*/
class Millimeter implements Unit
{
Expand Down Expand Up @@ -55,4 +55,4 @@ public function __toString() : string
{
return $this->getAbbreviation();
}
}
}
6 changes: 3 additions & 3 deletions src/Units/Percentage.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php
declare(strict_types=1);

namespace Rugaard\DMI\DTO\Units;
namespace Rugaard\DMI\Units;

use Rugaard\DMI\Contracts\Unit;

/**
* Class Percentage.
*
* @package Rugaard\DMI\DTO\Units
* @package Rugaard\DMI\Units
*/
class Percentage implements Unit
{
Expand Down Expand Up @@ -55,4 +55,4 @@ public function __toString() : string
{
return $this->getAbbreviation();
}
}
}
6 changes: 3 additions & 3 deletions src/Units/Pressure/Hectopascal.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php
declare(strict_types=1);

namespace Rugaard\DMI\DTO\Units\Pressure;
namespace Rugaard\DMI\Units\Pressure;

use Rugaard\DMI\Contracts\Unit;

/**
* Class Hectopascal.
*
* @package Rugaard\DMI\DTO\Units\Pressure
* @package Rugaard\DMI\Units\Pressure
*/
class Hectopascal implements Unit
{
Expand Down Expand Up @@ -55,4 +55,4 @@ public function __toString() : string
{
return $this->getAbbreviation();
}
}
}
6 changes: 3 additions & 3 deletions src/Units/Speed/MetersPerSecond.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php
declare(strict_types=1);

namespace Rugaard\DMI\DTO\Units\Speed;
namespace Rugaard\DMI\Units\Speed;

use Rugaard\DMI\Contracts\Unit;

/**
* Class MetresPerSecond.
*
* @package Rugaard\DMI\DTO\Units\Speed
* @package Rugaard\DMI\Units\Speed
*/
class MetersPerSecond implements Unit
{
Expand Down Expand Up @@ -55,4 +55,4 @@ public function __toString() : string
{
return $this->getAbbreviation();
}
}
}
6 changes: 3 additions & 3 deletions src/Units/Temperature/Celsius.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php
declare(strict_types=1);

namespace Rugaard\DMI\DTO\Units\Temperature;
namespace Rugaard\DMI\Units\Temperature;

use Rugaard\DMI\Contracts\Unit;

/**
* Class Celsius.
*
* @package Rugaard\DMI\DTO\Units
* @package Rugaard\DMI\Units\Temperatures
*/
class Celsius implements Unit
{
Expand Down Expand Up @@ -55,4 +55,4 @@ public function __toString() : string
{
return $this->getAbbreviation();
}
}
}
6 changes: 3 additions & 3 deletions src/Units/Time/Hour.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php
declare(strict_types=1);

namespace Rugaard\DMI\DTO\Units\Time;
namespace Rugaard\DMI\Units\Time;

use Rugaard\DMI\Contracts\Unit;

/**
* Class Hour.
*
* @package Rugaard\DMI\DTO\Units\Time
* @package Rugaard\DMI\Units\Time
*/
class Hour implements Unit
{
Expand Down Expand Up @@ -55,4 +55,4 @@ public function __toString() : string
{
return $this->getAbbreviation();
}
}
}
6 changes: 3 additions & 3 deletions tests/DTO/Measurements/HumidityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
namespace Rugaard\DMI\Tests\DTO\Measurements;

use Rugaard\DMI\DTO\Measurements\Humidity;
use Rugaard\DMI\DTO\Units\Length\Millimeter;
use Rugaard\DMI\DTO\Units\Percentage;
use Rugaard\DMI\Units\Length\Millimeter;
use Rugaard\DMI\Units\Percentage;
use Rugaard\DMI\Tests\AbstractTestCase;

/**
Expand Down Expand Up @@ -76,4 +76,4 @@ public function testToString() : void
$this->assertIsString((string) $dto);
$this->assertEquals('69%', (string) $dto);
}
}
}
6 changes: 3 additions & 3 deletions tests/DTO/Measurements/PrecipitationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
namespace Rugaard\DMI\Tests\DTO\Measurements;

use Rugaard\DMI\DTO\Measurements\Precipitation;
use Rugaard\DMI\DTO\Units\Length\Meter;
use Rugaard\DMI\DTO\Units\Length\Millimeter;
use Rugaard\DMI\Units\Length\Meter;
use Rugaard\DMI\Units\Length\Millimeter;
use Rugaard\DMI\Tests\AbstractTestCase;
use Tightenco\Collect\Support\Collection;

Expand Down Expand Up @@ -179,4 +179,4 @@ public function testToString() : void
$this->assertIsString((string) $dto);
$this->assertEquals('4.4 mm', (string) $dto);
}
}
}
Loading

0 comments on commit 99188ec

Please sign in to comment.