Skip to content

Commit 4495702

Browse files
Working on next version
1 parent e52fdb9 commit 4495702

File tree

7 files changed

+21
-101
lines changed

7 files changed

+21
-101
lines changed

src/Auth/Authenticator/AbstractAuthenticator.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@
2323
*/
2424
abstract class AbstractAuthenticator implements AuthenticatorInterface
2525
{
26-
/**
27-
* The client to perform the authentication on.
28-
*
29-
* @var \Gitlab\Client|null
30-
*/
3126
private ?Client $client = null;
3227

3328
/**

src/Auth/AuthenticatorFactory.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ public function make(string $method): AuthenticatorInterface
3636
{
3737
return match ($method) {
3838
'job_token' => new Authenticator\JobTokenAuthenticator(),
39-
'oauth' => new Authenticator\OauthAuthenticator(),
40-
'token' => new Authenticator\TokenAuthenticator(),
41-
default => throw new InvalidArgumentException("Unsupported authentication method [$method]."),
39+
'oauth' => new Authenticator\OauthAuthenticator(),
40+
'token' => new Authenticator\TokenAuthenticator(),
41+
default => throw new InvalidArgumentException("Unsupported authentication method [$method]."),
4242
};
4343
}
4444
}

src/Cache/ConnectionFactory.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@
2525
*/
2626
class ConnectionFactory
2727
{
28-
/**
29-
* The cache factory instance.
30-
*
31-
* @var \Illuminate\Contracts\Cache\Factory|null
32-
*/
3328
private ?Factory $cache;
3429

3530
/**
@@ -39,9 +34,9 @@ class ConnectionFactory
3934
*
4035
* @return void
4136
*/
42-
public function __construct(Factory $cache = null)
43-
{
44-
$this->cache = $cache;
37+
public function __construct(
38+
private readonly ?Factory $cache = null,
39+
) {
4540
}
4641

4742
/**

src/Cache/Connector/IlluminateConnector.php

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,9 @@
2828
*/
2929
final class IlluminateConnector implements ConnectorInterface
3030
{
31-
/**
32-
* The minimum cache lifetime of 12 hours.
33-
*
34-
* @var int
35-
*/
3631
private const MIN_CACHE_LIFETIME = 43200;
37-
38-
/**
39-
* The maximum cache lifetime of 48 hours.
40-
*
41-
* @var int
42-
*/
4332
private const MAX_CACHE_LIFETIME = 172800;
4433

45-
/**
46-
* The cache factory instance.
47-
*
48-
* @var \Illuminate\Contracts\Cache\Factory|null
49-
*/
5034
private ?Factory $cache;
5135

5236
/**
@@ -56,9 +40,9 @@ final class IlluminateConnector implements ConnectorInterface
5640
*
5741
* @return void
5842
*/
59-
public function __construct(Factory $cache = null)
60-
{
61-
$this->cache = $cache;
43+
public function __construct(
44+
private readonly ?Factory $cache = null,
45+
) {
6246
}
6347

6448
/**

src/GitLabFactory.php

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -31,27 +31,6 @@
3131
*/
3232
class GitLabFactory
3333
{
34-
/**
35-
* The http client builder factory instance.
36-
*
37-
* @var \GrahamCampbell\GitLab\HttpClient\BuilderFactory
38-
*/
39-
private BuilderFactory $builder;
40-
41-
/**
42-
* The authenticator factory instance.
43-
*
44-
* @var \GrahamCampbell\GitLab\Auth\AuthenticatorFactory
45-
*/
46-
private AuthenticatorFactory $auth;
47-
48-
/**
49-
* The cache factory instance.
50-
*
51-
* @var \GrahamCampbell\GitLab\Cache\ConnectionFactory
52-
*/
53-
private ConnectionFactory $cache;
54-
5534
/**
5635
* Create a new gitlab factory instance.
5736
*
@@ -61,11 +40,11 @@ class GitLabFactory
6140
*
6241
* @return void
6342
*/
64-
public function __construct(BuilderFactory $builder, AuthenticatorFactory $auth, ConnectionFactory $cache)
65-
{
66-
$this->builder = $builder;
67-
$this->auth = $auth;
68-
$this->cache = $cache;
43+
public function __construct(
44+
private readonly BuilderFactory $builder,
45+
private readonly AuthenticatorFactory $auth,
46+
private readonly ConnectionFactory $cache,
47+
) {
6948
}
7049

7150
/**

src/GitLabManager.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,7 @@
6565
*/
6666
class GitLabManager extends AbstractManager
6767
{
68-
/**
69-
* The factory instance.
70-
*
71-
* @var \GrahamCampbell\GitLab\GitLabFactory
72-
*/
73-
protected GitLabFactory $factory;
68+
protected readonly GitLabFactory $factory;
7469

7570
/**
7671
* Create a new gitlab manager instance.

src/HttpClient/BuilderFactory.php

Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -26,34 +26,6 @@
2626
*/
2727
class BuilderFactory
2828
{
29-
/**
30-
* The http client instance.
31-
*
32-
* @var \Psr\Http\Client\ClientInterface
33-
*/
34-
private ClientInterface $httpClient;
35-
36-
/**
37-
* The request factory instance.
38-
*
39-
* @var \Psr\Http\Message\RequestFactoryInterface
40-
*/
41-
private RequestFactoryInterface $requestFactory;
42-
43-
/**
44-
* The stream factory instance.
45-
*
46-
* @var \Psr\Http\Message\StreamFactoryInterface
47-
*/
48-
private StreamFactoryInterface $streamFactory;
49-
50-
/**
51-
* The uri factory instance.
52-
*
53-
* @var \Psr\Http\Message\UriFactoryInterface
54-
*/
55-
private UriFactoryInterface $uriFactory;
56-
5729
/**
5830
* Create a new connection factory instance.
5931
*
@@ -64,12 +36,12 @@ class BuilderFactory
6436
*
6537
* @return void
6638
*/
67-
public function __construct(ClientInterface $httpClient, RequestFactoryInterface $requestFactory, StreamFactoryInterface $streamFactory, UriFactoryInterface $uriFactory)
68-
{
69-
$this->httpClient = $httpClient;
70-
$this->requestFactory = $requestFactory;
71-
$this->streamFactory = $streamFactory;
72-
$this->uriFactory = $uriFactory;
39+
public function __construct(
40+
private readonly ClientInterface $httpClient,
41+
private readonly RequestFactoryInterface $requestFactory,
42+
private readonly StreamFactoryInterface $streamFactory,
43+
private readonly UriFactoryInterface $uriFactory,
44+
) {
7345
}
7446

7547
/**

0 commit comments

Comments
 (0)