diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index f99a8c0..dd5ea6d 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -1,8 +1,10 @@ setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect()) ->setRules([ '@Symfony' => true, + 'phpdoc_separation' => false, 'array_syntax' => array('syntax' => 'short'), 'no_unreachable_default_argument_value' => false, 'braces' => array('allow_single_line_closure' => true), diff --git a/bin/php-cs-fixer b/bin/php-cs-fixer index 927a390..8a1affc 100755 --- a/bin/php-cs-fixer +++ b/bin/php-cs-fixer @@ -1,7 +1,7 @@ #!/bin/bash -e -PHP_CS_FIXER_VERSION=${PHP_CS_FIXER_VERSION:-3.11.0} +PHP_CS_FIXER_VERSION=${PHP_CS_FIXER_VERSION:-3.62.0-php8.3} if [ -t 1 ]; then TTY='--tty'; else TTY=''; fi -exec docker run --rm --init --interactive $TTY -w=/${PWD} -v $(pwd):/${PWD} oskarstark/php-cs-fixer-ga:$PHP_CS_FIXER_VERSION "$@" +exec docker run --rm --init --interactive $TTY -v $(pwd):/code ghcr.io/php-cs-fixer/php-cs-fixer:$PHP_CS_FIXER_VERSION fix "$@" 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/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);