This repository has been archived by the owner on Jan 31, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'ZendSoap' of https://github.com/beberlei/zf2 into featu…
…re/soap-autodiscover-refactor
- Loading branch information
30 parents
bb42677
+
02419fd
+
cf6df36
+
92345be
+
737b39e
+
fde18af
+
43ca092
+
e3acc17
+
b5bc61a
+
30d69f9
+
7dbd12c
+
9f45cc7
+
473bfa3
+
916cd80
+
5aac7b0
+
6f66646
+
12c90a3
+
435c161
+
9bb6b33
+
6c32cce
+
f3c637f
+
c54876c
+
e1d13eb
+
daa8e6c
+
5570955
+
388a6c0
+
ac33840
+
00e233b
+
532572e
+
9eb6d85
commit b636e56
Showing
20 changed files
with
652 additions
and
681 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<?php | ||
/** | ||
* Zend Framework | ||
* | ||
* LICENSE | ||
* | ||
* This source file is subject to the new BSD license that is bundled | ||
* with this package in the file LICENSE.txt. | ||
* It is also available through the world-wide-web at this URL: | ||
* http://framework.zend.com/license/new-bsd | ||
* If you did not receive a copy of the license and are unable to | ||
* obtain it through the world-wide-web, please send an email | ||
* to license@zend.com so we can send you a copy immediately. | ||
* | ||
* @category Zend | ||
* @package Zend_Soap | ||
* @subpackage WSDL | ||
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
*/ | ||
|
||
/** | ||
* @namespace | ||
*/ | ||
namespace Zend\Soap\AutoDiscover; | ||
|
||
use Zend\Server\Reflection\AbstractFunction, | ||
Zend\Server\Reflection\Prototype, | ||
Zend\Server\Reflection\ReflectionParameter; | ||
|
||
/** | ||
* Describes how types, return values and method details are detected during AutoDiscovery of a WSDL. | ||
* | ||
* @category Zend | ||
* @package Zend_Soap | ||
* @subpackage WSDL | ||
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
*/ | ||
interface DiscoveryStrategy | ||
{ | ||
/** | ||
* Get the function parameters php type. | ||
* | ||
* Default implementation assumes the default param doc-block tag. | ||
* | ||
* @param ReflectionParameter $param | ||
* @return string | ||
*/ | ||
public function getFunctionParameterType(ReflectionParameter $param); | ||
|
||
/** | ||
* Get the functions return php type. | ||
* | ||
* Default implementation assumes the value of the return doc-block tag. | ||
* | ||
* @param AbstractFunction $function | ||
* @param Prototype $prototype | ||
* @return string | ||
*/ | ||
public function getFunctionReturnType(AbstractFunction $function, Prototype $prototype); | ||
|
||
/** | ||
* Detect if the function is a one-way or two-way operation. | ||
* | ||
* Default implementation assumes one-way, when return value is "void". | ||
* | ||
* @param AbstractFunction $function | ||
* @param Prototype $prototype | ||
* @return bool | ||
*/ | ||
public function isFunctionOneWay(AbstractFunction $function, Prototype $prototype); | ||
|
||
/** | ||
* Detect the functions documentation. | ||
* | ||
* Default implementation uses docblock description. | ||
* | ||
* @param AbstractFunction $function | ||
* @return string | ||
*/ | ||
public function getFunctionDocumentation(AbstractFunction $function); | ||
} |
63 changes: 63 additions & 0 deletions
63
src/AutoDiscover/DiscoveryStrategy/ReflectionDiscovery.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?php | ||
/** | ||
* Zend Framework | ||
* | ||
* LICENSE | ||
* | ||
* This source file is subject to the new BSD license that is bundled | ||
* with this package in the file LICENSE.txt. | ||
* It is also available through the world-wide-web at this URL: | ||
* http://framework.zend.com/license/new-bsd | ||
* If you did not receive a copy of the license and are unable to | ||
* obtain it through the world-wide-web, please send an email | ||
* to license@zend.com so we can send you a copy immediately. | ||
* | ||
* @category Zend | ||
* @package Zend_Soap | ||
* @subpackage WSDL | ||
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
*/ | ||
|
||
/** | ||
* @namespace | ||
*/ | ||
namespace Zend\Soap\AutoDiscover\DiscoveryStrategy; | ||
|
||
use Zend\Soap\AutoDiscover\DiscoveryStrategy, | ||
Zend\Server\Reflection\AbstractFunction, | ||
Zend\Server\Reflection\Prototype, | ||
Zend\Server\Reflection\ReflectionParameter; | ||
|
||
/** | ||
* Describes how types, return values and method details are detected during AutoDiscovery of a WSDL. | ||
* | ||
* @category Zend | ||
* @package Zend_Soap | ||
* @subpackage WSDL | ||
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
*/ | ||
|
||
class ReflectionDiscovery implements DiscoveryStrategy | ||
{ | ||
public function getFunctionDocumentation(AbstractFunction $function) | ||
{ | ||
return $function->getDescription(); | ||
} | ||
|
||
public function getFunctionParameterType(ReflectionParameter $param) | ||
{ | ||
return $param->getType(); | ||
} | ||
|
||
public function getFunctionReturnType(AbstractFunction $function, Prototype $prototype) | ||
{ | ||
return $prototype->getReturnType(); | ||
} | ||
|
||
public function isFunctionOneWay(AbstractFunction $function, Prototype $prototype) | ||
{ | ||
return $prototype->getReturnType() == 'void'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.