Skip to content

Commit 2af2605

Browse files
committed
wip
1 parent 03bee1b commit 2af2605

8 files changed

Lines changed: 5 additions & 29 deletions

File tree

phpstan-baseline.neon

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
11
parameters:
22
ignoreErrors:
3-
-
4-
message: "#^Cannot access offset 'access_token' on mixed\\.$#"
5-
count: 1
6-
path: src/Component.php
7-
8-
-
9-
message: "#^Cannot access offset 'refresh_token' on mixed\\.$#"
10-
count: 1
11-
path: src/Component.php
12-
133
-
144
message: "#^Method Keboola\\\\GoogleAnalyticsExtractor\\\\Component\\:\\:getProfilesPropertiesAction\\(\\) return type has no value type specified in iterable type array\\.$#"
155
count: 1
@@ -55,16 +45,6 @@ parameters:
5545
count: 1
5646
path: src/Component.php
5747

58-
-
59-
message: "#^Parameter \\#3 \\$accessToken of class Keboola\\\\Google\\\\ClientBundle\\\\Google\\\\RestApi constructor expects string, mixed given\\.$#"
60-
count: 1
61-
path: src/Component.php
62-
63-
-
64-
message: "#^Parameter \\#4 \\$refreshToken of class Keboola\\\\Google\\\\ClientBundle\\\\Google\\\\RestApi constructor expects string, mixed given\\.$#"
65-
count: 1
66-
path: src/Component.php
67-
6848
-
6949
message: "#^Cannot access offset 'enabled' on mixed\\.$#"
7050
count: 1

phpstan.neon

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@ parameters:
66
- '#Call to an undefined method Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition\:\:ignoreExtraKeys\(\).#'
77
- '#Cannot call method integerNode\(\) on Symfony\\Component\\Config\\Definition\\Builder\\NodeParentInterface\|null\.#'
88
- '#Cannot call method scalarNode\(\) on Symfony\\Component\\Config\\Definition\\Builder\\NodeParentInterface\|null\.#'
9-
- '#logger of class Keboola\\Google\\ClientBundle\\Google\\RestApi constructor expects Monolog\\Logger\|null, Psr\\Log\\LoggerInterface given\.#'

src/Component.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ private function getGoogleRestApi(): RestApi
307307
$this->getLogger(),
308308
);
309309
} else {
310+
/** @var array{access_token?: string, refresh_token?: string}|null $tokenData */
310311
$tokenData = json_decode($this->getConfig()->getOAuthApiData(), true);
311312
if (!isset($tokenData['access_token'], $tokenData['refresh_token'])) {
312313
throw new UserException('The token data are broken. Please try to reauthorize.');

src/Configuration/Config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,6 @@ public function processProperties(string $configDefinition): bool
125125

126126
public function getCredentials(): string
127127
{
128-
return $this->getValue(['parameters', 'credentials'], '');
128+
return $this->getStringValue(['parameters', 'credentials'], '');
129129
}
130130
}

src/Configuration/ConfigGetProfilesPropertiesDefinition.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@ public function getParametersDefinition(): ArrayNodeDefinition
1313
{
1414
$parametersNode = parent::getParametersDefinition();
1515

16-
$parametersNode
17-
->children()
18-
->scalarNode('credentials')->end()
19-
->end();
16+
$parametersNode->children()->scalarNode('credentials')->end();
2017

2118
return $parametersNode;
2219
}

tests/Keboola/GoogleAnalyticsExtractor/ApplicationTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ public function testAppRunAdaptive(): void
9494

9595
public function testAppRunMCF(): void
9696
{
97-
$this->markTestSkipped();
9897
$this->config = $this->getConfig('_mcf');
9998
$this->runProcess();
10099

tests/Keboola/GoogleAnalyticsExtractor/Extractor/ExtractorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function setUp(): void
3737
$this->config = $this->getConfig();
3838
$this->logger = new TestLogger();
3939
$client = new Client(
40-
new RestApi(
40+
RestApi::createWithOAuth(
4141
(string) getenv('CLIENT_ID'),
4242
(string) getenv('CLIENT_SECRET'),
4343
(string) getenv('ACCESS_TOKEN'),

tests/Keboola/GoogleAnalyticsExtractor/GoogleAnalytics/ClientTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function setUp(): void
2525
$this->logger->pushHandler($testHandler);
2626

2727
$this->client = new Client(
28-
new RestApi(
28+
RestApi::createWithOAuth(
2929
(string) getenv('CLIENT_ID'),
3030
(string) getenv('CLIENT_SECRET'),
3131
(string) getenv('ACCESS_TOKEN'),

0 commit comments

Comments
 (0)