Skip to content

Commit 334d921

Browse files
committed
Merge branch 'release/4.1.5'
2 parents 870a576 + 9fa932c commit 334d921

File tree

57 files changed

+393
-1583
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+393
-1583
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# CHANGELOG
22

3+
## 4.1.5 - 2022-03-11
4+
- issue #262 - Different destination dir when generating using 3.2.7 VS 4.1.1 ??
5+
36
## 4.1.4 - 2022-02-12
47
- issue #265 - Use statement for InvalidArgumentException is missing when needed in ServiceType class
58

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ Developers who helped on this project are listed in the [composer.json](composer
158158
- [Hendrik Luup](https://github.com/hluup)
159159
- [Jacob Dreesen](https://github.com/jdreesen)
160160
- [Clifford Vickrey](https://github.com/cliffordvickrey)
161+
- [Arnaud POINTET](https://github.com/Oipnet)
161162

162163
## FAQ
163164

UPGRADE-4.0.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
- **The directive** `declare(strict_types=1)` is placed at top of each file ensuring that the class is well-defined and behaves as declared.
1212
- **Method** `get{PropertyName}(bool $asString = true)` becomes `get{PropertyName}(bool $asDomDocument = false)` when the property is supposed to be an XML string (`any`). Be sure to pass `true` instead of `false` if you still need to get the **[DOMDocument](https://www.php.net/manual/en/class.domdocument.php)** as returned value.
1313
- Classes **directory** is now based on the defined namespace. If the namespace was `SoapApi`:
14-
- **Before**: the `Request` Struct class was located at `src/StructType/Request.php`
15-
- **Now**: the `Request` Struct class is located at `src/SoapApi/StructType/Request.php`. So on for the `EnumType`, `ArrayType`, `ServiceType` and the `ClassMap` classes.
14+
- **Before**:
15+
- the `Request` Struct class was located at `src/StructType/Request.php`
16+
- **Now**:
17+
- the `Request` Struct class is located at `src/SoapApi/StructType/Request.php`. So on for the `EnumType`, `ArrayType`, `ServiceType` and the `ClassMap` classes.
18+
- **If this new behaviour is problematic for your current usage, the command line option [`namespace-directories`](https://github.com/WsdlToPhp/PackageGenerator/wiki/Options#namespace-directories) can be set to `false` to keep the previous behaviour**.
1619
3. **WsdlHandler** classes: they have been exported to an independent project at **[WsdlTophp/Wsdlhandler](https://github.com/WsdlToPhp/Wsdlhandler)**. It's now loaded as a composer dependency.
1720
4. The [PackageBase](https://github.com/WsdlToPhp/PackageBase) version is now >= 5.0.

composer.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@
7979
"name": "Clifford Vickrey",
8080
"email": "[email protected]",
8181
"role": "Contributor"
82+
},
83+
{
84+
"name": "Arnaud POINTET",
85+
"role": "Contributor"
8286
}
8387
],
8488
"support" : {

src/Command/GeneratePackageCommand.php

Lines changed: 42 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,12 @@ protected function configure(): void
144144
InputOption::VALUE_OPTIONAL,
145145
'Package classes\' namespace'
146146
)
147+
->addOption(
148+
'namespace-directories',
149+
null,
150+
InputOption::VALUE_OPTIONAL,
151+
'Should the directories match the namespace path or not? True by default'
152+
)
147153
->addOption(
148154
'category',
149155
null,
@@ -290,53 +296,50 @@ protected function execute(InputInterface $input, OutputInterface $output): int
290296
protected function getPackageGenerationCommandLineOptions(): array
291297
{
292298
return [
293-
'addcomments' => 'AddComments',
294-
'arrays-folder' => 'ArraysFolder',
295-
'composer-name' => 'ComposerName',
296-
'composer-settings' => 'ComposerSettings',
297-
'category' => 'Category',
298-
'destination' => 'Destination',
299-
'enums-folder' => 'EnumsFolder',
300-
'gathermethods' => 'GatherMethods',
301-
'genericconstants' => 'GenericConstantsName',
302-
'gentutorial' => 'GenerateTutorialFile',
303-
'login' => 'BasicLogin',
304-
'namespace' => 'Namespace',
305-
'password' => 'BasicPassword',
306-
'prefix' => 'Prefix',
307-
'proxy-host' => 'ProxyHost',
308-
'proxy-login' => 'ProxyLogin',
309-
'proxy-password' => 'ProxyPassword',
310-
'proxy-port' => 'ProxyPort',
311-
'services-folder' => 'ServicesFolder',
312-
'src-dirname' => 'SrcDirname',
313-
'structarray' => 'StructArrayClass',
314-
'structenum' => 'StructEnumClass',
315-
'structs-folder' => 'StructsFolder',
316-
'soapclient' => 'SoapClientClass',
317-
'struct' => 'StructClass',
318-
'standalone' => 'Standalone',
319-
'suffix' => 'Suffix',
320-
'urlorpath' => 'Origin',
321-
'validation' => 'Validation',
322-
'xsd-types-path' => 'XsdTypesPath',
299+
'addcomments' => GeneratorOptions::ADD_COMMENTS,
300+
'arrays-folder' => GeneratorOptions::ARRAYS_FOLDER,
301+
'composer-name' => GeneratorOptions::COMPOSER_NAME,
302+
'composer-settings' => GeneratorOptions::COMPOSER_SETTINGS,
303+
'category' => GeneratorOptions::CATEGORY,
304+
'destination' => GeneratorOptions::DESTINATION,
305+
'enums-folder' => GeneratorOptions::ENUMS_FOLDER,
306+
'gathermethods' => GeneratorOptions::GATHER_METHODS,
307+
'genericconstants' => GeneratorOptions::GENERIC_CONSTANTS_NAME,
308+
'gentutorial' => GeneratorOptions::GENERATE_TUTORIAL_FILE,
309+
'login' => GeneratorOptions::BASIC_LOGIN,
310+
'namespace' => GeneratorOptions::NAMESPACE_PREFIX,
311+
'namespace-directories' => GeneratorOptions::NAMESPACE_DICTATES_DIRECTORIES,
312+
'password' => GeneratorOptions::BASIC_PASSWORD,
313+
'prefix' => GeneratorOptions::PREFIX,
314+
'proxy-host' => GeneratorOptions::PROXY_HOST,
315+
'proxy-login' => GeneratorOptions::PROXY_LOGIN,
316+
'proxy-password' => GeneratorOptions::PROXY_PASSWORD,
317+
'proxy-port' => GeneratorOptions::PROXY_PORT,
318+
'services-folder' => GeneratorOptions::SERVICES_FOLDER,
319+
'src-dirname' => GeneratorOptions::SRC_DIRNAME,
320+
'structarray' => GeneratorOptions::STRUCT_ARRAY_CLASS,
321+
'structenum' => GeneratorOptions::STRUCT_ENUM_CLASS,
322+
'structs-folder' => GeneratorOptions::STRUCTS_FOLDER,
323+
'soapclient' => GeneratorOptions::SOAP_CLIENT_CLASS,
324+
'struct' => GeneratorOptions::STRUCT_CLASS,
325+
'standalone' => GeneratorOptions::STANDALONE,
326+
'suffix' => GeneratorOptions::SUFFIX,
327+
'urlorpath' => GeneratorOptions::ORIGIN,
328+
'validation' => GeneratorOptions::VALIDATION,
329+
'xsd-types-path' => GeneratorOptions::XSD_TYPES_PATH,
323330
];
324331
}
325332

326333
protected function initGeneratorOptions(): self
327334
{
335+
/** @var GeneratorOptions $generatorOptions */
328336
$generatorOptions = GeneratorOptions::instance($this->resolveGeneratorOptionsConfigPath());
329337

330-
foreach ($this->getPackageGenerationCommandLineOptions() as $optionName => $optionMethod) {
331-
$optionValue = $this->formatOptionValue($this->input->getOption($optionName));
332-
if (null !== $optionValue) {
333-
call_user_func_array([
334-
$generatorOptions,
335-
sprintf('set%s', $optionMethod),
336-
], [
337-
$optionValue,
338-
]);
338+
foreach ($this->getPackageGenerationCommandLineOptions() as $optionName => $generatorOptionName) {
339+
if (is_null($optionValue = $this->formatOptionValue($this->input->getOption($optionName)))) {
340+
continue;
339341
}
342+
$generatorOptions->setOptionValue($generatorOptionName, $optionValue);
340343
}
341344
$this->generatorOptions = $generatorOptions;
342345

0 commit comments

Comments
 (0)