Skip to content

Commit 3bed36c

Browse files
committed
Merge branch 'release/1.0.0rc01'
2 parents ebfc87d + 1b4e3a8 commit 3bed36c

File tree

195 files changed

+50307
-4619
lines changed

Some content is hidden

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

195 files changed

+50307
-4619
lines changed

.php_cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
$finder = Symfony\CS\Finder\DefaultFinder::create()
4+
->exclude('vendor')
5+
->exclude('Tests/resources')
6+
->in(__DIR__);
7+
8+
return Symfony\CS\Config\Config::create()
9+
->level(Symfony\CS\FixerInterface::PSR2_LEVEL)
10+
->finder($finder);

.travis.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,11 @@ before_install:
1212
- composer self-update
1313

1414
install:
15-
- composer install
15+
- composer install --no-dev
16+
17+
script:
18+
- phpunit --coverage-text --coverage-clover=coverage.clover
19+
20+
after_script:
21+
- wget https://scrutinizer-ci.com/ocular.phar
22+
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover

CASES.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Test case examples. This list is not exhaustive nor perfect, it has been gathered in the time and can be used as a starting point.
22

3-
- "Full" documentation (functions, structs, enumerations, values) with "virual" structs inheritance documentation :
3+
- "Full" documentation (functions, structs, enumerations, values) with "virtual" structs inheritance documentation :
44
- http://developer.ebay.com/webservices/latest/ebaySvc.wsdl
55
- https://www.paypalobjects.com/wsdl/PayPalSvc.wsdl
66
- http://queue.amazonaws.com/doc/2012-11-05/QueueService.wsdl
@@ -15,6 +15,7 @@ Test case examples. This list is not exhaustive nor perfect, it has been gathere
1515
- http://api.fromdoppler.com/Default.asmx?WSDL
1616
- https://webapi.aukro.cz/uploader.php?wsdl
1717
- https://www.paypalobjects.com/wsdl/PayPalSvc.wsdl
18+
- https://api5.successfactors.eu/sfapi/v1/soap12?wsdl
1819

1920
- Simple function parameter (not a struct) :
2021
- http://traveltek-importer.planetcruiseluxury.co.uk/region.wsdl

CHANGELOG.md

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,46 @@
11
CHANGELOG
22
=========
33

