Skip to content

Commit ed5d7e8

Browse files
author
Caitlin Bales (MSFT)
committed
Change Stream from constructor to stream_for method
1 parent 34550e0 commit ed5d7e8

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Templates/PHP/Model/ComplexType.php.tt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,13 @@ foreach(var property in complex.Properties.Where(prop => prop.Type.GetTypeString
7979
if (is_a($this->_propDict["<#=property.Name.ToCamelize()#>"], "<#=property.Type.GetTypeString()#>")) {
8080
return $this->_propDict["<#=property.Name.ToCamelize()#>"];
8181
} else {
82+
<# if (property.Type.GetTypeString() == "\\GuzzleHttp\\Psr7\\Stream") { #>
83+
$this->_propDict["<#=property.Name.ToCamelize()#>"] = \GuzzleHttp\Psr7\stream_for($this->_propDict["<#=property.Name.ToCamelize()#>"]);
84+
return $this->_propDict["<#=property.Name.ToCamelize()#>"];
85+
<# } else { #>
8286
$this->_propDict["<#=property.Name.ToCamelize()#>"] = new <#=property.Type.GetTypeString()#>($this->_propDict["<#=property.Name.ToCamelize()#>"]);
8387
return $this->_propDict["<#=property.Name.ToCamelize()#>"];
88+
<# } #>
8489
}
8590
}
8691
return null;

Templates/PHP/Model/EntityType.php.tt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,13 @@ foreach(var property in entity.Properties.Where(prop => prop.Type.GetTypeString(
105105
if (is_a($this->_propDict["<#=property.Name.ToCamelize()#>"], "<#=property.Type.GetTypeString()#>")) {
106106
return $this->_propDict["<#=property.Name.ToCamelize()#>"];
107107
} else {
108+
<# if (property.Type.GetTypeString() == "\\GuzzleHttp\\Psr7\\Stream") { #>
109+
$this->_propDict["<#=property.Name.ToCamelize()#>"] = \GuzzleHttp\Psr7\stream_for($this->_propDict["<#=property.Name.ToCamelize()#>"]);
110+
return $this->_propDict["<#=property.Name.ToCamelize()#>"];
111+
<# } else { #>
108112
$this->_propDict["<#=property.Name.ToCamelize()#>"] = new <#=property.Type.GetTypeString()#>($this->_propDict["<#=property.Name.ToCamelize()#>"]);
109113
return $this->_propDict["<#=property.Name.ToCamelize()#>"];
114+
<# } #>
110115
}
111116
}
112117
return null;

0 commit comments

Comments
 (0)