Skip to content

Commit

Permalink
Nullable lists (#114)
Browse files Browse the repository at this point in the history
* Fix return type for getElementById, closes #65

* Update PHPDoc to include inherited changes

* Rename function for removing template attributes

* Set value for certain input fields differently

* Bind list to document fragment for efficiency
for #77

* Remove unbindable check

* Allow returning any iterable, not just array - fixes #88

* Test that multiple kvps can be bound within the same parameter

* Treat nullable iterable as empty list

* Update dependencies
  • Loading branch information
g105b committed Nov 28, 2019
1 parent 7468beb commit a36aa7e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
14 changes: 7 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions src/Bindable.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function bindData(
* @see self::bindNestedList
*/
public function bindList(
iterable $kvpList,
?iterable $kvpList,
string $templateName = null
):int {
if(empty($kvpList)) {
Expand Down Expand Up @@ -142,9 +142,13 @@ public function bindList(
}

public function bindNestedList(
iterable $nestedKvpList,
?iterable $nestedKvpList,
bool $requireMatchingTemplatePath = false
):int {
if(empty($nestedKvpList)) {
return 0;
}

/** @var BaseElement $element */
$element = $this;
if($element instanceof HTMLDocument) {
Expand Down

0 comments on commit a36aa7e

Please sign in to comment.