-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from ojhaujjwal/feature/apparent-power
Created new quantity, 'ApparentPower'
- Loading branch information
Showing
2 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
src/Crisu83/Conversion/Quantity/ApparentPower/ApparentPower.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
/* | ||
* This file is part of Conversion. | ||
* | ||
* (c) 2013 Christoffer Niska | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Crisu83\Conversion\Quantity\ApparentPower; | ||
|
||
use Crisu83\Conversion\Quantity\Quantity; | ||
|
||
/** | ||
* Class ApparentPower | ||
* @package Crisu83\Conversion\Quantity\ApparentPower | ||
*/ | ||
class ApparentPower extends Quantity | ||
{ | ||
/** | ||
* @var string native unit name | ||
*/ | ||
protected static $native = Unit::VOLT_AMPERE; | ||
|
||
/** | ||
* @var array conversion map (unit => native unit) | ||
*/ | ||
protected static $conversionMap = array( | ||
Unit::VOLT_AMPERE => 1, | ||
Unit::KILOVOLT_AMPERE => 1000, | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
/* | ||
* This file is part of Conversion. | ||
* | ||
* (c) 2013 Christoffer Niska | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Crisu83\Conversion\Quantity\ApparentPower; | ||
|
||
use Crisu83\Conversion\Quantity\Unit as BaseUnit; | ||
|
||
/** | ||
* Class Unit | ||
* @package Crisu83\Conversion\Quantity\ApparentPower | ||
*/ | ||
class Unit extends BaseUnit | ||
{ | ||
const VOLT_AMPERE = 'VA'; | ||
const KILOVOLT_AMPERE = 'kVA'; | ||
} |