Skip to content

Commit

Permalink
Add more type declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
theseer committed Nov 24, 2017
1 parent 740cedb commit 6f3378f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/viewmodel/ViewModelRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ private function processArray(DOMElement $context, $model): DOMDocumentFragment
* @return DOMElement
* @throws ViewModelRendererException
*/
private function processArrayEntry(DOMElement $context, $entry, $pos): DOMElement {
private function processArrayEntry(DOMElement $context, $entry, int $pos): DOMElement {
$workContext = $this->selectMatchingWorkContext($context, $entry);
/** @var DOMElement $clone */
$this->stack[] = $entry;
Expand Down Expand Up @@ -327,7 +327,7 @@ private function processAttribute(DOMAttr $attribute, $model) {
*
* @throws ViewModelRendererException
*/
private function ensureIsObject($model, $property) {
private function ensureIsObject($model, string $property) {
if (!is_object($model)) {
throw new ViewModelRendererException(
sprintf(
Expand Down Expand Up @@ -394,7 +394,6 @@ private function selectMatchingWorkContext(DOMElement $context, $entry): DOMElem
*
* @return DOMElement
*
* @throws SnapshotDOMNodelistException
*/
private function moveToContainer(DOMElement $context): DOMElement {
$container = $context->ownerDocument->createElement('container');
Expand All @@ -409,7 +408,7 @@ private function moveToContainer(DOMElement $context): DOMElement {
$stackList = end($this->listStack);
foreach($list as $node) {
$container->appendChild($node);
if ($stackList instanceof SnapshotDOMNodelist && $stackList->hasNode($node)) {
if (($stackList instanceof SnapshotDOMNodelist) && $stackList->hasNode($node)) {
$stackList->removeNode($node);
}
}
Expand Down

0 comments on commit 6f3378f

Please sign in to comment.