Completed
Pull Request — master (#1)
by
unknown
01:58
created

Config   C

Complexity

Total Complexity 53

Size/Duplication

Total Lines 525
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 60.62%

Importance

Changes 0
Metric Value
wmc 53
lcom 1
cbo 2
dl 0
loc 525
ccs 77
cts 127
cp 0.6062
rs 6.96
c 0
b 0
f 0

29 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A client() 0 4 1
A loadCertificates() 0 6 2
A setCert() 0 12 2
A getCert() 0 7 1
A setPush() 0 6 1
A unsetPush() 0 6 1
A setRoute() 0 6 1
A unsetRoute() 0 6 1
A setRemote() 0 6 1
A unsetRemote() 0 6 1
B set() 0 45 9
A get() 0 4 1
A generate() 0 6 1
A __isset() 0 19 4
A __set() 0 5 1
A __get() 0 4 1
B __unset() 0 31 6
A unsetCert() 0 8 1
A setCerts() 0 14 3
A setPushes() 0 8 2
A setRoutes() 0 8 2
A setRemotes() 0 8 2
A setParams() 0 8 2
A getCerts() 0 4 1
A getPushes() 0 4 1
A getRoutes() 0 4 1
A getRemotes() 0 4 1
A getParameters() 0 4 1

How to fix   Complexity   

Complex Class

Complex classes like Config often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.

Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.

While breaking up the class, it is a good idea to analyze how other classes use Config, and based on these observations, apply Extract Interface, too.

1
<?php
2
3
namespace OpenVPN;
4
5
use OpenVPN\Interfaces\ConfigInterface;
6
use OpenVPN\Interfaces\GeneratorInterface;
7
use RuntimeException;
8
use function in_array;
9
use function is_bool;
10
11
/**
12
 * Class Config
13
 *
14
 * @property string    $modeSet             OpenVPN major mode: p2p, server
15
 * @property string    $local               Local host name or IP address
16
 * @property string    $remote              Remote host name or IP address
17
 * @property bool|null $remoteRandom        When multiple --remote address/ports are specified, initially randomize the order of the list
18
 * @property string    $proto               Protocol for communicating with remote host: tcp, udp, tcp-client
19
 * @property integer   $connectRetry        For --proto tcp-client, take n as the number of seconds to wait between connection retries (default=5)
20
 * @property string    $httpProxy           Connect to remote host through an HTTP proxy
21
 * @property bool|null $httpProxyRetry      Retry indefinitely on HTTP proxy errors. If an HTTP proxy error occurs, simulate a SIGUSR1 reset.
22
 * @property integer   $httpProxyTimeout    Set proxy timeout to n seconds, default=5.
23
 * @property string    $httpProxyOption     Set extended HTTP proxy options
24
 * @property string    $socksProxy          Connect to remote host through a Socks5 proxy
25
 * @property bool|null $socksProxyRetry     Retry indefinitely on Socks proxy errors. If a Socks proxy error occurs, simulate a SIGUSR1 reset.
26
 * @property string    $resolvRetry         If hostname resolve fails for --remote, retry resolve for n seconds before failing
27
 * @property bool|null $float               Allow remote peer to change its IP address and/or port number, such as due to DHCP
28
 * @property string    $ipchange            Execute shell command, format: cmd ip_address port_number
29
 * @property integer   $port                TCP/UDP port number for both local and remote: 1194
30
 * @property integer   $lport               TCP/UDP port number for local
31
 * @property integer   $rport               TCP/UDP port number for remote
32
 * @property bool|null $nobind              Do not bind to local address and port
33
 * @property string    $dev                 TUN/TAP virtual network device: tunX, tapX, null
34
 * @property string    $devType             Which device type are we using? device-type should be tun or tap
35
 * @property bool|null $tunIpv6             Build a tun link capable of forwarding IPv6 traffic
36
 * @property string    $devNode             Explicitly set the device node rather than using /dev/net/tun, /dev/tun, /dev/tap, etc.
37
 * @property string    $ifconfig            Set TUN/TAP adapter IP address of the local VPN endpoint.
38
 * @property bool|null $ifconfigNoexec      Don’t actually execute ifconfig/netsh commands, instead pass –ifconfig parameters to scripts using environmental variables.
39
 * @property bool|null $ifconfigNowarn      Don’t output an options consistency check warning
40
 * @property string    $ifconfigPool        Set aside a pool of subnets to be dynamically allocated to connecting clients, similar to a DHCP server.
41
 * @property string    $ifconfigPoolPersist Persist/unpersist ifconfig-pool data to file, at secondsintervals (default=600),
42
 * @property string    $cipher              Encrypt packets with cipher algorithm alg. The default is BF-CBC,an abbreviation for Blowfish in Cipher Block Chaining mode.
43
 * @property bool|null $redirectGateway
44
 * @property integer   $keyDirection
45
 * @property string    $remoteCertTls
46
 * @property string    $auth                Authenticate packets with HMAC using message digest algorithm alg. (The default is SHA1).
47
 * @property bool|null $authUserPass
48
 * @property bool|null $authNocache
49
 * @property string    $authUserPassVerify  Path to login script
50
 * @property bool|null $duplicateCn         You may need this if everyone is using same certificate
51
 * @property bool|null $persistKey
52
 * @property bool|null $persistTun
53
 * @property bool|null $compLzo             Use fast LZO compression — may add up to 1 byte per packet for incompressible data.
54
 * @property bool|null $compNoadapt         When used in conjunction with –comp-lzo, this option will disable OpenVPN’s adaptive compression algorithm.
55
 * @property integer   $verb                Set output verbosity to n(default=1). Each level shows all info from the previous levels: 0,1,2 ... 11
56
 * @property string    $server              A helper directive designed to simplify the configuration of OpenVPN’s server mode.
57
 * @property string    $serverBridge        A helper directive similar to --server which is designed to simplify the configuration of OpenVPN’s server mode in ethernet bridging configurations.
58
 * @property string    $keepalive
59
 * @property integer   $renegSec
60
 * @property string    $user
61
 * @property string    $group
62
 * @property string    $mute
63
 * @property string    $status
64
 * @property string    $logAppend
65
 * @property string    $clientConfigDir
66
 * @property string    $scriptSecurity
67
 * @property string    $usernameAsCommonName
68
 * @property string    $verifyClientCert
69
 *
70
 * @package OpenVPN
71
 */
72
class Config implements ConfigInterface, GeneratorInterface
73
{
74
    /**
75
     * List of types of certs, for validation
76
     */
77
    public const ALLOWED_TYPES_OF_CERTS = [
78
        'ca',
79
        'cert',
80
        'key',
81
        'dh',
82
        'tls-auth',
83
        'secret',
84
        'pkcs12'
85
    ];
86
87
    /**
88
     * Array with all certificates
89
     *
90
     * @var array
91
     */
92
    private $certs = [];
93
94
    /**
95
     * List of all routes available on server
96
     *
97
     * @var array
98
     */
99
    private $routes = [];
100
101
    /**
102
     * List of lines which must be pushed to clients
103
     *
104
     * @var array
105
     */
106
    private $pushes = [];
107
108
    /**
109
     * List of lines which can be used as remotes
110
     *
111
     * @var array
112
     */
113
    private $remotes = [];
114
115
    /**
116
     * All parameters added via addParam method
117
     *
118
     * @var array
119
     */
120
    private $parameters = [];
121
122
    /**
123
     * Config constructor.
124
     *
125
     * @param array $parameters List of default parameters
126
     */
127 8
    public function __construct(array $parameters = [])
128
    {
129 8
        $this->setParams($parameters);
130 8
    }
131
132
    /**
133
     * Alias for client line of config
134
     *
135
     * @return \OpenVPN\Interfaces\ConfigInterface
136
     */
137 1
    public function client(): ConfigInterface
138
    {
139 1
        return $this->set('client');
140
    }
141
142
    /**
143
     * Import content of all listed certificates
144
     *
145
     * @return void
146
     */
147
    public function loadCertificates(): void
148
    {
149
        foreach ($this->certs as &$cert) {
150
            $cert['content'] = rtrim(file_get_contents($cert['path']));
151
        }
152
    }
153
154
    /**
155
     * Add new cert into the configuration
156
     *
157
     * @param string    $type      Type of certificate [ca, cert, key, dh, tls-auth]
158
     * @param string    $path      Absolute or relative path to certificate or content of this file
159
     * @param bool|null $isContent If true, then script will try to load file from dist by $path
160
     *
161
     * @return \OpenVPN\Interfaces\ConfigInterface
162
     * @throws \RuntimeException
163
     */
164 6
    public function setCert(string $type, string $path, bool $isContent = null): ConfigInterface
165
    {
166 6
        $type = mb_strtolower($type);
167 6
        Helpers::isCertAllowed($type);
168 6
        if (true === $isContent) {
169 1
            $this->certs[$type]['content'] = $path;
170
        } else {
171 6
            $this->certs[$type]['path'] = $path;
172
        }
173
174 6
        return $this;
175
    }
176
177
    /**
178
     * Return information about specified certificate
179
     *
180
     * @param string $type
181
     *
182
     * @return array
183
     * @throws \RuntimeException
184
     */
185
    public function getCert(string $type): array
186
    {
187
        $type = mb_strtolower($type);
188
        Helpers::isCertAllowed($type);
189
190
        return $this->certs[$type] ?? [];
191
    }
192
193
    /**
194
     * Append new push into the array
195
     *
196
     * @param string $line String with line which must be pushed
197
     *
198
     * @return \OpenVPN\Interfaces\ConfigInterface
199
     */
200 4
    public function setPush(string $line): ConfigInterface
201
    {
202 4
        $this->pushes[] = trim($line, '"');
203
204 4
        return $this;
205
    }
206
207
    /**
208
     * Remove route line from push array
209
     *
210
     * @param string $line String with line which must be pushed
211
     *
212
     * @return \OpenVPN\Interfaces\ConfigInterface
213
     */
214
    public function unsetPush(string $line): ConfigInterface
215
    {
216
        unset($this->pushes[$line]);
217
218
        return $this;
219
    }
220
221
    /**
222
     * Append new route into the array
223
     *
224
     * @param string $line String with route
225
     *
226
     * @return \OpenVPN\Interfaces\ConfigInterface
227
     */
228 3
    public function setRoute(string $line): ConfigInterface
229
    {
230 3
        $this->routes[] = trim($line, '"');
231
232 3
        return $this;
233
    }
234
235
    /**
236
     * Remove route line from routes array
237
     *
238
     * @param string $line String with route
239
     *
240
     * @return \OpenVPN\Interfaces\ConfigInterface
241
     */
242
    public function unsetRoute(string $line): ConfigInterface
243
    {
244
        unset($this->routes[$line]);
245
246
        return $this;
247
    }
248
249
    /**
250
     * Append new push into the array
251
     *
252
     * @param string $line String with line which must be added as remote
253
     *
254
     * @return \OpenVPN\Interfaces\ConfigInterface
255
     */
256 1
    public function setRemote(string $line): ConfigInterface
257
    {
258 1
        $this->remotes[] = trim($line, '"');
259
260 1
        return $this;
261
    }
262
263
    /**
264
     * Remove remote line from remotes array
265
     *
266
     * @param string $line String with line which must be added as remote
267
     *
268
     * @return \OpenVPN\Interfaces\ConfigInterface
269
     */
270
    public function unsetRemote(string $line): ConfigInterface
271
    {
272
        unset($this->remotes[$line]);
273
274
        return $this;
275
    }
276
277
    /**
278
     * Add some new parameter to the list of parameters
279
     *
280
     * @param string           $name  Name of parameter
281
     * @param string|bool|null $value Value of parameter
282
     *
283
     * @return \OpenVPN\Interfaces\ConfigInterface
284
     * @example $this->add('client')->add('remote', 'vpn.example.com');
285
     */
286 5
    public function set(string $name, $value = null): ConfigInterface
287
    {
288 5
        $name = mb_strtolower($name);
289
290
        // Check if key is certificate or push, or classic parameter
291 5
        if (in_array($name, self::ALLOWED_TYPES_OF_CERTS, true)) {
292 3
            return $this->setCert($name, $value);
0 ignored issues
show
Bug introduced by
It seems like $value defined by parameter $value on line 286 can also be of type boolean or null; however, OpenVPN\Config::setCert() does only seem to accept string, maybe add an additional type check?

This check looks at variables that have been passed in as parameters and are passed out again to other methods.

If the outgoing method call has stricter type requirements than the method itself, an issue is raised.

An additional type check may prevent trouble.

Loading history...
293
        }
294
295
        // If is push then use add push method
296 5
        if ($name === 'remote') {
297 1
            return $this->setRemote($value);
0 ignored issues
show
Bug introduced by
It seems like $value defined by parameter $value on line 286 can also be of type boolean or null; however, OpenVPN\Config::setRemote() does only seem to accept string, maybe add an additional type check?

This check looks at variables that have been passed in as parameters and are passed out again to other methods.

If the outgoing method call has stricter type requirements than the method itself, an issue is raised.

An additional type check may prevent trouble.

Loading history...
298
        }
299
300
        // If is push then use add push method
301 5
        if ($name === 'push') {
302 4
            return $this->setPush($value);
0 ignored issues
show
Bug introduced by
It seems like $value defined by parameter $value on line 286 can also be of type boolean or null; however, OpenVPN\Config::setPush() does only seem to accept string, maybe add an additional type check?

This check looks at variables that have been passed in as parameters and are passed out again to other methods.

If the outgoing method call has stricter type requirements than the method itself, an issue is raised.

An additional type check may prevent trouble.

Loading history...
303
        }
304
305
        // If is push then use add push method
306 4
        if ($name === 'route') {
307 3
            return $this->setRoute($value);
0 ignored issues
show
Bug introduced by
It seems like $value defined by parameter $value on line 286 can also be of type boolean or null; however, OpenVPN\Config::setRoute() does only seem to accept string, maybe add an additional type check?

This check looks at variables that have been passed in as parameters and are passed out again to other methods.

If the outgoing method call has stricter type requirements than the method itself, an issue is raised.

An additional type check may prevent trouble.

Loading history...
308
        }
309
310
        
311
        // Ability to unset param
312 4
        if (is_null ($value)) {
313 1
            unset ($this->parameters[$name]);
314
        }
315
        
316
        // Check if provided value is boolean and if it's true, then set null (that mean parameter without value)
317 4
        if (is_bool($value) && $value) {
318 3
            if ($value) {
319 3
                $value = null;
320
            } else {
321
                // If false then skip this step
322
                return $this;
323
            }
324
        }
325
326
        // Set new value
327 4
        $this->parameters[$name] = $value;
328
        
329 4
        return $this;
330
    }
331
332
    /**
333
     * Get some custom element
334
     *
335
     * @param string|null $name Name of parameter
336
     *
337
     * @return mixed
338
     */
339
    public function get(string $name)
340
    {
341
        return $this->parameters[$name] ?? null;
342
    }
343
344
    /**
345
     * Generate config by parameters in memory
346
     *
347
     * @param string $type Type of generated config: raw (default), json
348
     *
349
     * @return array|string|null
350
     */
351 1
    public function generate(string $type = 'raw')
352
    {
353 1
        $generator = new Generator($this);
354
355 1
        return $generator->generate($type);
356
    }
357
358
    /**
359
     * @param string $name
360
     *
361
     * @return bool
362
     */
363
    public function __isset(string $name): bool
364
    {
365
        // Inform about deleting push
366
        if ($name === 'push') {
367
            throw new RuntimeException("Not possible to remove push, use 'unsetPush' instead");
368
        }
369
370
        // Inform about deleting route
371
        if ($name === 'route') {
372
            throw new RuntimeException("Not possible to remove route, use 'unsetRoute' instead");
373
        }
374
375
        // Inform about deleting route
376
        if ($name === 'remote') {
377
            throw new RuntimeException("Not possible to remove remote, use 'unsetRemote' instead");
378
        }
379
380
        return isset($this->parameters[$name]);
381
    }
382
383
    /**
384
     * @param string                   $name
385
     * @param string|bool|integer|null $value
386
     */
387 3
    public function __set(string $name, $value = null): void
388
    {
389 3
        $name = Helpers::decamelize($name);
390 3
        $this->set($name, $value);
391 3
    }
392
393
    /**
394
     * @param string $name
395
     *
396
     * @return string|bool|null
397
     */
398
    public function __get(string $name)
399
    {
400
        return $this->get($name);
401
    }
402
403
    /**
404
     * Remove some parameter from array by name
405
     *
406
     * @param string $name Name of parameter
407
     *
408
     * @return void
409
     * @throws \RuntimeException
410
     */
411
    public function __unset(string $name): void
412
    {
413
        // Inform about deleting push
414
        if ($name === 'push') {
415
            throw new RuntimeException("Not possible to remove push, use 'unsetPush' instead");
416
        }
417
418
        // Inform about deleting route
419
        if ($name === 'route') {
420
            throw new RuntimeException("Not possible to remove route, use 'unsetRoute' instead");
421
        }
422
423
        // Inform about deleting route
424
        if ($name === 'remote') {
425
            throw new RuntimeException("Not possible to remove remote, use 'unsetRemote' instead");
426
        }
427
428
        // Check if key is certificate or push, or classic parameter
429
        if (in_array($name, self::ALLOWED_TYPES_OF_CERTS, true)) {
430
            $this->unsetCert($name);
431
            return;
432
        }
433
434
        // Update list of parameters
435
        $this->parameters = array_map(
436
            static function ($param) use ($name) {
437
                return ($param['name'] === $name) ? null : $param;
438
            },
439
            $this->parameters
440
        );
441
    }
442
443
    /**
444
     * Remove selected certificate from array
445
     *
446
     * @param string $type Type of certificate [ca, cert, key, dh, tls-auth]
447
     *
448
     * @return \OpenVPN\Interfaces\ConfigInterface
449
     * @throws \RuntimeException
450
     */
451 2
    public function unsetCert(string $type): ConfigInterface
452
    {
453 2
        $type = mb_strtolower($type);
454 2
        Helpers::isCertAllowed($type);
455 2
        unset($this->certs[$type]);
456
457 2
        return $this;
458
    }
459
460
    /**
461
     * Set scope of certs
462
     *
463
     * @param \OpenVPN\Types\Cert[]|string[] $certs
464
     * @param bool                           $loadCertificates
465
     *
466
     * @return \OpenVPN\Interfaces\ConfigInterface
467
     */
468 3
    public function setCerts(array $certs, bool $loadCertificates = false): ConfigInterface
469
    {
470
        // Pass list of certs from array to variable
471 3
        foreach ($certs as $type => $path) {
472 3
            $this->setCert($type, $path);
0 ignored issues
show
Bug introduced by
It seems like $path defined by $path on line 471 can also be of type object<OpenVPN\Types\Cert>; however, OpenVPN\Config::setCert() does only seem to accept string, maybe add an additional type check?

If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:

/**
 * @return array|string
 */
function returnsDifferentValues($x) {
    if ($x) {
        return 'foo';
    }

    return array();
}

$x = returnsDifferentValues($y);
if (is_array($x)) {
    // $x is an array.
}

If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.

Loading history...
473
        }
474
475
        // If need to load content of files from disk
476 3
        if ($loadCertificates) {
477
            $this->loadCertificates();
478
        }
479
480 3
        return $this;
481
    }
482
483
    /**
484
     * Set scope of unique pushes
485
     *
486
     * @param \OpenVPN\Types\Push[]|string[] $pushes
487
     *
488
     * @return \OpenVPN\Interfaces\ConfigInterface
489
     */
490 3
    public function setPushes(array $pushes): ConfigInterface
491
    {
492 3
        foreach ($pushes as $push) {
493 3
            $this->setPush($push);
0 ignored issues
show
Bug introduced by
It seems like $push defined by $push on line 492 can also be of type object<OpenVPN\Types\Push>; however, OpenVPN\Config::setPush() does only seem to accept string, maybe add an additional type check?

If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:

/**
 * @return array|string
 */
function returnsDifferentValues($x) {
    if ($x) {
        return 'foo';
    }

    return array();
}

$x = returnsDifferentValues($y);
if (is_array($x)) {
    // $x is an array.
}

If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.

Loading history...
494
        }
495
496 3
        return $this;
497
    }
498
499
    /**
500
     * Set scope of unique routes
501
     *
502
     * @param \OpenVPN\Types\Route[]|string[] $routes
503
     *
504
     * @return \OpenVPN\Interfaces\ConfigInterface
505
     */
506 3
    public function setRoutes(array $routes): ConfigInterface
507
    {
508 3
        foreach ($routes as $route) {
509 3
            $this->setRoute($route);
0 ignored issues
show
Bug introduced by
It seems like $route defined by $route on line 508 can also be of type object<OpenVPN\Types\Route>; however, OpenVPN\Config::setRoute() does only seem to accept string, maybe add an additional type check?

If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:

/**
 * @return array|string
 */
function returnsDifferentValues($x) {
    if ($x) {
        return 'foo';
    }

    return array();
}

$x = returnsDifferentValues($y);
if (is_array($x)) {
    // $x is an array.
}

If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.

Loading history...
510
        }
511
512 3
        return $this;
513
    }
514
515
    /**
516
     * Set scope of unique remotes
517
     *
518
     * @param \OpenVPN\Types\Remote[]|string[] $remotes
519
     *
520
     * @return \OpenVPN\Interfaces\ConfigInterface
521
     */
522
    public function setRemotes(array $remotes): ConfigInterface
523
    {
524
        foreach ($remotes as $remote) {
525
            $this->setRemote($remote);
0 ignored issues
show
Bug introduced by
It seems like $remote defined by $remote on line 524 can also be of type object<OpenVPN\Types\Remote>; however, OpenVPN\Config::setRemote() does only seem to accept string, maybe add an additional type check?

If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:

/**
 * @return array|string
 */
function returnsDifferentValues($x) {
    if ($x) {
        return 'foo';
    }

    return array();
}

$x = returnsDifferentValues($y);
if (is_array($x)) {
    // $x is an array.
}

If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.

Loading history...
526
        }
527
528
        return $this;
529
    }
530
531
    /**
532
     * Set scope of unique parameters
533
     *
534
     * @param \OpenVPN\Types\Parameter[]|string[] $parameters
535
     *
536
     * @return \OpenVPN\Interfaces\ConfigInterface
537
     */
538 8
    public function setParams(array $parameters): ConfigInterface
539
    {
540 8
        foreach ($parameters as $name => $value) {
541 1
            $this->set($name, $value);
0 ignored issues
show
Bug introduced by
It seems like $value defined by $value on line 540 can also be of type object<OpenVPN\Types\Parameter>; however, OpenVPN\Config::set() does only seem to accept string|boolean|null, maybe add an additional type check?

If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:

/**
 * @return array|string
 */
function returnsDifferentValues($x) {
    if ($x) {
        return 'foo';
    }

    return array();
}

$x = returnsDifferentValues($y);
if (is_array($x)) {
    // $x is an array.
}

If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.

Loading history...
542
        }
543
544 8
        return $this;
545
    }
546
547
    /**
548
     * Export array of all certificates
549
     *
550
     * @return array
551
     */
552 7
    public function getCerts(): array
553
    {
554 7
        return $this->certs;
555
    }
556
557
    /**
558
     * Export array of all pushes
559
     *
560
     * @return array
561
     */
562 4
    public function getPushes(): array
563
    {
564 4
        return $this->pushes;
565
    }
566
567
    /**
568
     * Export array of all routes
569
     *
570
     * @return array
571
     */
572 4
    public function getRoutes(): array
573
    {
574 4
        return $this->routes;
575
    }
576
577
    /**
578
     * Export array of all remotes
579
     *
580
     * @return array
581
     */
582 2
    public function getRemotes(): array
583
    {
584 2
        return $this->remotes;
585
    }
586
587
    /**
588
     * Export array of all parameters
589
     *
590
     * @return array
591
     */
592 5
    public function getParameters(): array
593
    {
594 5
        return $this->parameters;
595
    }
596
}
597