|
@@ 79-98 (lines=20) @@
|
| 76 |
|
/** |
| 77 |
|
* @throws InvalidConfigurationException |
| 78 |
|
*/ |
| 79 |
|
private function setLinkedInParameters() |
| 80 |
|
{ |
| 81 |
|
$configuration = $this->configuration; |
| 82 |
|
|
| 83 |
|
if (!in_array('linkedin', $configuration['publish_on'])) { |
| 84 |
|
return; |
| 85 |
|
} |
| 86 |
|
|
| 87 |
|
if (!isset($configuration['providers']['linkedin'])) { |
| 88 |
|
throw new InvalidConfigurationException('Found no configuration for the LinkedIn provider'); |
| 89 |
|
} |
| 90 |
|
|
| 91 |
|
$linkedinConfiguration = $configuration['providers']['linkedin']; |
| 92 |
|
$linkedinParameters = ['client_id', 'client_secret', 'access_token', 'company_page_id']; |
| 93 |
|
foreach ($linkedinParameters as $parameter) { |
| 94 |
|
$this->container->setParameter('social_post.configuration.linkedin.' . $parameter, $linkedinConfiguration[$parameter]); |
| 95 |
|
} |
| 96 |
|
|
| 97 |
|
$this->loader->load('linkedin.yml'); |
| 98 |
|
} |
| 99 |
|
|
| 100 |
|
/** |
| 101 |
|
* @throws InvalidConfigurationException |
|
@@ 103-122 (lines=20) @@
|
| 100 |
|
/** |
| 101 |
|
* @throws InvalidConfigurationException |
| 102 |
|
*/ |
| 103 |
|
private function setTwitterParameters() |
| 104 |
|
{ |
| 105 |
|
$configuration = $this->configuration; |
| 106 |
|
|
| 107 |
|
if (!in_array('twitter', $configuration['publish_on'])) { |
| 108 |
|
return; |
| 109 |
|
} |
| 110 |
|
|
| 111 |
|
if (!isset($configuration['providers']['twitter'])) { |
| 112 |
|
throw new InvalidConfigurationException('Found no configuration for the Twitter provider'); |
| 113 |
|
} |
| 114 |
|
|
| 115 |
|
$twitterConfiguration = $configuration['providers']['twitter']; |
| 116 |
|
$twitterParameters = ['consumer_key', 'consumer_secret', 'access_token', 'access_token_secret']; |
| 117 |
|
foreach ($twitterParameters as $parameter) { |
| 118 |
|
$this->container->setParameter('social_post.configuration.twitter.' . $parameter, $twitterConfiguration[$parameter]); |
| 119 |
|
} |
| 120 |
|
|
| 121 |
|
$this->loader->load('twitter.yml'); |
| 122 |
|
} |
| 123 |
|
} |
| 124 |
|
|