diff --git a/src/Builder/SocialPostBuilder.php b/src/Builder/SocialPostBuilder.php index afe52c3..5cda184 100644 --- a/src/Builder/SocialPostBuilder.php +++ b/src/Builder/SocialPostBuilder.php @@ -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 @@ -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; } diff --git a/src/Controller/Admin/LinkedInController.php b/src/Controller/Admin/LinkedInController.php index 835892b..bd25e6c 100644 --- a/src/Controller/Admin/LinkedInController.php +++ b/src/Controller/Admin/LinkedInController.php @@ -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 @@ -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(); }