type; $value = $shell->value(); assert($type instanceof ScalarType); if ($type->accepts($value)) { return $shell->node($value); } if (! $shell->allowScalarValueCasting || ! $type->canCast($value)) { return $shell->error($type->errorMessage()); } return $shell->node($type->cast($value)); } }