4+
1.0.0RC01
5+
---------
6+
- First major release candidate version
7+
- Deep refactoring of all old original classes
8+
- Performance optimizations
9+
- Usage of [PhpGenerator](https://github.com/WsdlToPhp/PhpGenerator) package for any generated PHP file
10+
- Namespace support
11+
- Composer usage for
12+
- Externalization of main classes from which any Struct/Array/Service generated class
13+
- auto-generation sample.php file renamed to tutorial.php
14+
- Usage of [PackageBase](https://github.com/WsdlToPhp/PackageBase) package
15+
- Enhancements and consolidations on generated Struct classes:
16+
- Fluidity
17+
- Less annotations
18+
- Properties are all well retrieved
19+
- Options removal for simplifications:
20+
- SendArrayAsParameter,
21+
- SendParametersAsArray,
22+
- GenerateAutoload,
23+
- GenerateWsdlClass,
24+
- SubCategory,
25+
- InheritsClassIdentifier
26+
427
0.0.5
528
-----
6-
# Fix unit tests according to previous changes
29+
- Fix unit tests according to previous changes
730

831
0.0.4
932
-----
10-
#9 - Leading zero not taken into account in enumeration classes
11-
#10 - --wsdl-genautoload=false also controls creation of sample.php file (console mode)
33+
- issue #9 - Leading zero not taken into account in enumeration classes
34+
- 10 - --wsdl-genautoload=false also controls creation of sample.php file (console mode)
1235

1336
0.0.3
1437
-----
15-
#7 - PHP warning on str_repeat()
38+
- 7 - PHP warning on str_repeat()
1639

1740
0.0.2
1841
-----
19-
Create tag with correct composer.json file
42+
- Create tag with correct composer.json file
2043

2144
0.0.1
2245
-----
23-
Initial version created from original project WsdlToPhp.
46+
- Initial version created from original project WsdlToPhp.

Command/AbstractCommand.php

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,25 @@
99

1010
abstract class AbstractCommand extends Command
1111
{
12-
const
13-
EXIT_OK = 1,
14-
EXIT_NOT_OK = 0;
15-
16-
protected
17-
$input,
18-
$output;
19-
12+
/**
13+
* @var int
14+
*/
15+
const EXIT_OK = 1;
16+
/**
17+
* @var int
18+
*/
19+
const EXIT_NOT_OK = 0;
20+
/**
21+
* @var InputInterface
22+
*/
23+
protected $input;
24+
/**
25+
* @var OutputInterface
26+
*/
27+
protected $output;
28+
/**
29+
* @see \Symfony\Component\Console\Command\Command::configure()
30+
*/
2031
protected function configure()
2132
{
2233
$this
@@ -27,19 +38,26 @@ protected function configure()
2738
'If true, then package is really generated otherwise debug informations are displayed'
2839
);
2940
}
30-
41+
/**
42+
* @see \Symfony\Component\Console\Command\Command::execute()
43+
*/
3144
protected function execute(InputInterface $input, OutputInterface $output)
3245
{
3346
$this->input = $input;
3447
$this->output = $output;
3548
return self::EXIT_OK;
3649
}
37-
50+
/**
51+
* @return bool
52+
*/
3853
protected function canExecute()
3954
{
4055
return (bool)$this->input->getOption('force') === true;
4156
}
42-
57+
/**
58+
* @param string|array $messages
59+
* @param int $type
60+
*/
4361
protected function writeLn($messages, $type = OutputInterface::OUTPUT_NORMAL)
4462
{
4563
$this->output->writeln($messages, $type);

Command/GeneratePackageCommand.php

Lines changed: 21 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,13 @@ class GeneratePackageCommand extends AbstractCommand
1313
* @var Generator
1414
*/
1515
protected $generator;
16-
1716
/**
1817
* @return Generator
1918
*/
2019
public function getGenerator()
2120
{
2221
return $this->generator;
2322
}
24-
2523
/**
2624
* @param Generator $generator
2725
* @return GeneratePackageCommand
@@ -31,7 +29,6 @@ protected function setGenerator(Generator $generator)
3129
$this->generator = $generator;
3230
return $this;
3331
}
34-
3532
/**
3633
* @param string $wsdlUrl
3734
* @param string $wsdlLogin
@@ -41,9 +38,8 @@ protected function setGenerator(Generator $generator)
4138
*/
4239
protected function getInstanceOfGenerator($wsdlUrl, $wsdlLogin = null, $wsdlPassword = null, array $wsdlOptions = array())
4340
{
44-
return Generator::instance($wsdlUrl, $wsdlLogin, $wsdlPassword, $wsdlOptions);
41+
return new Generator($wsdlUrl, $wsdlLogin, $wsdlPassword, $wsdlOptions);
4542
}
46-
4743
/**
4844
* @see \WsdlToPhp\PackageGenerator\Command\AbstractCommand::configure()
4945
*/
@@ -64,19 +60,12 @@ protected function configure()
6460
->addOption('wsdl-prefix', null, InputOption::VALUE_REQUIRED, 'Prepend generated classes')
6561
->addOption('wsdl-namespace', null, InputOption::VALUE_OPTIONAL, 'Package classes\' namespace')
6662
->addOption('wsdl-category', null, InputOption::VALUE_OPTIONAL, 'First level directory name generation mode (start, end, cat, none)')
67-
->addOption('wsdl-subcategory', null, InputOption::VALUE_OPTIONAL, 'Second level directory name generation mode (start, end, none), disabled if category=cat')
6863
->addOption('wsdl-gathermethods', null, InputOption::VALUE_OPTIONAL, 'Gather methods based on operation name mode (start, end)')
69-
->addOption('wsdl-genwsdlclass', null, InputOption::VALUE_OPTIONAL, 'Enable/Disable main Wsdl class generation, you should always enable this option')
7064
->addOption('wsdl-gentutorial', null, InputOption::VALUE_OPTIONAL, 'Enable/Disable tutorial file, you should enable this option only on dev')
71-
->addOption('wsdl-genautoload', null, InputOption::VALUE_OPTIONAL, 'Enable/Disable autoload file generation, this is useless if you use composer or your own autoloader')
72-
->addOption('wsdl-sendarrayparam', null, InputOption::VALUE_OPTIONAL, 'Enable/Disable usage of an array to send the parameters, can be disabled as it will soon removed')
7365
->addOption('wsdl-genericconstants', null, InputOption::VALUE_OPTIONAL, 'Enable/Disable usage of generic constants name (ex : ENUM_VALUE_0, ENUM_VALUE_1, etc) or contextual values (ex : VALUE_STRING, VALUE_YES, VALUES_NO, etc)')
74-
->addOption('wsdl-reponseasobj', null, InputOption::VALUE_OPTIONAL, 'Enable/Disable usage of object to encapsulate Web Service response')
75-
->addOption('wsdl-inherits', null, InputOption::VALUE_OPTIONAL, 'Astracts struct base name to identify abtract structs, can be avoided as it will be soon removed')
76-
->addOption('wsdl-paramsasarray', null, InputOption::VALUE_OPTIONAL, 'Enable/Disable usage of a \'parameters\' parameter in an array to contain request parameters, disabled in most cases')
77-
->addOption('wsdl-addcomments', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'Set comments to be used within each generated file');
66+
->addOption('wsdl-addcomments', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'Set comments to be used within each generated file')
67+
->addOption('wsdl-standalone', null, InputOption::VALUE_OPTIONAL, 'By default, the generated package can be used as a standalone. Otherwise, you must add wsdltophp/packagebase:dev-master to your main composer.json.');
7868
}
79-
8069
/**
8170
* @see \Sdc\AppBundle\Command\Command::execute()
8271
*/
@@ -86,12 +75,12 @@ protected function execute(InputInterface $input, OutputInterface $output)
8675
$start = new \DateTime();
8776
$this->writeLn(sprintf(" Start at %s", $start->format('Y-m-d H:i:s')));
8877

89-
$wsdlUrl = $this->input->getOption('wsdl-urlorpath');
90-
$wsdlLogin = $this->input->getOption('wsdl-login');
91-
$wsdlPassword = $this->input->getOption('wsdl-password');
92-
$packageName = $this->input->getOption('wsdl-prefix');
78+
$wsdlUrl = $this->input->getOption('wsdl-urlorpath');
79+
$wsdlLogin = $this->input->getOption('wsdl-login');
80+
$wsdlPassword = $this->input->getOption('wsdl-password');
81+
$packageName = $this->input->getOption('wsdl-prefix');
9382
$packageDestination = $this->input->getOption('wsdl-destination');
94-
$wsdlOptions = $this->defineWsdlOptions();
83+
$wsdlOptions = $this->defineWsdlOptions();
9584

9685
$this->setGenerator($this->getInstanceOfGenerator($wsdlUrl, $wsdlLogin, $wsdlPassword, $wsdlOptions));
9786

@@ -103,9 +92,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
10392
$this->writeLn(" Generation not launched, use --force to force generation");
10493
$this->writeLn(" Wsdl used:");
10594
$this->writeLn(" " . implode(PHP_EOL . ' ', $this->formatArrayForConsole(array(
106-
'url' => $wsdlUrl,
107-
'login' => $wsdlLogin,
108-
'password' => $wsdlPassword,
95+
'url' => $wsdlUrl,
96+
'login' => $wsdlLogin,
97+
'password' => $wsdlPassword,
10998
'Package name' => $packageName,
11099
'Package dest' => $packageDestination,
111100
))));
@@ -118,17 +107,16 @@ protected function execute(InputInterface $input, OutputInterface $output)
118107
$end = new \DateTime();
119108
$this->writeLn(sprintf(" End at %s, duration: %s", $end->format('Y-m-d H:i:s'), $start->diff($end)->format('%H:%I:%S')));
120109
}
121-
122110
/**
123111
* @return array
124112
*/
125113
protected function defineWsdlOptions()
126114
{
127-
$options = array();
128-
$wsdlProxyHost = $this->input->getOption('wsdl-proxy-host');
129-
$wsdlProxyPort = $this->input->getOption('wsdl-proxy-port');
115+
$options = array();
116+
$wsdlProxyHost = $this->input->getOption('wsdl-proxy-host');
117+
$wsdlProxyPort = $this->input->getOption('wsdl-proxy-port');
130118
$wsdlProxyLogin = $this->input->getOption('wsdl-proxy-login');
131-
$wsdlProxyPass = $this->input->getOption('wsdl-proxy-password');
119+
$wsdlProxyPass = $this->input->getOption('wsdl-proxy-password');
132120

133121
if (!empty($wsdlProxyHost)) {
134122
$options['proxy_host'] = $wsdlProxyHost;
@@ -145,29 +133,21 @@ protected function defineWsdlOptions()
145133

146134
return $options;
147135
}
148-
149136
/**
150137
* @return array
151138
*/
152139
protected function getPackageGenerationCommandLineOptions()
153140
{
154141
return array(
155-
'wsdl-namespace' => 'Namespace',
156-
'wsdl-category' => 'Category',
157-
'wsdl-subcategory' => 'SubCategory',
158-
'wsdl-gathermethods' => 'GatherMethods',
159-
'wsdl-genwsdlclass' => 'GenerateWsdlClassFile',
160-
'wsdl-gentutorial' => 'GenerateTutorialFile',
161-
'wsdl-genautoload' => 'GenerateAutoloadFile',
162-
'wsdl-sendarrayparam' => 'SendArrayAsParameter',
142+
'wsdl-namespace' => 'NamespacePrefix',
143+
'wsdl-category' => 'Category',
144+
'wsdl-gathermethods' => 'GatherMethods',
145+
'wsdl-gentutorial' => 'GenerateTutorialFile',
163146
'wsdl-genericconstants' => 'GenericConstantsNames',
164-
'wsdl-reponseasobj' => 'GetResponseAsWsdlObject',
165-
'wsdl-inherits' => 'InheritsClassIdentifier',
166-
'wsdl-paramsasarray' => 'SendParametersAsArray',
167-
'wsdl-addcomments' => 'AddComments',
147+
'wsdl-addcomments' => 'AddComments',
148+
'wsdl-standalone' => 'Standalone',
168149
);
169150
}
170-
171151
/**
172152
* @return array
173153
*/
@@ -193,7 +173,6 @@ protected function definePackageGenerationOptions()
193173
}
194174
return $options;
195175
}
196-
197176
/**
198177
* @param mixed $optionValue
199178
* @return boolean|mixed

ConfigurationReader/AbstractYamlReader.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,10 @@ public static function instance($filename = null)
3838
if (empty($filename) || !is_file($filename)) {
3939
throw new \InvalidArgumentException(sprintf('Unable to locate file "%s"', $filename));
4040
}
41-
4241
$key = sprintf('%s_%s', get_called_class(), $filename);
4342
if (!isset(self::$instances[$key])) {
4443
self::$instances[$key] = new static($filename);
4544
}
46-
4745
return self::$instances[$key];
4846
}
4947
}

0 commit comments

Comments
 (0)