X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Fpharext%2FSourceDir%2FBasic.php;h=e5b2d230c36ea071dc4e28133a09895df2abd7f1;hb=d5207a43143f6c41520d024ba682cd5d69517416;hp=f960236c765fb9c1484c1bb268b58757f0021d81;hpb=c99dfed4c3056e0a8ed1351adb79dd4f16324965;p=pharext%2Fpharext diff --git a/src/pharext/SourceDir/Basic.php b/src/pharext/SourceDir/Basic.php index f960236..e5b2d23 100644 --- a/src/pharext/SourceDir/Basic.php +++ b/src/pharext/SourceDir/Basic.php @@ -4,6 +4,7 @@ namespace pharext\SourceDir; use pharext\Cli\Args; use pharext\License; +use pharext\PackageInfo; use pharext\SourceDir; use FilesystemIterator; @@ -16,21 +17,26 @@ use RecursiveIteratorIterator; class Basic implements IteratorAggregate, SourceDir { use License; - + use PackageInfo; + private $path; - + public function __construct($path) { - $this->path = $path; + $this->path = realpath($path); } - + public function getBaseDir() { return $this->path; } - + + /** + * @inheritdoc + * @return array + */ public function getPackageInfo() { - return []; + return $this->findPackageInfo($this->getBaseDir()); } - + public function getLicense() { if (($file = $this->findLicense($this->getBaseDir()))) { return $this->readLicense($file); @@ -41,7 +47,7 @@ class Basic implements IteratorAggregate, SourceDir public function getArgs() { return []; } - + public function setArgs(Args $args) { }