49 lines
1.2 KiB
PHP
49 lines
1.2 KiB
PHP
<?php
|
|
namespace Patchouli\Dummy;
|
|
|
|
use Patchouli\IPackage;
|
|
use Patchouli\Version;
|
|
|
|
class DummyPackage implements IPackage {
|
|
public function getId(): string {
|
|
return 'package-id';
|
|
}
|
|
|
|
public function getName(): string {
|
|
return 'Human Readable Name';
|
|
}
|
|
|
|
public function getVersion(): Version {
|
|
return new Version;
|
|
}
|
|
|
|
public function getFiles(): array {
|
|
return [
|
|
new DummyPackageFile('filename.bin'),
|
|
new DummyPackageFile('boobs.png'),
|
|
];
|
|
}
|
|
|
|
public function getTargets(): array {
|
|
return [new DummyPackageTarget];
|
|
}
|
|
|
|
public function getDependencies(): array {
|
|
return [];
|
|
}
|
|
|
|
public function fwifSerialize(): array {
|
|
$data = [
|
|
'id' => $this->getId(),
|
|
'name' => $this->getName(),
|
|
'ver' => $this->getVersion(),
|
|
'files' => $this->getFiles(),
|
|
'targ' => $this->getTargets(),
|
|
'deps' => [],
|
|
];
|
|
foreach($this->getDependencies() as $dependency)
|
|
$data['deps'][] = $dependency->getName();
|
|
return $data;
|
|
}
|
|
}
|