Completed
Push — develop ( bacd9d...dcd68d )
by Mikaël
46:10 queued 42:30
created

GeneratorOptions::getAddComments()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace WsdlToPhp\PackageGenerator\ConfigurationReader;
4
5
class GeneratorOptions extends AbstractYamlReader implements \JsonSerializable
6
{
7
    /**
8
     * Common values used as option's value
9
     */
10
    const VALUE_CAT = 'cat';
11
    const VALUE_END = 'end';
12
    const VALUE_FALSE = false;
13
    const VALUE_NONE = 'none';
14
    const VALUE_START = 'start';
15
    const VALUE_TRUE = true;
16
    /**
17
     * Possible option keys
18
     * @var string
19
     */
20
    const ADD_COMMENTS = 'add_comments';
21
    const ARRAYS_FOLDER = 'arrays_folder';
22
    const BASIC_LOGIN = 'basic_login';
23
    const BASIC_PASSWORD = 'basic_password';
24
    const CATEGORY = 'category';
25
    const COMPOSER_NAME = 'composer_name';
26
    const COMPOSER_SETTINGS = 'composer_settings';
27
    const DESTINATION = 'destination';
28
    const ENUMS_FOLDER = 'enums_folder';
29
    const GATHER_METHODS = 'gather_methods';
30
    const GENERATE_TUTORIAL_FILE = 'generate_tutorial_file';
31
    const GENERIC_CONSTANTS_NAME = 'generic_constants_names';
32
    const NAMESPACE_PREFIX = 'namespace_prefix';
33
    const ORIGIN = 'origin';
34
    const PREFIX = 'prefix';
35
    const PROXY_HOST = 'proxy_host';
36
    const PROXY_LOGIN = 'proxy_login';
37
    const PROXY_PASSWORD = 'proxy_password';
38
    const PROXY_PORT = 'proxy_port';
39
    const SERVICES_FOLDER = 'services_folder';
40
    const SOAP_CLIENT_CLASS = 'soap_client_class';
41
    const SOAP_OPTIONS = 'soap_options';
42
    const SRC_DIRNAME = 'src_dirname';
43
    const STANDALONE = 'standalone';
44
    const STRUCT_ARRAY_CLASS = 'struct_array_class';
45
    const STRUCT_CLASS = 'struct_class';
46
    const STRUCTS_FOLDER = 'structs_folder';
47
    const SUFFIX = 'suffix';
48
    const VALIDATION = 'validation';
49
    const SCHEMAS_SAVE = 'schemas_save';
50
    const SCHEMAS_FOLDER = 'schemas_folder';
51
    const XSD_TYPES_PATH = 'xsd_types_path';
52
    /**
53
     * Generator's options
54
     * @var array
55
     */
56
    protected $options;
57
    /**
58
     * @param string $filename
59
     */
60 50
    protected function __construct($filename)
61
    {
62 50
        $this->options = [];
63 50
        $this->parseOptions($filename);
64 45
    }
65
    /**
66
     * Parse options for generator
67
     * @param string $filename options's file to parse
68
     * @return GeneratorOptions
69
     */
70 50
    protected function parseOptions($filename)
71
    {
72 50
        $options = $this->loadYaml($filename);
73 50
        if (is_array($options)) {
74 45
            $this->options = $options;
75 27
        } else {
76 5
            throw new \InvalidArgumentException(sprintf('Settings contained by "%s" are not valid as the settings are not contained by an array: "%s"', $filename, gettype($options)), __LINE__);
77
        }
78 45
        return $this;
79
    }
80
    /**
81
     * Returns the option value
82
     * @throws \InvalidArgumentException
83
     * @param string $optionName
84
     * @return mixed
85
     */
86 1510
    public function getOptionValue($optionName)
87
    {
88 1510
        if (!isset($this->options[$optionName])) {
89 5
            throw new \InvalidArgumentException(sprintf('Invalid option name "%s", possible options: %s', $optionName, implode(', ', array_keys($this->options))), __LINE__);
90
        }
91 1505
        return array_key_exists('value', $this->options[$optionName]) ? $this->options[$optionName]['value'] : $this->options[$optionName]['default'];
92
    }
93
    /**
94
     * Allows to add an option and set its value
95
     * @throws \InvalidArgumentException
96
     * @param string $optionName
97
     * @param mixed $optionValue
98
     * @param array $values
99
     * @return GeneratorOptions
100
     */
101 1165
    public function setOptionValue($optionName, $optionValue, array $values = [])
102
    {
103 1165
        if (!isset($this->options[$optionName])) {
104 10
            $this->options[$optionName] = [
105 10
                'value' => $optionValue,
106 10
                'values' => $values,
107
            ];
108 1163
        } elseif (!empty($this->options[$optionName]['values']) && !in_array($optionValue, $this->options[$optionName]['values'], true)) {
109 10
            throw new \InvalidArgumentException(sprintf('Invalid value "%s" for option "%s", possible values: %s', $optionValue, $optionName, implode(', ', $this->options[$optionName]['values'])), __LINE__);
110
        } else {
111 1150
            $this->options[$optionName]['value'] = $optionValue;
112
        }
113 1155
        return $this;
114
    }
115
    /**
116
     * @throws \InvalidArgumentException
117
     * @param string $filename options's file to parse
118
     * @return GeneratorOptions
119
     */
120 1145
    public static function instance($filename = null)
121
    {
122 1145
        return parent::instance(empty($filename) ? self::getDefaultConfigurationPath() : $filename);
123
    }
124
    /**
125
     * @return string
126
     */
127 470
    public static function getDefaultConfigurationPath()
128
    {
129 470
        return __DIR__ . '/../resources/config/generator_options.yml';
130
    }
131
    /**
132
     * Get category option value
133
     * @return string
134
     */
135 415
    public function getCategory()
136
    {
137 415
        return $this->getOptionValue(self::CATEGORY);
138
    }
139
    /**
140
     * Set current category option value
141
     * @throws \InvalidArgumentException
142
     * @param string $category
143
     * @return GeneratorOptions
144
     */
145 45
    public function setCategory($category)
146
    {
147 45
        return $this->setOptionValue(self::CATEGORY, $category);
148
    }
149
    /**
150
     * Get add comments option value
151
     * @return array
152
     */
153 310
    public function getAddComments()
154
    {
155 310
        return $this->getOptionValue(self::ADD_COMMENTS);
156
    }
157
    /**
158
     * Set current add comments option value
159
     * @throws \InvalidArgumentException
160
     * @param array $addComments
161
     * @return GeneratorOptions
162
     */
163 95
    public function setAddComments(array $addComments = [])
164
    {
165
        /**
166
         * If array is type array("author:john Doe","Release:1",)
167
         */
168 95
        $comments = [];
169 95
        foreach ($addComments as $index => $value) {
170 20
            if (is_numeric($index) && strpos($value, ':') > 0) {
171 5
                list($tag, $val) = explode(':', $value);
172 5
                $comments[$tag] = $val;
173 3
            } else {
174 17
                $comments[$index] = $value;
175
            }
176 57
        }
177 95
        return $this->setOptionValue(self::ADD_COMMENTS, $comments);
178
    }
179
    /**
180
     * Get gather methods option value
181
     * @return string
182
     */
183 420
    public function getGatherMethods()
184
    {
185 420
        return $this->getOptionValue(self::GATHER_METHODS);
186
    }
187
    /**
188
     * Set current gather methods option value
189
     * @throws \InvalidArgumentException
190
     * @param string $gatherMethods
191
     * @return GeneratorOptions
192
     */
193 40
    public function setGatherMethods($gatherMethods)
194
    {
195 40
        return $this->setOptionValue(self::GATHER_METHODS, $gatherMethods);
196
    }
197
    /**
198
     * Get generate tutorial file option value
199
     * @return bool
200
     */
201 50
    public function getGenerateTutorialFile()
202
    {
203 50
        return $this->getOptionValue(self::GENERATE_TUTORIAL_FILE);
204
    }
205
    /**
206
     * Set current generate tutorial file option value
207
     * @throws \InvalidArgumentException
208
     * @param bool $generateTutorialFile
209
     * @return GeneratorOptions
210
     */
211 75
    public function setGenerateTutorialFile($generateTutorialFile)
212
    {
213 75
        return $this->setOptionValue(self::GENERATE_TUTORIAL_FILE, $generateTutorialFile);
214
    }
215
    /**
216
     * Get namespace option value
217
     * @return string
218
     */
219 385
    public function getNamespace()
220
    {
221 385
        return $this->getOptionValue(self::NAMESPACE_PREFIX);
222
    }
223
    /**
224
     * Set current namespace option value
225
     * @throws \InvalidArgumentException
226
     * @param string $namespace
227
     * @return GeneratorOptions
228
     */
229 55
    public function setNamespace($namespace)
230
    {
231 55
        return $this->setOptionValue(self::NAMESPACE_PREFIX, $namespace);
232
    }
233
    /**
234
     * Get generic constants name option value
235
     * @return bool
236
     */
237 90
    public function getGenericConstantsName()
238
    {
239 90
        return $this->getOptionValue(self::GENERIC_CONSTANTS_NAME);
240
    }
241
    /**
242
     * Set current generic constants name option value
243
     * @throws \InvalidArgumentException
244
     * @param bool $genericConstantsName
245
     * @return GeneratorOptions
246
     */
247 75
    public function setGenericConstantsName($genericConstantsName)
248
    {
249 75
        return $this->setOptionValue(self::GENERIC_CONSTANTS_NAME, $genericConstantsName);
250
    }
251
    /**
252
     * Get standalone option value
253
     * @return bool
254
     */
255 95
    public function getStandalone()
256
    {
257 95
        return $this->getOptionValue(self::STANDALONE);
258
    }
259
    /**
260
     * Set current standalone option value
261
     * @throws \InvalidArgumentException
262
     * @param bool $standalone
263
     * @return GeneratorOptions
264
     */
265 45
    public function setStandalone($standalone)
266
    {
267 45
        return $this->setOptionValue(self::STANDALONE, $standalone);
268
    }
269
    /**
270
     * Get validation option value
271
     * @return bool
272
     */
273 185
    public function getValidation()
274
    {
275 185
        return $this->getOptionValue(self::VALIDATION);
276
    }
277
    /**
278
     * Set current validation option value
279
     * @throws \InvalidArgumentException
280
     * @param bool $validation
281
     * @return GeneratorOptions
282
     */
283 40
    public function setValidation($validation)
284
    {
285 40
        return $this->setOptionValue(self::VALIDATION, $validation);
286
    }
287
    /**
288
     * Get struct class option value
289
     * @return string
290
     */
291 160
    public function getStructClass()
292
    {
293 160
        return $this->getOptionValue(self::STRUCT_CLASS);
294
    }
295
    /**
296
     * Set current struct class option value
297
     * @throws \InvalidArgumentException
298
     * @param string $structClass
299
     * @return GeneratorOptions
300
     */
301 45
    public function setStructClass($structClass)
302
    {
303 45
        return $this->setOptionValue(self::STRUCT_CLASS, $structClass);
304
    }
305
    /**
306
     * Get struct array class option value
307
     * @return string
308
     */
309 60
    public function getStructArrayClass()
310
    {
311 60
        return $this->getOptionValue(self::STRUCT_ARRAY_CLASS);
312
    }
313
    /**
314
     * Set current struct array class option value
315
     * @throws \InvalidArgumentException
316
     * @param string $structArrayClass
317
     * @return GeneratorOptions
318
     */
319 35
    public function setStructArrayClass($structArrayClass)
320
    {
321 35
        return $this->setOptionValue(self::STRUCT_ARRAY_CLASS, $structArrayClass);
322
    }
323
    /**
324
     * Get struct array class option value
325
     * @return string
326
     */
327 135
    public function getSoapClientClass()
328
    {
329 135
        return $this->getOptionValue(self::SOAP_CLIENT_CLASS);
330
    }
331
    /**
332
     * Set current struct array class option value
333
     * @throws \InvalidArgumentException
334
     * @param string $soapClientClass
335
     * @return GeneratorOptions
336
     */
337 35
    public function setSoapClientClass($soapClientClass)
338
    {
339 35
        return $this->setOptionValue(self::SOAP_CLIENT_CLASS, $soapClientClass);
340
    }
341
    /**
342
     * Get origin option value
343
     * @return string
344
     */
345 790
    public function getOrigin()
346
    {
347 790
        return $this->getOptionValue(self::ORIGIN);
348
    }
349
    /**
350
     * Set current origin option value
351
     * @throws \InvalidArgumentException
352
     * @param string $origin
353
     * @return GeneratorOptions
354
     */
355 410
    public function setOrigin($origin)
356
    {
357 410
        return $this->setOptionValue(self::ORIGIN, $origin);
358
    }
359
    /**
360
     * Get destination option value
361
     * @return string
362
     */
363 445
    public function getDestination()
364
    {
365 445
        return $this->getOptionValue(self::DESTINATION);
366
    }
367
    /**
368
     * Set current destination option value
369
     * @throws \InvalidArgumentException
370
     * @param string $destination
371
     * @return GeneratorOptions
372
     */
373 415
    public function setDestination($destination)
374
    {
375 415
        return $this->setOptionValue(self::DESTINATION, $destination);
376
    }
377
    /**
378
     * Get src dirname option value
379
     * @return string
380
     */
381 380
    public function getSrcDirname()
382
    {
383 380
        return $this->getOptionValue(self::SRC_DIRNAME);
384
    }
385
    /**
386
     * Set current src dirname option value
387
     * @throws \InvalidArgumentException
388
     * @param string $srcDirname
389
     * @return GeneratorOptions
390
     */
391 25
    public function setSrcDirname($srcDirname)
392
    {
393 25
        return $this->setOptionValue(self::SRC_DIRNAME, $srcDirname);
394
    }
395
    /**
396
     * Get prefix option value
397
     * @return string
398
     */
399 785
    public function getPrefix()
400
    {
401 785
        return $this->getOptionValue(self::PREFIX);
402
    }
403
    /**
404
     * Set current prefix option value
405
     * @throws \InvalidArgumentException
406
     * @param string $prefix
407
     * @return GeneratorOptions
408
     */
409 135
    public function setPrefix($prefix)
410
    {
411 135
        return $this->setOptionValue(self::PREFIX, $prefix);
412
    }
413
    /**
414
     * Get suffix option value
415
     * @return string
416
     */
417 755
    public function getSuffix()
418
    {
419 755
        return $this->getOptionValue(self::SUFFIX);
420
    }
421
    /**
422
     * Set current suffix option value
423
     * @throws \InvalidArgumentException
424
     * @param string $suffix
425
     * @return GeneratorOptions
426
     */
427 65
    public function setSuffix($suffix)
428
    {
429 65
        return $this->setOptionValue(self::SUFFIX, $suffix);
430
    }
431
    /**
432
     * Get basic login option value
433
     * @return string
434
     */
435 795
    public function getBasicLogin()
436
    {
437 795
        return $this->getOptionValue(self::BASIC_LOGIN);
438
    }
439
    /**
440
     * Set current basic login option value
441
     * @throws \InvalidArgumentException
442
     * @param string $basicLogin
443
     * @return GeneratorOptions
444
     */
445 35
    public function setBasicLogin($basicLogin)
446
    {
447 35
        return $this->setOptionValue(self::BASIC_LOGIN, $basicLogin);
448
    }
449
    /**
450
     * Get basic password option value
451
     * @return string
452
     */
453 795
    public function getBasicPassword()
454
    {
455 795
        return $this->getOptionValue(self::BASIC_PASSWORD);
456
    }
457
    /**
458
     * Set current basic password option value
459
     * @throws \InvalidArgumentException
460
     * @param string $basicPassword
461
     * @return GeneratorOptions
462
     */
463 35
    public function setBasicPassword($basicPassword)
464
    {
465 35
        return $this->setOptionValue(self::BASIC_PASSWORD, $basicPassword);
466
    }
467
    /**
468
     * Get basic proxy host option value
469
     * @return string
470
     */
471 795
    public function getProxyHost()
472
    {
473 795
        return $this->getOptionValue(self::PROXY_HOST);
474
    }
475
    /**
476
     * Set current proxy host option value
477
     * @throws \InvalidArgumentException
478
     * @param string $proxyHost
479
     * @return GeneratorOptions
480
     */
481 35
    public function setProxyHost($proxyHost)
482
    {
483 35
        return $this->setOptionValue(self::PROXY_HOST, $proxyHost);
484
    }
485
    /**
486
     * Get basic proxy port option value
487
     * @return string
488
     */
489 795
    public function getProxyPort()
490
    {
491 795
        return $this->getOptionValue(self::PROXY_PORT);
492
    }
493
    /**
494
     * Set current proxy port option value
495
     * @throws \InvalidArgumentException
496
     * @param string $proxyPort
497
     * @return GeneratorOptions
498
     */
499 35
    public function setProxyPort($proxyPort)
500
    {
501 35
        return $this->setOptionValue(self::PROXY_PORT, $proxyPort);
502
    }
503
    /**
504
     * Get basic proxy login option value
505
     * @return string
506
     */
507 795
    public function getProxyLogin()
508
    {
509 795
        return $this->getOptionValue(self::PROXY_LOGIN);
510
    }
511
    /**
512
     * Set current proxy login option value
513
     * @throws \InvalidArgumentException
514
     * @param string $proxyLogin
515
     * @return GeneratorOptions
516
     */
517 35
    public function setProxyLogin($proxyLogin)
518
    {
519 35
        return $this->setOptionValue(self::PROXY_LOGIN, $proxyLogin);
520
    }
521
    /**
522
     * Get basic proxy password option value
523
     * @return string
524
     */
525 795
    public function getProxyPassword()
526
    {
527 795
        return $this->getOptionValue(self::PROXY_PASSWORD);
528
    }
529
    /**
530
     * Set current proxy password option value
531
     * @throws \InvalidArgumentException
532
     * @param string $proxyPassword
533
     * @return GeneratorOptions
534
     */
535 35
    public function setProxyPassword($proxyPassword)
536
    {
537 35
        return $this->setOptionValue(self::PROXY_PASSWORD, $proxyPassword);
538
    }
539
    /**
540
     * Get basic soap options option value
541
     * @return array
542
     */
543 785
    public function getSoapOptions()
544
    {
545 785
        return $this->getOptionValue(self::SOAP_OPTIONS);
546
    }
547
    /**
548
     * Set current soap options option value
549
     * @throws \InvalidArgumentException
550
     * @param array $soapOptions
551
     * @return GeneratorOptions
552
     */
553 40
    public function setSoapOptions(array $soapOptions)
554
    {
555 40
        return $this->setOptionValue(self::SOAP_OPTIONS, $soapOptions);
556
    }
557
    /**
558
     * Get composer name option value
559
     * @return string
560
     */
561 75
    public function getComposerName()
562
    {
563 75
        return $this->getOptionValue(self::COMPOSER_NAME);
564
    }
565
    /**
566
     * Set current composer name option value
567
     * @throws \InvalidArgumentException
568
     * @param string $composerName
569
     * @return GeneratorOptions
570
     */
571 105
    public function setComposerName($composerName)
572
    {
573 105
        return $this->setOptionValue(self::COMPOSER_NAME, $composerName);
574
    }
575
    /**
576
     * Get composer settings option value
577
     * @return array
578
     */
579 60
    public function getComposerSettings()
580
    {
581 60
        return $this->getOptionValue(self::COMPOSER_SETTINGS);
582
    }
583
    /**
584
     * Set current composer settings option value
585
     * @throws \InvalidArgumentException
586
     * @param array $composerSettings
587
     * @return GeneratorOptions
588
     */
589 90
    public function setComposerSettings(array $composerSettings = [])
590
    {
591
        /**
592
         * If array is type array("config.value:true","require:library/src",)
593
         */
594 90
        $settings = [];
595 90
        foreach ($composerSettings as $index => $value) {
596 35
            if (is_numeric($index) && strpos($value, ':') > 0) {
597 35
                $path = implode('', array_slice(explode(':', $value), 0, 1));
598 35
                $val = implode(':', array_slice(explode(':', $value), 1));
599 35
                self::dotNotationToArray($path, $val, $settings);
600 21
            } else {
601 17
                $settings[$index] = $value;
602
            }
603 54
        }
604 90
        return $this->setOptionValue(self::COMPOSER_SETTINGS, $settings);
605
    }
606
    /**
607
     * turns my.key.path to array('my' => array('key' => array('path' => $value)))
608
     * @param string $string
609
     * @param mixed $value
610
     * @param array $array
611
     */
612 35
    protected static function dotNotationToArray($string, $value, array &$array)
613
    {
614 35
        $keys = explode('.', $string);
615 35
        foreach ($keys as $key) {
616 35
            $array = &$array[$key];
617 21
        }
618 35
        $array = ($value === 'true' || $value === 'false') ? $value === 'true' : $value;
619 35
    }
620
    /**
621
     * Get structs folder option value
622
     * @return string
623
     */
624 385
    public function getStructsFolder()
625
    {
626 385
        return $this->getOptionValue(self::STRUCTS_FOLDER);
627
    }
628
    /**
629
     * Set current structs folder option value
630
     * @throws \InvalidArgumentException
631
     * @param string $structsFolder
632
     * @return GeneratorOptions
633
     */
634 35
    public function setStructsFolder($structsFolder)
635
    {
636 35
        return $this->setOptionValue(self::STRUCTS_FOLDER, $structsFolder);
637
    }
638
    /**
639
     * Get arrays folder option value
640
     * @return string
641
     */
642 80
    public function getArraysFolder()
643
    {
644 80
        return $this->getOptionValue(self::ARRAYS_FOLDER);
645
    }
646
    /**
647
     * Set current arrays folder option value
648
     * @throws \InvalidArgumentException
649
     * @param string $arraysFolder
650
     * @return GeneratorOptions
651
     */
652 35
    public function setArraysFolder($arraysFolder)
653
    {
654 35
        return $this->setOptionValue(self::ARRAYS_FOLDER, $arraysFolder);
655
    }
656
    /**
657
     * Get enums folder option value
658
     * @return string
659
     */
660 150
    public function getEnumsFolder()
661
    {
662 150
        return $this->getOptionValue(self::ENUMS_FOLDER);
663
    }
664
    /**
665
     * Set current enums folder option value
666
     * @throws \InvalidArgumentException
667
     * @param string $enumsFolder
668
     * @return GeneratorOptions
669
     */
670 35
    public function setEnumsFolder($enumsFolder)
671
    {
672 35
        return $this->setOptionValue(self::ENUMS_FOLDER, $enumsFolder);
673
    }
674
    /**
675
     * Get services folder option value
676
     * @return string
677
     */
678 750
    public function getServicesFolder()
679
    {
680 750
        return $this->getOptionValue(self::SERVICES_FOLDER);
681
    }
682
    /**
683
     * Set current services folder option value
684
     * @throws \InvalidArgumentException
685
     * @param string $servicesFolder
686
     * @return GeneratorOptions
687
     */
688 35
    public function setServicesFolder($servicesFolder)
689
    {
690 35
        return $this->setOptionValue(self::SERVICES_FOLDER, $servicesFolder);
691
    }
692
    /**
693
     * Get schemas save option value
694
     * @return bool
695
     */
696 20
    public function getSchemasSave()
697
    {
698 20
        return $this->getOptionValue(self::SCHEMAS_SAVE);
699
    }
700
    /**
701
     * Set schemas save option value
702
     * @throws \InvalidArgumentException
703
     * @param bool $saveSchemas
704
     * @return GeneratorOptions
705
     */
706 40
    public function setSchemasSave($saveSchemas)
707
    {
708 40
        return $this->setOptionValue(self::SCHEMAS_SAVE, $saveSchemas);
709
    }
710
    /**
711
     * Get schemas folder option value
712
     * @return string
713
     */
714 15
    public function getSchemasFolder()
715
    {
716 15
        return $this->getOptionValue(self::SCHEMAS_FOLDER);
717
    }
718
    /**
719
     * Set schemas folder option value
720
     * @throws \InvalidArgumentException
721
     * @param string $schemasFolder
722
     * @return GeneratorOptions
723
     */
724 40
    public function setSchemasFolder($schemasFolder)
725
    {
726 40
        return $this->setOptionValue(self::SCHEMAS_FOLDER, $schemasFolder);
727
    }
728
    /**
729
     * Get xsd types path option value
730
     * @return string
731
     */
732 200
    public function getXsdTypesPath()
733
    {
734 200
        return $this->getOptionValue(self::XSD_TYPES_PATH);
735
    }
736
    /**
737
     * Set xsd types path option value
738
     * @throws \InvalidArgumentException
739
     * @param string $xsdTypesPath
740
     * @return GeneratorOptions
741
     */
742 5
    public function setXsdTypesPath($xsdTypesPath)
743
    {
744 5
        return $this->setOptionValue(self::XSD_TYPES_PATH, $xsdTypesPath);
745
    }
746
    /**
747
     * @return string[]
748
     */
749 45
    public function toArray()
750
    {
751 45
        $options = [];
752 45
        foreach (array_keys($this->options) as $name) {
753 45
            $options[$name] = $this->getOptionValue($name);
754 27
        }
755 45
        return $options;
756
    }
757 10
    public function jsonSerialize()
758
    {
759 10
        return $this->toArray();
760
    }
761
}
762