Compare commits

5 Commits
1.0 ... main

Author SHA1 Message Date
fb4774001e downgraded PHPUnit to v10 2024-09-12 23:16:35 +02:00
2fdb2cd725 package updates 2024-09-12 23:10:09 +02:00
29f526672e use class alias GiteaClient for better readability 2024-07-13 05:53:00 +02:00
5969ba9ce0 package updates 2024-07-13 05:51:44 +02:00
4496070e86 add composer.lock to repo 2024-07-13 05:51:37 +02:00
4 changed files with 4333 additions and 20 deletions

2
.gitignore vendored
View File

@@ -1,6 +1,6 @@
/.phpunit.result.cache
/.phpunit.cache
/composer.lock
/phpunit.xml
/vendor/
*~
.vscode/settings.json

View File

@@ -1,20 +1,27 @@
{
"name": "magdev/gitea-bundle",
"description": "Symfony bundle to integrate Gitea",
"license": "MIT",
"type": "symfony-bundle",
"authors": [
{
"name": "magdev",
"email": "magdev3.0@gmail.com"
}
],
"require": {
"owenvoke/gitea": "^0.1.6",
"guzzlehttp/guzzle": "^7.4",
"http-interop/http-factory-guzzle": "^1.2"
"http-interop/http-factory-guzzle": "^1.2",
"owenvoke/gitea": "^0.1.6"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"symfony/http-kernel": "^5.4",
"symfony/dependency-injection": "^5.4",
"symfony/config": "^5.4",
"symfony/phpunit-bridge": "^6.0"
"phpunit/phpunit": "^9 || ^10",
"symfony/config": "^6 || ^7",
"symfony/dependency-injection": "^6 || ^7",
"symfony/http-kernel": "^6 || ^7",
"symfony/phpunit-bridge": "^6 || ^7"
},
"license": "MIT",
"minimum-stability": "stable",
"autoload": {
"psr-4": {
"Magdev\\GiteaBundle\\": "src/"
@@ -25,11 +32,9 @@
"Magdev\\GiteaBundle\\Tests\\": "tests/"
}
},
"authors": [
{
"name": "magdev",
"email": "magdev3.0@gmail.com"
"config": {
"allow-plugins": {
"php-http/discovery": true
}
}
],
"minimum-stability": "stable"
}

4308
composer.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,7 @@ declare(strict_types=1);
namespace Magdev\GiteaBundle\DependencyInjection;
use OwenVoke\Gitea\Client;
use OwenVoke\Gitea\Client as GiteaClient;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\Extension;
@@ -22,13 +22,13 @@ final class MagdevGiteaExtension extends Extension
foreach ($config['connections'] as $name => $connection) {
$id = sprintf('magdev.gitea.%s', $name);
$container->register($id, Client::class)
$container->register($id, GiteaClient::class)
->setArguments([null, null, $connection['baseurl']])
->addMethodCall('authenticate', [$connection['token'], null, Client::AUTH_ACCESS_TOKEN]);
$container->registerAliasForArgument($id, Client::class, "{$name}Client");
->addMethodCall('authenticate', [$connection['token'], null, GiteaClient::AUTH_ACCESS_TOKEN]);
$container->registerAliasForArgument($id, GiteaClient::class, "{$name}Client");
if ($name === $config['default_connection']) {
$container->setAlias(Client::class, $id);
$container->setAlias(GiteaClient::class, $id);
}
}
}