-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMockAnnotationGenerator.php
More file actions
123 lines (101 loc) · 3.51 KB
/
MockAnnotationGenerator.php
File metadata and controls
123 lines (101 loc) · 3.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<?php
/**
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
declare(strict_types=1);
namespace Piwik\Plugins\ApiReference\tests\Resources;
use Piwik\API\DocumentationGenerator;
use Piwik\Plugins\ApiReference\Annotations\AnnotationGenerator;
class MockAnnotationGenerator extends AnnotationGenerator
{
public function __construct(DocumentationGenerator $generator, bool $allowLocalRequests = true)
{
parent::__construct($generator, null, null, $allowLocalRequests);
// TODO - Extend the constructor behaviour
}
// TODO - Refactor the methods below to use dependency injection so that they can more easily be tested
/**
* @inheritDoc
*/
public function buildAnnotationForMethod(array $rules, string $pluginName, \ReflectionMethod $reflectionMethod): array
{
return parent::buildAnnotationForMethod($rules, $pluginName, $reflectionMethod);
}
/**
* @inheritDoc
*/
public function determineParameters(array $rules, string $plugin, string $method, \ReflectionMethod $reflectionMethod): array
{
return parent::determineParameters($rules, $plugin, $method, $reflectionMethod);
}
/**
* @inheritDoc
*/
public function getApplicableDemoExampleUrls(string $pluginName, string $methodName, array $paramsData): array
{
return parent::getApplicableDemoExampleUrls($pluginName, $methodName, $paramsData);
}
/**
* @inheritDoc
*/
public function getDemoReportMetadata(): array
{
return parent::getDemoReportMetadata();
}
/**
* @inheritDoc
*/
public function getExampleIfAvailable(string $url, bool $useLocalToken = false, bool $ignoreCached = false): string
{
return parent::getExampleIfAvailable($url, $useLocalToken, $ignoreCached);
}
/**
* @inheritDoc
*/
public function getReportExampleUrlFromMetadata(string $pluginName, string $methodName): string
{
return parent::getReportExampleUrlFromMetadata($pluginName, $methodName);
}
public function getReportMetadataUrl(): string
{
return parent::getReportMetadataUrl();
}
public function prependInstanceUrl(string $path): string
{
return parent::prependInstanceUrl($path);
}
/**
* @inheritDoc
*/
public function determineResponses(array $rules, string $plugin, string $method, \ReflectionMethod $reflectionMethod, array $paramsData): array
{
return parent::determineResponses($rules, $plugin, $method, $reflectionMethod, $paramsData);
}
public function normaliseConfiguredParameterExample($example, array $typesMap = []): ?string
{
return parent::normaliseConfiguredParameterExample($example, $typesMap);
}
public function isBasicExampleArray(array $example): bool
{
return parent::isBasicExampleArray($example);
}
public function supportsBasicArrayExample(array $typesMap): bool
{
return parent::supportsBasicArrayExample($typesMap);
}
public function shouldUseParameterLevelExample(array $typesMap, string $example): bool
{
return parent::shouldUseParameterLevelExample($typesMap, $example);
}
public function shouldAcceptInvalidSslCertificate(): bool
{
return parent::shouldAcceptInvalidSslCertificate();
}
public function shouldAllowLocalRequests(): bool
{
return parent::shouldAllowLocalRequests();
}
}