#!/usr/bin/env php name}"]; $license = $package->license ?? ''; if ($license) { $output[] = "License: {$license}"; } else { warn("Package {$package->name}: No license found"); } $licenseFile = findLicenseFile($package->name, $packagePath); if ($licenseFile) { $relLicenseFile = str_replace("{$rootPath}/", '', $licenseFile); $output[] = "License File: {$relLicenseFile}"; $copyright = findCopyright($licenseFile); if ($copyright) { $output[] = "Copyright: {$copyright}"; } else { warn("Package {$package->name}: no copyright found in its license"); } } $source = $package->repository->url ?? $package->repository ?? ''; if ($source) { $output[] = "Source: {$source}"; } $link = $package->homepage ?? $source; if ($link) { $output[] = "Link: {$link}"; } return implode("\n", $output); }