Skip to content

Commit 53294df

Browse files
Working on next version
1 parent 58ba78f commit 53294df

File tree

7 files changed

+21
-98
lines changed

7 files changed

+21
-98
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 \Github\Client|null
30-
*/
3126
private ?Client $client = null;
3227

3328
/**

src/Auth/AuthenticatorFactory.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ public function make(string $method): AuthenticatorInterface
3636
{
3737
return match ($method) {
3838
'application' => new Authenticator\ApplicationAuthenticator(),
39-
'jwt' => new Authenticator\JwtAuthenticator(),
40-
'private' => new Authenticator\PrivateKeyAuthenticator(),
41-
'token' => new Authenticator\TokenAuthenticator(),
42-
default => throw new InvalidArgumentException("Unsupported authentication method [$method]."),
39+
'jwt' => new Authenticator\JwtAuthenticator(),
40+
'private' => new Authenticator\PrivateKeyAuthenticator(),
41+
'token' => new Authenticator\TokenAuthenticator(),
42+
default => throw new InvalidArgumentException("Unsupported authentication method [$method]."),
4343
};
4444
}
4545
}

src/Cache/ConnectionFactory.php

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,16 @@
2525
*/
2626
class ConnectionFactory
2727
{
28-
/**
29-
* The cache factory instance.
30-
*
31-
* @var \Illuminate\Contracts\Cache\Factory|null
32-
*/
33-
private ?Factory $cache;
34-
3528
/**
3629
* Create a new connection factory instance.
3730
*
3831
* @param \Illuminate\Contracts\Cache\Factory|null $cache
3932
*
4033
* @return void
4134
*/
42-
public function __construct(?Factory $cache = null)
43-
{
44-
$this->cache = $cache;
35+
public function __construct(
36+
private readonly Factory $cache = null,
37+
) {
4538
}
4639

4740
/**

src/Cache/Connector/IlluminateConnector.php

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -28,37 +28,19 @@
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-
*/
50-
private ?Factory $cache;
51-
5234
/**
5335
* Create a new illuminate connector instance.
5436
*
5537
* @param \Illuminate\Contracts\Cache\Factory|null $cache
5638
*
5739
* @return void
5840
*/
59-
public function __construct(?Factory $cache = null)
60-
{
61-
$this->cache = $cache;
41+
public function __construct(
42+
private readonly ?Factory $cache = null,
43+
) {
6244
}
6345

6446
/**

src/GitHubFactory.php

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -31,27 +31,6 @@
3131
*/
3232
class GitHubFactory
3333
{
34-
/**
35-
* The http client builder factory instance.
36-
*
37-
* @var \GrahamCampbell\GitHub\HttpClient\BuilderFactory
38-
*/
39-
private BuilderFactory $builder;
40-
41-
/**
42-
* The authenticator factory instance.
43-
*
44-
* @var \GrahamCampbell\GitHub\Auth\AuthenticatorFactory
45-
*/
46-
private AuthenticatorFactory $auth;
47-
48-
/**
49-
* The cache factory instance.
50-
*
51-
* @var \GrahamCampbell\GitHub\Cache\ConnectionFactory
52-
*/
53-
private ConnectionFactory $cache;
54-
5534
/**
5635
* Create a new github factory instance.
5736
*
@@ -61,11 +40,11 @@ class GitHubFactory
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/GitHubManager.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,7 @@
8383
*/
8484
class GitHubManager extends AbstractManager
8585
{
86-
/**
87-
* The factory instance.
88-
*
89-
* @var \GrahamCampbell\GitHub\GitHubFactory
90-
*/
91-
protected GitHubFactory $factory;
86+
protected readonly GitHubFactory $factory;
9287

9388
/**
9489
* Create a new github manager instance.

src/HttpClient/BuilderFactory.php

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,6 @@
2525
*/
2626
class BuilderFactory
2727
{
28-
/**
29-
* The http client instance.
30-
*
31-
* @var \Psr\Http\Client\ClientInterface
32-
*/
33-
private ClientInterface $httpClient;
34-
35-
/**
36-
* The request factory instance.
37-
*
38-
* @var \Psr\Http\Message\RequestFactoryInterface
39-
*/
40-
private RequestFactoryInterface $requestFactory;
41-
42-
/**
43-
* The stream factory instance.
44-
*
45-
* @var \Psr\Http\Message\StreamFactoryInterface
46-
*/
47-
private StreamFactoryInterface $streamFactory;
48-
4928
/**
5029
* Create a new connection factory instance.
5130
*
@@ -55,11 +34,11 @@ class BuilderFactory
5534
*
5635
* @return void
5736
*/
58-
public function __construct(ClientInterface $httpClient, RequestFactoryInterface $requestFactory, StreamFactoryInterface $streamFactory)
59-
{
60-
$this->httpClient = $httpClient;
61-
$this->requestFactory = $requestFactory;
62-
$this->streamFactory = $streamFactory;
37+
public function __construct(
38+
private readonly ClientInterface $httpClient,
39+
private readonly RequestFactoryInterface $requestFactory,
40+
private readonly StreamFactoryInterface $streamFactory,
41+
) {
6342
}
6443

6544
/**

0 commit comments

Comments
 (0)