Skip to content

Commit

Permalink
Merge branch 'release/4.1.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaelcom committed Mar 11, 2022
2 parents 870a576 + 9fa932c commit 334d921
Show file tree
Hide file tree
Showing 57 changed files with 393 additions and 1,583 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# CHANGELOG

## 4.1.5 - 2022-03-11
- issue #262 - Different destination dir when generating using 3.2.7 VS 4.1.1 ??

## 4.1.4 - 2022-02-12
- issue #265 - Use statement for InvalidArgumentException is missing when needed in ServiceType class

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ Developers who helped on this project are listed in the [composer.json](composer
- [Hendrik Luup](https://github.com/hluup)
- [Jacob Dreesen](https://github.com/jdreesen)
- [Clifford Vickrey](https://github.com/cliffordvickrey)
- [Arnaud POINTET](https://github.com/Oipnet)

## FAQ

Expand Down
7 changes: 5 additions & 2 deletions UPGRADE-4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
- **The directive** `declare(strict_types=1)` is placed at top of each file ensuring that the class is well-defined and behaves as declared.
- **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.
- Classes **directory** is now based on the defined namespace. If the namespace was `SoapApi`:
- **Before**: the `Request` Struct class was located at `src/StructType/Request.php`
- **Now**: the `Request` Struct class is located at `src/SoapApi/StructType/Request.php`. So on for the `EnumType`, `ArrayType`, `ServiceType` and the `ClassMap` classes.
- **Before**:
- the `Request` Struct class was located at `src/StructType/Request.php`
- **Now**:
- the `Request` Struct class is located at `src/SoapApi/StructType/Request.php`. So on for the `EnumType`, `ArrayType`, `ServiceType` and the `ClassMap` classes.
- **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**.
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.
4. The [PackageBase](https://github.com/WsdlToPhp/PackageBase) version is now >= 5.0.
4 changes: 4 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@
"name": "Clifford Vickrey",
"email": "[email protected]",
"role": "Contributor"
},
{
"name": "Arnaud POINTET",
"role": "Contributor"
}
],
"support" : {
Expand Down
81 changes: 42 additions & 39 deletions src/Command/GeneratePackageCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ protected function configure(): void
InputOption::VALUE_OPTIONAL,
'Package classes\' namespace'
)
->addOption(
'namespace-directories',
null,
InputOption::VALUE_OPTIONAL,
'Should the directories match the namespace path or not? True by default'
)
->addOption(
'category',
null,
Expand Down Expand Up @@ -290,53 +296,50 @@ protected function execute(InputInterface $input, OutputInterface $output): int
protected function getPackageGenerationCommandLineOptions(): array
{
return [
'addcomments' => 'AddComments',
'arrays-folder' => 'ArraysFolder',
'composer-name' => 'ComposerName',
'composer-settings' => 'ComposerSettings',
'category' => 'Category',
'destination' => 'Destination',
'enums-folder' => 'EnumsFolder',
'gathermethods' => 'GatherMethods',
'genericconstants' => 'GenericConstantsName',
'gentutorial' => 'GenerateTutorialFile',
'login' => 'BasicLogin',
'namespace' => 'Namespace',
'password' => 'BasicPassword',
'prefix' => 'Prefix',
'proxy-host' => 'ProxyHost',
'proxy-login' => 'ProxyLogin',
'proxy-password' => 'ProxyPassword',
'proxy-port' => 'ProxyPort',
'services-folder' => 'ServicesFolder',
'src-dirname' => 'SrcDirname',
'structarray' => 'StructArrayClass',
'structenum' => 'StructEnumClass',
'structs-folder' => 'StructsFolder',
'soapclient' => 'SoapClientClass',
'struct' => 'StructClass',
'standalone' => 'Standalone',
'suffix' => 'Suffix',
'urlorpath' => 'Origin',
'validation' => 'Validation',
'xsd-types-path' => 'XsdTypesPath',
'addcomments' => GeneratorOptions::ADD_COMMENTS,
'arrays-folder' => GeneratorOptions::ARRAYS_FOLDER,
'composer-name' => GeneratorOptions::COMPOSER_NAME,
'composer-settings' => GeneratorOptions::COMPOSER_SETTINGS,
'category' => GeneratorOptions::CATEGORY,
'destination' => GeneratorOptions::DESTINATION,
'enums-folder' => GeneratorOptions::ENUMS_FOLDER,
'gathermethods' => GeneratorOptions::GATHER_METHODS,
'genericconstants' => GeneratorOptions::GENERIC_CONSTANTS_NAME,
'gentutorial' => GeneratorOptions::GENERATE_TUTORIAL_FILE,
'login' => GeneratorOptions::BASIC_LOGIN,
'namespace' => GeneratorOptions::NAMESPACE_PREFIX,
'namespace-directories' => GeneratorOptions::NAMESPACE_DICTATES_DIRECTORIES,
'password' => GeneratorOptions::BASIC_PASSWORD,
'prefix' => GeneratorOptions::PREFIX,
'proxy-host' => GeneratorOptions::PROXY_HOST,
'proxy-login' => GeneratorOptions::PROXY_LOGIN,
'proxy-password' => GeneratorOptions::PROXY_PASSWORD,
'proxy-port' => GeneratorOptions::PROXY_PORT,
'services-folder' => GeneratorOptions::SERVICES_FOLDER,
'src-dirname' => GeneratorOptions::SRC_DIRNAME,
'structarray' => GeneratorOptions::STRUCT_ARRAY_CLASS,
'structenum' => GeneratorOptions::STRUCT_ENUM_CLASS,
'structs-folder' => GeneratorOptions::STRUCTS_FOLDER,
'soapclient' => GeneratorOptions::SOAP_CLIENT_CLASS,
'struct' => GeneratorOptions::STRUCT_CLASS,
'standalone' => GeneratorOptions::STANDALONE,
'suffix' => GeneratorOptions::SUFFIX,
'urlorpath' => GeneratorOptions::ORIGIN,
'validation' => GeneratorOptions::VALIDATION,
'xsd-types-path' => GeneratorOptions::XSD_TYPES_PATH,
];
}

protected function initGeneratorOptions(): self
{
/** @var GeneratorOptions $generatorOptions */
$generatorOptions = GeneratorOptions::instance($this->resolveGeneratorOptionsConfigPath());

foreach ($this->getPackageGenerationCommandLineOptions() as $optionName => $optionMethod) {
$optionValue = $this->formatOptionValue($this->input->getOption($optionName));
if (null !== $optionValue) {
call_user_func_array([
$generatorOptions,
sprintf('set%s', $optionMethod),
], [
$optionValue,
]);
foreach ($this->getPackageGenerationCommandLineOptions() as $optionName => $generatorOptionName) {
if (is_null($optionValue = $this->formatOptionValue($this->input->getOption($optionName)))) {
continue;
}
$generatorOptions->setOptionValue($generatorOptionName, $optionValue);
}
$this->generatorOptions = $generatorOptions;

Expand Down
Loading

0 comments on commit 334d921

Please sign in to comment.