X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Fpharext%2FSourceDir%2FGit.php;h=62dc24f9e5162cfde0cf7ff3d6380c4e5a7a2875;hb=e44f0adc7b18845a2cd3dc63fdab5d9bcdc10f76;hp=e17a3055c15d1b5fd534e73f3bdbb3f529afbc67;hpb=4b95e2c390f07d2eb22d099c33b68c7f9ff97777;p=pharext%2Fpharext diff --git a/src/pharext/SourceDir/Git.php b/src/pharext/SourceDir/Git.php index e17a305..62dc24f 100644 --- a/src/pharext/SourceDir/Git.php +++ b/src/pharext/SourceDir/Git.php @@ -2,8 +2,8 @@ namespace pharext\SourceDir; -use pharext\Command; use pharext\Cli\Args; +use pharext\License; use pharext\SourceDir; /** @@ -11,6 +11,8 @@ use pharext\SourceDir; */ class Git implements \IteratorAggregate, SourceDir { + use License; + /** * Base directory * @var string @@ -41,6 +43,17 @@ class Git implements \IteratorAggregate, SourceDir return []; } + /** + * @inheritdoc + * @return string + */ + public function getLicense() { + if (($file = $this->findLicense($this->getBaseDir()))) { + return $this->readLicense($file); + } + return "UNKNOWN"; + } + /** * @inheritdoc * @return array