Skip to content

Commit

Permalink
Move responsibility of select's value attribute to PhpGt/Dom (#319)
Browse files Browse the repository at this point in the history
* feature: implement select value binding
closes #317

* stan: improve lvl 6 checks

* build: bump dependencies

* stan: fix option class

* tweak: handle value attribute specifically

* stan: handle value property
  • Loading branch information
g105b authored Jan 30, 2022
1 parent 822e7b3 commit d8ea73c
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 44 deletions.
92 changes: 50 additions & 42 deletions composer.lock

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

1 change: 1 addition & 0 deletions src/DocumentBinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class DocumentBinder {

/**
* @param array<string, string> $config
* @noinspection PhpPropertyOnlyWrittenInspection
*/
public function __construct(
private Document $document,
Expand Down
4 changes: 4 additions & 0 deletions src/HTMLAttributeBinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ private function setBindProperty(
$this->tableBinder->bindTableData($bindValue, $element);
break;

case "value":
$element->value = $bindValue; /** @phpstan-ignore-line */
break;

default:
if($modifier) {
$this->handleModifier(
Expand Down
4 changes: 2 additions & 2 deletions src/PlaceholderText.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php
<?php /** @noinspection PhpPropertyOnlyWrittenInspection tracked in issue #290 */
namespace Gt\DomTemplate;

use Gt\Dom\Element;
use Gt\Dom\Text;

class PlaceholderText {
private string $bindKey;
private ?string $default; /** @phpstan-ignore-line tracked in issue #290 */
private ?string $default; /** @phpstan-ignore-line */

public function __construct(
private Text $originalText
Expand Down

0 comments on commit d8ea73c

Please sign in to comment.