Skip to content

Commit

Permalink
Fix CS with PHP-CS-Fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
mpdude authored and github-actions[bot] committed Aug 26, 2024
1 parent 79abd45 commit 66d22a8
Show file tree
Hide file tree
Showing 17 changed files with 39 additions and 70 deletions.
1 change: 1 addition & 0 deletions src/AppBundle/Controller/ImportRepositoriesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public function __construct(FormFactory $formFactory, ImportProjectTask $importP

/**
* @Route("/import-repositories", name="import-repositories")
*
* @Template()
*/
public function importFormAction(Request $request)
Expand Down
1 change: 1 addition & 0 deletions src/AppBundle/Controller/MainController.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public function __construct(ProjectRepository $projectRepository, PackageReposit

/**
* @Route("/", name="main")
*
* @Template()
*/
public function mainAction()
Expand Down
4 changes: 4 additions & 0 deletions src/AppBundle/Controller/PackageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions src/AppBundle/Controller/ProjectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions src/AppBundle/Controller/UsageSearchController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/AppBundle/Controller/WebhookController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public function __construct(ImportProjectTask $importProjectTask)

/**
* @Route("/webhook", name="webhook")
*
* @Method({"POST"})
*/
public function updateAction(Request $request)
Expand Down
42 changes: 0 additions & 42 deletions src/AppBundle/Driver/KilnDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -81,9 +78,6 @@ public function getRepositoryUrl()
return 'https://'.$this->originUrl.'/'.$this->owner.'/'.$this->repository;
}

/**
* {@inheritDoc}
*/
public function getRootIdentifier()
{
if ($this->gitDriver) {
Expand All @@ -93,9 +87,6 @@ public function getRootIdentifier()
return $this->rootIdentifier;
}

/**
* {@inheritDoc}
*/
public function getUrl()
{
if ($this->gitDriver) {
Expand All @@ -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) {
Expand All @@ -130,18 +111,13 @@ public function getSource($identifier)
}

/**
* {@inheritDoc}
*
* @throws RuntimeException
*/
public function getDist($identifier)
{
throw new RuntimeException('Zip downloads are not supported by the Kiln API');
}

/**
* {@inheritDoc}
*/
public function getComposerInformation($identifier)
{
if ($this->gitDriver) {
Expand Down Expand Up @@ -170,9 +146,6 @@ public function getComposerInformation($identifier)
return $this->infoCache[$identifier];
}

/**
* {@inheritdoc}
*/
public function getFileContent($file, $identifier)
{
if ($this->gitDriver) {
Expand All @@ -192,9 +165,6 @@ public function getFileContent($file, $identifier)
}
}

/**
* {@inheritdoc}
*/
public function getChangeDate($identifier)
{
if ($this->gitDriver) {
Expand All @@ -207,9 +177,6 @@ public function getChangeDate($identifier)
return new DateTime($commit['commit']['committer']['date']);
}

/**
* {@inheritDoc}
*/
public function getTags()
{
if ($this->gitDriver) {
Expand All @@ -230,9 +197,6 @@ public function getTags()
return $this->tags;
}

/**
* {@inheritDoc}
*/
public function getBranches()
{
if ($this->gitDriver) {
Expand All @@ -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');
Expand All @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions src/AppBundle/Entity/Package.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ class Package
{
/**
* @ORM\Id
*
* @ORM\GeneratedValue
*
* @ORM\Column(type="integer")
*
* @var int
Expand All @@ -42,6 +44,7 @@ class Package
* mappedBy="package",
* cascade={"persist", "remove"}
* )
*
* @ORM\JoinColumn(onDelete="CASCADE")
*
* @var Collection|PackageVersion[]
Expand Down
3 changes: 3 additions & 0 deletions src/AppBundle/Entity/PackageVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/AppBundle/Entity/Project.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ class Project
{
/**
* @ORM\Id
*
* @ORM\GeneratedValue
*
* @ORM\Column(type="integer")
*
* @var int
Expand Down
2 changes: 1 addition & 1 deletion src/AppBundle/Factory/VcsDriverFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 0 additions & 3 deletions src/AppBundle/ProjectImport/DoctrinePackageProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ public function __construct(PackageRepository $packageRepository)
$this->packageRepository = $packageRepository;
}

/**
* {@inheritdoc}
*/
public function providePackage($name)
{
$package = $this->packageRepository->findOneBy(['name' => $name]);
Expand Down
3 changes: 0 additions & 3 deletions src/AppBundle/ProjectImport/DoctrineProjectProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ public function __construct(ProjectRepository $projectRepository)
$this->projectRepository = $projectRepository;
}

/**
* {@inheritdoc}
*/
public function provideProject($name)
{
$project = $this->projectRepository->findOneBy(['name' => $name]);
Expand Down
2 changes: 0 additions & 2 deletions src/AppBundle/ProjectImport/LockFileFetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ public function __construct(VcsDriverFactory $vcsDriverFactory)
}

/**
* @param $vcsUrl
*
* @return string|null
*/
public function getLockContents($vcsUrl)
Expand Down
2 changes: 1 addition & 1 deletion src/AppBundle/Tests/Driver/KilnDriverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class KilnDriverTest extends TestCase
/**
* @var KilnDriver|MockObject
*/
private $driver = null;
private $driver;

/**
* Initializes the test environment.
Expand Down
34 changes: 17 additions & 17 deletions src/AppBundle/Tests/Entity/VersionConstraintTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);

Expand All @@ -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);

Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion www/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 66d22a8

Please sign in to comment.