Skip to content
Browse files

add phpdoc and configuration of soap attachments

  • Loading branch information...
1 parent 40a3bd5 commit 31838105f052e576827e9ec0fee7f7062dd4361c @aschamberger aschamberger committed Apr 21, 2012
Showing with 54 additions and 5 deletions.
  1. +54 −5 src/BeSimple/SoapServer/SoapServerBuilder.php
View
59 src/BeSimple/SoapServer/SoapServerBuilder.php
@@ -13,6 +13,7 @@
namespace BeSimple\SoapServer;
use BeSimple\SoapCommon\AbstractSoapBuilder;
+use BeSimple\SoapCommon\Helper;
/**
* SoapServerBuilder provides a fluent interface to configure and create a SoapServer instance.
@@ -28,13 +29,14 @@ class SoapServerBuilder extends AbstractSoapBuilder
protected $handlerObject;
/**
- * @return SoapServerBuilder
+ * Create new instance with default options.
+ *
+ * @return \BeSimple\SoapServer\SoapServerBuilder
*/
static public function createWithDefaults()
{
return parent::createWithDefaults()
- ->withErrorReporting(false)
- ;
+ ->withErrorReporting(false);
}
/**
@@ -48,6 +50,11 @@ public function __construct()
$this->withErrorReporting(false);
}
+ /**
+ * Finally returns a SoapClient instance.
+ *
+ * @return \BeSimple\SoapServer\SoapServer
+ */
public function build()
{
$this->validateOptions();
@@ -69,13 +76,25 @@ public function build()
return $server;
}
+ /**
+ * Cofigures the SOAP actor.
+ *
+ * @param string $actor Actor name
+ *
+ * @return \BeSimple\SoapServer\SoapServerBuilder
+ */
public function withActor($actor)
{
$this->options['actor'] = $actor;
return $this;
}
+ /**
+ * Enables persistence.
+ *
+ * @return \BeSimple\SoapServer\SoapServerBuilder
+ */
public function withPersistanceRequest()
{
$this->persistence = SOAP_PERSISTENCE_REQUEST;
@@ -85,6 +104,8 @@ public function withPersistanceRequest()
/**
* Enables the HTTP session. The handler object is persisted between multiple requests in a session.
+ *
+ * @return \BeSimple\SoapServer\SoapServerBuilder
*/
public function withPersistenceSession()
{
@@ -96,7 +117,9 @@ public function withPersistenceSession()
/**
* Enables reporting of internal errors to clients. This should only be enabled in development environments.
*
- * @param boolean $enable
+ * @param boolean $enable Enable error reporting
+ *
+ * @return \BeSimple\SoapServer\SoapServerBuilder
*/
public function withErrorReporting($enable = true)
{
@@ -105,25 +128,48 @@ public function withErrorReporting($enable = true)
return $this;
}
+ /**
+ * SOAP attachment type Base64.
+ *
+ * @return \BeSimple\SoapServer\SoapServerBuilder
+ */
public function withBase64Attachments()
{
+ $this->options['attachment_type'] = Helper::ATTACHMENTS_TYPE_BASE64;
+
return $this;
}
+ /**
+ * SOAP attachment type SwA.
+ *
+ * @return \BeSimple\SoapServer\SoapServerBuilder
+ */
public function withSwaAttachments()
{
+ $this->options['attachment_type'] = Helper::ATTACHMENTS_TYPE_SWA;
+
return $this;
}
+ /**
+ * SOAP attachment type MTOM.
+ *
+ * @return \BeSimple\SoapServer\SoapServerBuilder
+ */
public function withMtomAttachments()
{
+ $this->options['attachment_type'] = Helper::ATTACHMENTS_TYPE_MTOM;
+
return $this;
}
/**
+ * Configures the handler class or object.
+ *
* @param mixed $handler Can be either a class name or an object.
*
- * @return SoapServerBuilder
+ * @return \BeSimple\SoapServer\SoapServerBuilder
*/
public function withHandler($handler)
{
@@ -140,6 +186,9 @@ public function withHandler($handler)
return $this;
}
+ /**
+ * Validate options.
+ */
protected function validateOptions()
{
$this->validateWsdl();

0 comments on commit 3183810

Please sign in to comment.
Something went wrong with that request. Please try again.