Skip to content

Commit

Permalink
442 reflection named type (#445)
Browse files Browse the repository at this point in the history
* build: upgrade dom requirement and loosen version range

* docs: update examples

* feature: trim whitespace when there are only template children
closes #363

* maintenance: phpstorm analysis improvements

* tweak: remove data-element attribute

* fix: type check for ReflectionNamedType
closes #442
  • Loading branch information
g105b authored Aug 9, 2023
1 parent 70581eb commit af9f693
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/BindableCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ public function isBindable(object $object):bool {

/** @var ?ReflectionNamedType $refReturn */
$refReturn = $refMethod->getReturnType();
if(!$refReturn instanceof ReflectionNamedType) {
continue;
}
$refReturnName = $refReturn?->getName();

foreach($refAttributes as $refAttr) {
Expand Down
2 changes: 1 addition & 1 deletion src/TableBinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public function detectTableDataStructureType(array $array):TableDataStructureTyp
*/
foreach($rowData as $cellIndex => $cellData) {
if($rowIndex > 0) {
if(isset($array[0]) && is_array($array[0]) && array_is_list($array[0]) && !array_is_list($rowData)) {
if(isset($array[0]) && array_is_list($array[0]) && !array_is_list($rowData)) {
if(!is_iterable($cellData)) {
throw new IncorrectTableDataFormat("Row $rowIndex has a string key ($cellIndex) but the value is not iterable.");
}
Expand Down

0 comments on commit af9f693

Please sign in to comment.