Skip to content

Commit a1a7c34

Browse files
committed
fix phpstan issues
1 parent ef099af commit a1a7c34

File tree

2 files changed

+4
-22
lines changed

2 files changed

+4
-22
lines changed

src/Builder/SocialPostBuilder.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,8 @@
1616

1717
class SocialPostBuilder implements SocialPostBuilderInterface
1818
{
19-
protected LinkedInClient $linkedInClient;
20-
21-
public function __construct(LinkedInClient $linkedInClient)
19+
public function __construct(protected LinkedInClient $linkedInClient)
2220
{
23-
$this->linkedInClient = $linkedInClient;
2421
}
2522

2623
public function configureFetch(BuildConfig $buildConfig, OptionsResolver $resolver): void
@@ -96,10 +93,6 @@ public function fetch(FetchData $data): void
9693
throw new BuildException(sprintf('fetch error: %s [endpoint: %s]', $e->getMessage(), $queryEndPoint));
9794
}
9895

99-
if (!is_array($response)) {
100-
return;
101-
}
102-
10396
if (!isset($response['elements'])) {
10497
return;
10598
}

src/Controller/Admin/LinkedInController.php

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,11 @@ class LinkedInController extends AdminAbstractController
1919
{
2020
use ConnectResponseTrait;
2121

22-
protected LinkedInClient $linkedInClient;
23-
protected EnvironmentServiceInterface $environmentService;
24-
protected ConnectorServiceInterface $connectorService;
25-
2622
public function __construct(
27-
LinkedInClient $linkedInClient,
28-
EnvironmentServiceInterface $environmentService,
29-
ConnectorServiceInterface $connectorService
23+
protected LinkedInClient $linkedInClient,
24+
protected EnvironmentServiceInterface $environmentService,
25+
protected ConnectorServiceInterface $connectorService
3026
) {
31-
$this->linkedInClient = $linkedInClient;
32-
$this->environmentService = $environmentService;
33-
$this->connectorService = $connectorService;
3427
}
3528

3629
public function connectAction(Request $request): Response
@@ -115,10 +108,6 @@ public function debugTokenAction(Request $request): JsonResponse
115108
return $this->adminJson(['error' => true, 'message' => $e->getMessage()]);
116109
}
117110

118-
if (!is_array($accessTokenMetadata)) {
119-
return $this->adminJson(['error' => true, 'message' => 'invalid token data']);
120-
}
121-
122111
if (isset($accessTokenMetadata['authorized_at'])) {
123112
$accessTokenMetadata['authorized_at'] = Carbon::createFromTimestamp($accessTokenMetadata['authorized_at'])->toDayDateTimeString();
124113
}

0 commit comments

Comments
 (0)