-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from Ricorocks-Digital-Agency/headers
Headers
- Loading branch information
Showing
16 changed files
with
572 additions
and
74 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?php | ||
|
||
namespace RicorocksDigitalAgency\Soap; | ||
|
||
use Illuminate\Contracts\Support\Arrayable; | ||
|
||
class Header implements Arrayable | ||
{ | ||
public $name; | ||
public $namespace; | ||
public $data; | ||
public $actor; | ||
public $mustUnderstand; | ||
|
||
public function __construct(?string $name = null, ?string $namespace = null, $data = null, bool $mustUnderstand = false, ?string $actor = null) | ||
{ | ||
$this->name = $name; | ||
$this->namespace = $namespace; | ||
$this->data = $data; | ||
$this->mustUnderstand = $mustUnderstand; | ||
$this->actor = $actor; | ||
} | ||
|
||
public function name(string $name): self | ||
{ | ||
return tap($this, fn () => $this->name = $name); | ||
} | ||
|
||
public function namespace(string $namespace): self | ||
{ | ||
return tap($this, fn () => $this->namespace = $namespace); | ||
} | ||
|
||
public function data($data = null): self | ||
{ | ||
return tap($this, fn () => $this->data = $data); | ||
} | ||
|
||
public function actor(?string $actor = null): self | ||
{ | ||
return tap($this, fn () => $this->actor = $actor); | ||
} | ||
|
||
public function mustUnderstand(bool $mustUnderstand = true): self | ||
{ | ||
return tap($this, fn () => $this->mustUnderstand = $mustUnderstand); | ||
} | ||
|
||
public function toArray() | ||
{ | ||
return [ | ||
'name' => $this->name, | ||
'namespace' => $this->namespace, | ||
'data' => $this->data, | ||
'mustUnderstand' => $this->mustUnderstand, | ||
'actor' => $this->actor, | ||
]; | ||
} | ||
} |
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,20 @@ | ||
<?php | ||
|
||
namespace RicorocksDigitalAgency\Soap; | ||
|
||
use RicorocksDigitalAgency\Soap\Support\Scoped; | ||
|
||
class HeaderSet extends Scoped | ||
{ | ||
protected $headers; | ||
|
||
public function __construct(Header ...$headers) | ||
{ | ||
$this->headers = $headers; | ||
} | ||
|
||
public function getHeaders() | ||
{ | ||
return $this->headers; | ||
} | ||
} |
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.