Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feat/php-8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
marmichalski committed Dec 17, 2023
2 parents 4ffc230 + 423985c commit 45dbf7c
Show file tree
Hide file tree
Showing 37 changed files with 311 additions and 413 deletions.
9 changes: 4 additions & 5 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
/tests
/var/*

###> friendsofphp/php-cs-fixer ###
/.php_cs
/.php_cs.cache
/.php_cs.dist
###< friendsofphp/php-cs-fixer ###
###> php-cs-fixer/shim ###
/.php-cs-fixer.cache
/.php-cs-fixer.dist.php
###< php-cs-fixer/shim ###

###> phpunit/phpunit ###
/phpunit.xml
Expand Down
32 changes: 16 additions & 16 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
* text=auto

/ansible export-ignore
/bin/coverage-checker export-ignore
/docker export-ignore
/tests export-ignore
/.codecov.yml export-ignore
/.dockerignore export-ignore
/.env.docker export-ignore
/.env.test export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.php_cs.dist export-ignore
/buddy.yml export-ignore
/docker-compose.yml export-ignore
/Dockerfile export-ignore
/phpstan.neon export-ignore
/phpunit.xml.dist export-ignore
/ansible export-ignore
/bin/coverage-checker export-ignore
/docker export-ignore
/tests export-ignore
/.codecov.yml export-ignore
/.dockerignore export-ignore
/.env.docker export-ignore
/.env.test export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.php-cs-fixer.dist.php export-ignore
/buddy.yml export-ignore
/docker-compose.yml export-ignore
/Dockerfile export-ignore
/phpstan.neon export-ignore
/phpunit.xml.dist export-ignore
11 changes: 5 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@
!/var/.gitkeep
/vendor/
###< symfony/framework-bundle ###

###> friendsofphp/php-cs-fixer ###
/.php_cs
/.php_cs.cache
###< friendsofphp/php-cs-fixer ###

###> phpunit/phpunit ###
/phpunit.xml
.phpunit.result.cache
Expand Down Expand Up @@ -42,3 +36,8 @@ docker-compose.*.yml
###< Docker ###

composer.phar

###> php-cs-fixer/shim ###
/.php-cs-fixer.php
/.php-cs-fixer.cache
###< php-cs-fixer/shim ###
5 changes: 3 additions & 2 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
$config = new PhpCsFixer\Config();
return $config->setRiskyAllowed(true)
->setRules([
'@PHP71Migration' => true,
'@PHP74Migration' => true,
'@Symfony' => true,
'array_syntax' => ['syntax' => 'short'],
'blank_line_between_import_groups' => false,
'no_superfluous_elseif' => true,
'no_superfluous_phpdoc_tags' => ['allow_mixed' => true],
'no_unreachable_default_argument_value' => true,
Expand All @@ -19,7 +20,7 @@
'no_unused_imports' => true,
'declare_strict_types' => true,
'ordered_imports' => [
'imports_order' => null,
'imports_order' => ['class', 'function', 'const'],
'sort_algorithm' => 'alpha',
],
'phpdoc_order' => true,
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@
"doctrine/doctrine-fixtures-bundle": "^3.3",
"ekino/phpstan-banned-code": "^1.0.0",
"fakerphp/faker": "^1.9",
"friendsofphp/php-cs-fixer": "^2.16",
"johnkary/phpunit-speedtrap": "^4.0",
"league/flysystem-memory": "^1.0",
"php-cs-fixer/shim": "^3.9",
"phpspec/prophecy-phpunit": "^2.0",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^1.3.0",
Expand Down
174 changes: 25 additions & 149 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Command/ProxySyncReleasesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

final class ProxySyncReleasesCommand extends Command
{
const LOCK_TTL = 30;
public const LOCK_TTL = 30;

protected static $defaultName = 'repman:proxy:sync-releases';

Expand Down
2 changes: 1 addition & 1 deletion src/Controller/OAuth/BuddyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function auth(): Response
return $this->oauth
->getClient('buddy')
->redirect([Buddy::SCOPE_USER_EMAIL], ['redirect_uri' => $this->generateUrl('login_buddy_check', [], UrlGeneratorInterface::ABSOLUTE_URL)])
;
;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/OAuth/GitHubController.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function auth(): Response
return $this->oauth
->getClient('github')
->redirect(['user:email'], ['redirect_uri' => $this->generateUrl('login_github_check', [], UrlGeneratorInterface::ABSOLUTE_URL)])
;
;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Controller/OAuth/OAuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ protected function createAndAuthenticateUser(string $type, callable $emailProvid
return $this->redirectToRoute('organization_create', $params);
} catch (OAuth2ClientException $exception) {
$this->addFlash('danger', 'Authentication failed! Did you authorize our app?');
} catch (IdentityProviderException | HttpException $e) {
} catch (IdentityProviderException|HttpException $e) {
$this->addFlash('danger', $e->getMessage());
}

Expand Down Expand Up @@ -93,7 +93,7 @@ protected function storeRepoToken(Request $request, string $type, callable $toke
'organization' => $request->getSession()->get('organization', $user->firstOrganizationAlias()->getOrElseThrow(new NotFoundHttpException())),
'type' => $type,
]);
} catch (OAuth2ClientException | IdentityProviderException $e) {
} catch (OAuth2ClientException|IdentityProviderException $e) {
$this->addFlash('danger', 'Error while getting oauth token: '.$e->getMessage());

return $this->redirectToRoute('organization_package_new', [
Expand Down
6 changes: 3 additions & 3 deletions src/Controller/ProxyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,9 @@ public function downloads(Request $request): JsonResponse
$this->messageBus->dispatch(new AddDownloads(
\array_map(function (array $data): Package {
return new Package($data['name'], $data['version']);
}, \array_filter($contents['downloads'], function (array $row): bool {
return isset($row['name'], $row['version']);
})),
}, \array_filter($contents['downloads'], function (array $row): bool {
return isset($row['name'], $row['version']);
})),
new \DateTimeImmutable(),
$request->getClientIp(),
$request->headers->get('User-Agent')
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/RegistrationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function confirm(string $token): Response
try {
$this->messageBus->dispatch(new ConfirmEmail($token));
$this->addFlash('success', 'E-mail address was confirmed. Enjoy your Repman account.');
} catch (\RuntimeException | \InvalidArgumentException $exception) {
} catch (\RuntimeException|\InvalidArgumentException $exception) {
$this->addFlash('danger', 'Invalid or expired e-mail confirm token');
}

Expand Down
Loading

0 comments on commit 45dbf7c

Please sign in to comment.