Skip to content

Commit

Permalink
fix phpstan issues
Browse files Browse the repository at this point in the history
  • Loading branch information
solverat committed Dec 5, 2024
1 parent ef099af commit a1a7c34
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 22 deletions.
9 changes: 1 addition & 8 deletions src/Builder/SocialPostBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@

class SocialPostBuilder implements SocialPostBuilderInterface
{
protected LinkedInClient $linkedInClient;

public function __construct(LinkedInClient $linkedInClient)
public function __construct(protected LinkedInClient $linkedInClient)
{
$this->linkedInClient = $linkedInClient;
}

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

if (!is_array($response)) {
return;
}

if (!isset($response['elements'])) {
return;
}
Expand Down
17 changes: 3 additions & 14 deletions src/Controller/Admin/LinkedInController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,11 @@ class LinkedInController extends AdminAbstractController
{
use ConnectResponseTrait;

protected LinkedInClient $linkedInClient;
protected EnvironmentServiceInterface $environmentService;
protected ConnectorServiceInterface $connectorService;

public function __construct(
LinkedInClient $linkedInClient,
EnvironmentServiceInterface $environmentService,
ConnectorServiceInterface $connectorService
protected LinkedInClient $linkedInClient,
protected EnvironmentServiceInterface $environmentService,
protected ConnectorServiceInterface $connectorService
) {
$this->linkedInClient = $linkedInClient;
$this->environmentService = $environmentService;
$this->connectorService = $connectorService;
}

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

if (!is_array($accessTokenMetadata)) {
return $this->adminJson(['error' => true, 'message' => 'invalid token data']);
}

if (isset($accessTokenMetadata['authorized_at'])) {
$accessTokenMetadata['authorized_at'] = Carbon::createFromTimestamp($accessTokenMetadata['authorized_at'])->toDayDateTimeString();
}
Expand Down

0 comments on commit a1a7c34

Please sign in to comment.