@@ -111,19 +111,20 @@ public function getSectionConfig(string $section, string $key)
111
111
*/
112
112
private function getConfigStyles (string $ sectionName ): array
113
113
{
114
+ $ logoType = $ logoPosition = $ textColor = $ textSize = null ;
115
+ $ color = $ ratio = null ;
114
116
$ styleLayout = $ this ->config ->getPayLaterConfigValue ("$ {sectionName}_stylelayout " );
115
- $ logoType = $ styleLayout === 'text '
116
- ? $ this ->config ->getPayLaterConfigValue ("$ {sectionName}_logotype " ) : null ;
117
- $ logoPosition = $ styleLayout === 'text ' && ($ logoType === 'primary ' || $ logoType === 'alternative ' )
118
- ? $ this ->config ->getPayLaterConfigValue ("$ {sectionName}_logoposition " ) : null ;
119
- $ textColor = $ styleLayout === 'text '
120
- ? $ this ->config ->getPayLaterConfigValue ("$ {sectionName}_textcolor " ) : null ;
121
- $ textSize = $ styleLayout === 'text '
122
- ? $ this ->config ->getPayLaterConfigValue ("$ {sectionName}_textsize " ) : null ;
123
- $ color = $ styleLayout === 'flex '
124
- ? $ this ->config ->getPayLaterConfigValue ("$ {sectionName}_color " ) : null ;
125
- $ ratio = $ styleLayout === 'flex '
126
- ? $ this ->config ->getPayLaterConfigValue ("$ {sectionName}_ratio " ) : null ;
117
+ if ($ styleLayout === 'text ' ) {
118
+ $ logoType = $ this ->config ->getPayLaterConfigValue ("$ {sectionName}_logotype " );
119
+ if ($ logoType === 'primary ' || $ logoType === 'alternative ' ) {
120
+ $ logoPosition = $ this ->config ->getPayLaterConfigValue ("$ {sectionName}_logoposition " );
121
+ }
122
+ $ textColor = $ this ->config ->getPayLaterConfigValue ("$ {sectionName}_textcolor " );
123
+ $ textSize = $ this ->config ->getPayLaterConfigValue ("$ {sectionName}_textsize " );
124
+ } elseif ($ styleLayout === 'flex ' ) {
125
+ $ color = $ this ->config ->getPayLaterConfigValue ("$ {sectionName}_color " );
126
+ $ ratio = $ this ->config ->getPayLaterConfigValue ("$ {sectionName}_ratio " );
127
+ }
127
128
128
129
return [
129
130
'data-pp-style-layout ' => $ styleLayout ,
0 commit comments