This repository has been archived on 2023-10-21. You can view files and clone it, but cannot push or open issues or pull requests.
patchouli/src/Dummy/DummyPackage.php

85 lines
2.8 KiB
PHP
Raw Normal View History

2020-12-23 01:44:45 +00:00
<?php
namespace Patchouli\Dummy;
use Patchouli\IPackage;
use Patchouli\Version;
class DummyPackage implements IPackage {
2020-12-23 01:44:45 +00:00
public function getId(): string {
return 'package-id';
}
public function getName(): string {
return 'Human Readable Name';
}
public function getVersion(): Version {
return new Version;
}
public function getDependencies(): array {
return [];
}
public function fwifSerialize(): array {
$data = [
'id' => $this->getId(),
'name' => $this->getName(),
'version' => $this->getVersion(),
'deps' => [],
2020-12-28 23:28:27 +00:00
/*'null' => null,
'true' => true,
'false' => false,
2020-12-23 01:44:45 +00:00
'zero' => 0,
'u8' => 0x42,
'u16' => 0x4344,
'u24' => 0x454647,
'u32' => 0x58596061,
'u40' => 0x6263646566,
'u48' => 0x676869707172,
'u56' => 0x73747576777879,
'u64' => 0x7481828384858687,
'neg32' => -12345678,
'neg64' => -1234567890987654,
'float' => 12345.6789,
2020-12-27 04:10:44 +00:00
'float2' => 8.0,
'floatNeg' => -12345.6789,
'floatPi' => M_PI,
'floatE' => M_E,
'floatLog2E' => M_LOG2E,
'floatLog10E' => M_LOG10E,
'floatLn2' => M_LN2,
'floatLn10' => M_LN10,
'floatPi2' => M_PI_2,
'floatPi4' => M_PI_4,
'floatM1Pi' => M_1_PI,
'floatM2Pi' => M_2_PI,
'floatSqrtPi' => M_SQRTPI,
'float2SqrtPi' => M_2_SQRTPI,
'floatSqrt2' => M_SQRT2,
'floatSqrt3' => M_SQRT3,
'floatSqrt12' => M_SQRT1_2,
'floatLnPi' => M_LNPI,
'floatEuler' => M_EULER,
'floatNaN' => NAN,
'floatInf' => INF,
'floatNegInf' => -INF,
2020-12-27 04:10:44 +00:00
'floatZero' => 0.0,
'floatNegZero' => -0.0,
2020-12-26 04:12:26 +00:00
'invalid' => "\xFF\x25\x25\x02\xFF蠕。蝮F鄒守清\xFF\xFF\xFF",
2020-12-24 03:25:10 +00:00
'datetime' => new \DateTime('2013-01-27 23:14:44 CET'),
'datetimeNegative' => new \DateTime('-2013-01-27 23:14:44 CET'),
'datetimeNow' => new \DateTime(),
2020-12-27 04:10:44 +00:00
'period' => (new \DateTime())->diff(new \DateTime('2013-01-27 23:14:44 CET')),
'periodNegative' => (new \DateTime('2013-01-27 23:14:44 CET'))->diff(new \DateTime()),
'periodZero' => (new \DateTime())->diff(new \DateTime()),
2020-12-23 01:44:45 +00:00
'array' => ['e', 'a', 0x55],
'object' => new \stdClass,
2020-12-28 23:28:27 +00:00
'misaka' => '御坂 美琴',*/
2020-12-23 01:44:45 +00:00
];
foreach($this->getDependencies() as $dependency)
$data['deps'][] = $dependency->getName();
return $data;
}
}