@@ -12,11 +12,11 @@ class OutputFormatter
12
12
/**
13
13
* @var OutputFormat
14
14
*/
15
- private $ oFormat ;
15
+ private $ outputFormat ;
16
16
17
- public function __construct (OutputFormat $ oFormat )
17
+ public function __construct (OutputFormat $ outputFormat )
18
18
{
19
- $ this ->oFormat = $ oFormat ;
19
+ $ this ->outputFormat = $ outputFormat ;
20
20
}
21
21
22
22
/**
@@ -25,7 +25,7 @@ public function __construct(OutputFormat $oFormat)
25
25
*/
26
26
public function space ($ sName , $ sType = null ): string
27
27
{
28
- $ sSpaceString = $ this ->oFormat ->get ("Space $ sName " );
28
+ $ sSpaceString = $ this ->outputFormat ->get ("Space $ sName " );
29
29
// If $sSpaceString is an array, we have multiple values configured
30
30
// depending on the type of object the space applies to
31
31
if (\is_array ($ sSpaceString )) {
@@ -91,7 +91,7 @@ public function spaceAfterSelectorSeparator(): string
91
91
*/
92
92
public function spaceBeforeListArgumentSeparator ($ sSeparator ): string
93
93
{
94
- $ spaceForSeparator = $ this ->oFormat ->getSpaceBeforeListArgumentSeparators ();
94
+ $ spaceForSeparator = $ this ->outputFormat ->getSpaceBeforeListArgumentSeparators ();
95
95
96
96
return $ spaceForSeparator [$ sSeparator ] ?? $ this ->space ('BeforeListArgumentSeparator ' , $ sSeparator );
97
97
}
@@ -101,7 +101,7 @@ public function spaceBeforeListArgumentSeparator($sSeparator): string
101
101
*/
102
102
public function spaceAfterListArgumentSeparator ($ sSeparator ): string
103
103
{
104
- $ spaceForSeparator = $ this ->oFormat ->getSpaceAfterListArgumentSeparators ();
104
+ $ spaceForSeparator = $ this ->outputFormat ->getSpaceAfterListArgumentSeparators ();
105
105
106
106
return $ spaceForSeparator [$ sSeparator ] ?? $ this ->space ('AfterListArgumentSeparator ' , $ sSeparator );
107
107
}
@@ -120,7 +120,7 @@ public function spaceBeforeOpeningBrace(): string
120
120
*/
121
121
public function safely ($ cCode )
122
122
{
123
- if ($ this ->oFormat ->get ('IgnoreExceptions ' )) {
123
+ if ($ this ->outputFormat ->get ('IgnoreExceptions ' )) {
124
124
// If output exceptions are ignored, run the code with exception guards
125
125
try {
126
126
return $ cCode ();
@@ -142,9 +142,9 @@ public function safely($cCode)
142
142
public function implode (string $ sSeparator , array $ aValues , $ bIncreaseLevel = false ): string
143
143
{
144
144
$ result = '' ;
145
- $ oFormat = $ this ->oFormat ;
145
+ $ outputFormat = $ this ->outputFormat ;
146
146
if ($ bIncreaseLevel ) {
147
- $ oFormat = $ oFormat ->nextLevel ();
147
+ $ outputFormat = $ outputFormat ->nextLevel ();
148
148
}
149
149
$ bIsFirst = true ;
150
150
foreach ($ aValues as $ mValue ) {
@@ -154,7 +154,7 @@ public function implode(string $sSeparator, array $aValues, $bIncreaseLevel = fa
154
154
$ result .= $ sSeparator ;
155
155
}
156
156
if ($ mValue instanceof Renderable) {
157
- $ result .= $ mValue ->render ($ oFormat );
157
+ $ result .= $ mValue ->render ($ outputFormat );
158
158
} else {
159
159
$ result .= $ mValue ;
160
160
}
@@ -169,7 +169,7 @@ public function implode(string $sSeparator, array $aValues, $bIncreaseLevel = fa
169
169
*/
170
170
public function removeLastSemicolon ($ sString )
171
171
{
172
- if ($ this ->oFormat ->get ('SemicolonAfterLastRule ' )) {
172
+ if ($ this ->outputFormat ->get ('SemicolonAfterLastRule ' )) {
173
173
return $ sString ;
174
174
}
175
175
$ sString = \explode ('; ' , $ sString );
@@ -184,7 +184,7 @@ public function removeLastSemicolon($sString)
184
184
185
185
public function comments (Commentable $ oCommentable ): string
186
186
{
187
- if (!$ this ->oFormat ->bRenderComments ) {
187
+ if (!$ this ->outputFormat ->bRenderComments ) {
188
188
return '' ;
189
189
}
190
190
@@ -193,7 +193,7 @@ public function comments(Commentable $oCommentable): string
193
193
$ iLastCommentIndex = \count ($ comments ) - 1 ;
194
194
195
195
foreach ($ comments as $ i => $ oComment ) {
196
- $ result .= $ oComment ->render ($ this ->oFormat );
196
+ $ result .= $ oComment ->render ($ this ->outputFormat );
197
197
$ result .= $ i === $ iLastCommentIndex ? $ this ->spaceAfterBlocks () : $ this ->spaceBetweenBlocks ();
198
198
}
199
199
return $ result ;
@@ -212,6 +212,6 @@ private function prepareSpace($sSpaceString): string
212
212
*/
213
213
private function indent (): string
214
214
{
215
- return \str_repeat ($ this ->oFormat ->sIndentation , $ this ->oFormat ->getIndentationLevel ());
215
+ return \str_repeat ($ this ->outputFormat ->sIndentation , $ this ->outputFormat ->getIndentationLevel ());
216
216
}
217
217
}
0 commit comments