diff --git a/src/AppBundle/Controller/ImportRepositoriesController.php b/src/AppBundle/Controller/ImportRepositoriesController.php index 9ceff95..d680d2b 100644 --- a/src/AppBundle/Controller/ImportRepositoriesController.php +++ b/src/AppBundle/Controller/ImportRepositoriesController.php @@ -39,6 +39,7 @@ public function __construct(FormFactory $formFactory, ImportProjectTask $importP /** * @Route("/import-repositories", name="import-repositories") + * * @Template() */ public function importFormAction(Request $request) diff --git a/src/AppBundle/Controller/MainController.php b/src/AppBundle/Controller/MainController.php index 8484603..dbc8286 100755 --- a/src/AppBundle/Controller/MainController.php +++ b/src/AppBundle/Controller/MainController.php @@ -38,6 +38,7 @@ public function __construct(ProjectRepository $projectRepository, PackageReposit /** * @Route("/", name="main") + * * @Template() */ public function mainAction() diff --git a/src/AppBundle/Controller/PackageController.php b/src/AppBundle/Controller/PackageController.php index bb807e5..afa6201 100644 --- a/src/AppBundle/Controller/PackageController.php +++ b/src/AppBundle/Controller/PackageController.php @@ -16,7 +16,9 @@ class PackageController * requirements={"name"="[^;]+", "_format": "json|html"}, * defaults={"_format"="html"} * ) + * * @ParamConverter("package", class="AppBundle:Package", options={"repository_method" = "findOneByName"}) + * * @Template() */ public function detailAction(Package $package) @@ -31,7 +33,9 @@ public function detailAction(Package $package) * requirements={"name"="[^;]*"}, * defaults={"_format"="json"} * ) + * * @ParamConverter("package", class="AppBundle:Package", options={"repository_method" = "findOneByName"}) + * * @Template() */ public function versionsAction(Package $package) diff --git a/src/AppBundle/Controller/ProjectController.php b/src/AppBundle/Controller/ProjectController.php index 510f1dd..8cb6c27 100644 --- a/src/AppBundle/Controller/ProjectController.php +++ b/src/AppBundle/Controller/ProjectController.php @@ -15,7 +15,9 @@ class ProjectController * name="project", * requirements={"name"=".+"} * ) + * * @ParamConverter("project", class="AppBundle:Project", options={"repository_method" = "findOneByName"}) + * * @Template() */ public function detailAction(Project $project) diff --git a/src/AppBundle/Controller/UsageSearchController.php b/src/AppBundle/Controller/UsageSearchController.php index 17d3a85..e1cf49c 100644 --- a/src/AppBundle/Controller/UsageSearchController.php +++ b/src/AppBundle/Controller/UsageSearchController.php @@ -35,7 +35,9 @@ public function __construct(Twig_Environment $twigEnvironment) * requirements={"package"="[^;]+", "_format": "json|html"}, * defaults={"_format"="html"} * ) + * * @Template() + * * @ParamConverter("package", class="AppBundle:Package", options={"repository_method" = "findOneByName"}) */ public function searchResultsAction(Request $request, Package $package, $operator, $versionString) diff --git a/src/AppBundle/Controller/WebhookController.php b/src/AppBundle/Controller/WebhookController.php index 3e071be..b3ac856 100644 --- a/src/AppBundle/Controller/WebhookController.php +++ b/src/AppBundle/Controller/WebhookController.php @@ -25,6 +25,7 @@ public function __construct(ImportProjectTask $importProjectTask) /** * @Route("/webhook", name="webhook") + * * @Method({"POST"}) */ public function updateAction(Request $request) diff --git a/src/AppBundle/Driver/KilnDriver.php b/src/AppBundle/Driver/KilnDriver.php index 225e3d8..a482802 100644 --- a/src/AppBundle/Driver/KilnDriver.php +++ b/src/AppBundle/Driver/KilnDriver.php @@ -41,9 +41,6 @@ class KilnDriver extends VcsDriver /** @var string */ private $oAuthToken; - /** - * {@inheritDoc} - */ public function initialize() { preg_match('/^(?:https:\/\/webfactory.kilnhg.com\/(.*)\/(.*?)(?:$|\.))/', $this->url, $match); @@ -81,9 +78,6 @@ public function getRepositoryUrl() return 'https://'.$this->originUrl.'/'.$this->owner.'/'.$this->repository; } - /** - * {@inheritDoc} - */ public function getRootIdentifier() { if ($this->gitDriver) { @@ -93,9 +87,6 @@ public function getRootIdentifier() return $this->rootIdentifier; } - /** - * {@inheritDoc} - */ public function getUrl() { if ($this->gitDriver) { @@ -105,21 +96,11 @@ public function getUrl() return 'https://'.$this->originUrl.'/'.$this->owner.'/'.$this->repository.'.git'; } - /** - * {@inheritDoc} - * - * @param string $operation - * e.g. listing all Projects $operation = 'Project' - * e.g. getting file content $operation = 'Repo/{repoId}/Raw/File/{$filePath} - */ protected function getApiUrl() { return 'https://'.$this->originUrl.'/Api/1.0/'; } - /** - * {@inheritDoc} - */ public function getSource($identifier) { if ($this->gitDriver) { @@ -130,8 +111,6 @@ public function getSource($identifier) } /** - * {@inheritDoc} - * * @throws RuntimeException */ public function getDist($identifier) @@ -139,9 +118,6 @@ public function getDist($identifier) throw new RuntimeException('Zip downloads are not supported by the Kiln API'); } - /** - * {@inheritDoc} - */ public function getComposerInformation($identifier) { if ($this->gitDriver) { @@ -170,9 +146,6 @@ public function getComposerInformation($identifier) return $this->infoCache[$identifier]; } - /** - * {@inheritdoc} - */ public function getFileContent($file, $identifier) { if ($this->gitDriver) { @@ -192,9 +165,6 @@ public function getFileContent($file, $identifier) } } - /** - * {@inheritdoc} - */ public function getChangeDate($identifier) { if ($this->gitDriver) { @@ -207,9 +177,6 @@ public function getChangeDate($identifier) return new DateTime($commit['commit']['committer']['date']); } - /** - * {@inheritDoc} - */ public function getTags() { if ($this->gitDriver) { @@ -230,9 +197,6 @@ public function getTags() return $this->tags; } - /** - * {@inheritDoc} - */ public function getBranches() { if ($this->gitDriver) { @@ -258,9 +222,6 @@ public function getBranches() return $this->branches; } - /** - * {@inheritDoc} - */ public static function supports(IOInterface $io, Config $config, $url, $deep = false) { return false !== strpos($url, 'kilnhg'); @@ -276,9 +237,6 @@ protected function generateSshUrl() return 'ssh://webfactory@'.$this->originUrl.'/'.$this->owner.'/'.$this->repository; } - /** - * {@inheritDoc} - */ protected function getContents($url, $fetchingRepoData = false) { $contents = file_get_contents($url); diff --git a/src/AppBundle/Entity/Package.php b/src/AppBundle/Entity/Package.php index 0008b5c..41ce350 100644 --- a/src/AppBundle/Entity/Package.php +++ b/src/AppBundle/Entity/Package.php @@ -15,7 +15,9 @@ class Package { /** * @ORM\Id + * * @ORM\GeneratedValue + * * @ORM\Column(type="integer") * * @var int @@ -42,6 +44,7 @@ class Package * mappedBy="package", * cascade={"persist", "remove"} * ) + * * @ORM\JoinColumn(onDelete="CASCADE") * * @var Collection|PackageVersion[] diff --git a/src/AppBundle/Entity/PackageVersion.php b/src/AppBundle/Entity/PackageVersion.php index 0dea315..702a399 100644 --- a/src/AppBundle/Entity/PackageVersion.php +++ b/src/AppBundle/Entity/PackageVersion.php @@ -11,13 +11,16 @@ * Describes a Composer package used in a specific version number. * * @ORM\Entity + * * @ORM\Table(uniqueConstraints={@ORM\UniqueConstraint(name="uniq_package_version", columns={"package_id", "prettyVersion"})}) */ class PackageVersion { /** * @ORM\Id + * * @ORM\GeneratedValue + * * @ORM\Column(type="integer") * * @var int diff --git a/src/AppBundle/Entity/Project.php b/src/AppBundle/Entity/Project.php index a060822..1299ff0 100644 --- a/src/AppBundle/Entity/Project.php +++ b/src/AppBundle/Entity/Project.php @@ -13,7 +13,9 @@ class Project { /** * @ORM\Id + * * @ORM\GeneratedValue + * * @ORM\Column(type="integer") * * @var int diff --git a/src/AppBundle/Factory/VcsDriverFactory.php b/src/AppBundle/Factory/VcsDriverFactory.php index cc01358..3c1ec83 100644 --- a/src/AppBundle/Factory/VcsDriverFactory.php +++ b/src/AppBundle/Factory/VcsDriverFactory.php @@ -19,7 +19,7 @@ class VcsDriverFactory /** @var array ['platform' => VcsDriverInterface class ] */ private $drivers; - public function __construct($githubOAuthToken, $kilnOAuthToken, array $drivers = null) + public function __construct($githubOAuthToken, $kilnOAuthToken, ?array $drivers = null) { $this->githubOAuthToken = $githubOAuthToken; $this->kilnOAuthToken = $kilnOAuthToken; diff --git a/src/AppBundle/ProjectImport/DoctrinePackageProvider.php b/src/AppBundle/ProjectImport/DoctrinePackageProvider.php index 650da53..fd8ea0d 100644 --- a/src/AppBundle/ProjectImport/DoctrinePackageProvider.php +++ b/src/AppBundle/ProjectImport/DoctrinePackageProvider.php @@ -18,9 +18,6 @@ public function __construct(PackageRepository $packageRepository) $this->packageRepository = $packageRepository; } - /** - * {@inheritdoc} - */ public function providePackage($name) { $package = $this->packageRepository->findOneBy(['name' => $name]); diff --git a/src/AppBundle/ProjectImport/DoctrineProjectProvider.php b/src/AppBundle/ProjectImport/DoctrineProjectProvider.php index 882cfad..9330d57 100644 --- a/src/AppBundle/ProjectImport/DoctrineProjectProvider.php +++ b/src/AppBundle/ProjectImport/DoctrineProjectProvider.php @@ -18,9 +18,6 @@ public function __construct(ProjectRepository $projectRepository) $this->projectRepository = $projectRepository; } - /** - * {@inheritdoc} - */ public function provideProject($name) { $project = $this->projectRepository->findOneBy(['name' => $name]); diff --git a/src/AppBundle/ProjectImport/LockFileFetcher.php b/src/AppBundle/ProjectImport/LockFileFetcher.php index c54b5b2..5cab7ba 100644 --- a/src/AppBundle/ProjectImport/LockFileFetcher.php +++ b/src/AppBundle/ProjectImport/LockFileFetcher.php @@ -16,8 +16,6 @@ public function __construct(VcsDriverFactory $vcsDriverFactory) } /** - * @param $vcsUrl - * * @return string|null */ public function getLockContents($vcsUrl) diff --git a/src/AppBundle/Tests/Driver/KilnDriverTest.php b/src/AppBundle/Tests/Driver/KilnDriverTest.php index 425af5e..593ab67 100644 --- a/src/AppBundle/Tests/Driver/KilnDriverTest.php +++ b/src/AppBundle/Tests/Driver/KilnDriverTest.php @@ -17,7 +17,7 @@ class KilnDriverTest extends TestCase /** * @var KilnDriver|MockObject */ - private $driver = null; + private $driver; /** * Initializes the test environment. diff --git a/src/AppBundle/Tests/Entity/VersionConstraintTest.php b/src/AppBundle/Tests/Entity/VersionConstraintTest.php index 3389426..3062e27 100644 --- a/src/AppBundle/Tests/Entity/VersionConstraintTest.php +++ b/src/AppBundle/Tests/Entity/VersionConstraintTest.php @@ -16,8 +16,8 @@ public function versionConstraintWithSmallerThanOperatorMatchesPackageVersionsWi { $versionConstraint = new VersionConstraint('<', '2.0.0'); $packageVersions = [ - new PackageVersion('1.0.0', new Package('foo')), - new PackageVersion('3.0.0', new Package('foo')), + new PackageVersion('1.0.0', new Package('foo')), + new PackageVersion('3.0.0', new Package('foo')), ]; $matches = $this->matchPackageVersions($versionConstraint, $packageVersions); @@ -33,10 +33,10 @@ public function versionConstraintWithSmallerEqualsOperatorMatchesPackageVersions { $versionConstraint = new VersionConstraint('<=', '2.0.0'); $packageVersions = [ - new PackageVersion('1.0.0', new Package('foo')), - new PackageVersion('2.0.0', new Package('foo')), - new PackageVersion('3.0.0', new Package('foo')), - ]; + new PackageVersion('1.0.0', new Package('foo')), + new PackageVersion('2.0.0', new Package('foo')), + new PackageVersion('3.0.0', new Package('foo')), + ]; $matches = $this->matchPackageVersions($versionConstraint, $packageVersions); @@ -52,9 +52,9 @@ public function versionConstraintWithLargerThanOperatorMatchesPackageVersionsWit { $versionConstraint = new VersionConstraint('>', '2.0.0'); $packageVersions = [ - new PackageVersion('1.0.0', new Package('foo')), - new PackageVersion('3.0.0', new Package('foo')), - ]; + new PackageVersion('1.0.0', new Package('foo')), + new PackageVersion('3.0.0', new Package('foo')), + ]; $matches = $this->matchPackageVersions($versionConstraint, $packageVersions); @@ -69,9 +69,9 @@ public function versionConstraintWithLargerEqualsOperatorMatchesPackageVersionsW { $versionConstraint = new VersionConstraint('>=', '2.0.0'); $packageVersions = [ - new PackageVersion('1.0.0', new Package('foo')), - new PackageVersion('2.0.0', new Package('foo')), - new PackageVersion('3.0.0', new Package('foo')), + new PackageVersion('1.0.0', new Package('foo')), + new PackageVersion('2.0.0', new Package('foo')), + new PackageVersion('3.0.0', new Package('foo')), ]; $matches = $this->matchPackageVersions($versionConstraint, $packageVersions); @@ -88,8 +88,8 @@ public function versionConstraintWithEqualsOperatorMatchesPackageVersionsWithEqu { $versionConstraint = new VersionConstraint('==', '2.0.0'); $packageVersions = [ - new PackageVersion('1.0.0', new Package('foo')), - new PackageVersion('2.0.0', new Package('foo')), + new PackageVersion('1.0.0', new Package('foo')), + new PackageVersion('2.0.0', new Package('foo')), ]; $matches = $this->matchPackageVersions($versionConstraint, $packageVersions); @@ -105,9 +105,9 @@ public function versionConstraintWithAllOperatorMatchesAllPackagesVersions() { $versionConstraint = new VersionConstraint('all', '2.0.0'); $packageVersions = [ - new PackageVersion('1.0.0', new Package('foo')), - new PackageVersion('2.0.0', new Package('foo')), - new PackageVersion('3.0.0', new Package('foo')), + new PackageVersion('1.0.0', new Package('foo')), + new PackageVersion('2.0.0', new Package('foo')), + new PackageVersion('3.0.0', new Package('foo')), ]; $matches = $this->matchPackageVersions($versionConstraint, $packageVersions); diff --git a/www/app.php b/www/app.php index 514a5cc..c604f3a 100755 --- a/www/app.php +++ b/www/app.php @@ -36,7 +36,7 @@ } if ($enableCache) { - class AppCache extends \Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache + class AppCache extends Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache { } $kernel = new AppCache($kernel);