Skip to content

Commit 1cad1c8

Browse files
committed
whitespace and camelCase
1 parent fe75475 commit 1cad1c8

File tree

4 files changed

+22
-18
lines changed

4 files changed

+22
-18
lines changed

src/Compiler.php

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -467,8 +467,8 @@ protected function glueFunctionSelectors($parts)
467467
*/
468468
protected function matchExtends($selector, &$out, $from = 0, $initial = true)
469469
{
470-
471470
$selector = $this->glueFunctionSelectors($selector);
471+
472472
foreach ($selector as $i => $part) {
473473
if ($i < $from) {
474474
continue;
@@ -501,6 +501,7 @@ protected function matchExtends($selector, &$out, $from = 0, $initial = true)
501501
$slice[] = $chunk;
502502
}
503503
}
504+
504505
array_unshift($replacement, $slice);
505506

506507
if (! $this->isImmediateRelationshipCombinator(end($slice))) {
@@ -1123,14 +1124,16 @@ protected function compileNestedBlock(Block $block, $selectors)
11231124
// wrap assign children in a block
11241125
// except for @font-face
11251126
if ($block->type !== Type::T_DIRECTIVE || $block->name !== "font-face") {
1126-
// need wraping?
1127+
// need wrapping?
11271128
$needWrapping = false;
1129+
11281130
foreach ($block->children as $child) {
11291131
if ($child[0] === Type::T_ASSIGN) {
11301132
$needWrapping = true;
11311133
break;
11321134
}
11331135
}
1136+
11341137
if ($needWrapping) {
11351138
$wrapped = new Block;
11361139
$wrapped->sourceName = $block->sourceName;
@@ -1561,6 +1564,7 @@ protected function evaluateMediaQuery($queryList)
15611564
}
15621565
}
15631566
}
1567+
15641568
return $queryList;
15651569
}
15661570

@@ -2144,10 +2148,10 @@ protected function compileChild($child, OutputBlock $out)
21442148
// clone the stored content to not have its scope spoiled by a further call to the same mixin
21452149
// i.e., recursive @include of the same mixin
21462150
if (isset($content)) {
2147-
$copy_content = clone $content;
2148-
$copy_content->scope = $callingScope;
2151+
$copyContent = clone $content;
2152+
$copyContent->scope = $callingScope;
21492153

2150-
$this->setRaw(static::$namespaces['special'] . 'content', $copy_content, $this->env);
2154+
$this->setRaw(static::$namespaces['special'] . 'content', $copyContent, $this->env);
21512155
}
21522156

21532157
if (isset($mixin->args)) {
@@ -3503,9 +3507,10 @@ public function get($name, $shouldThrow = true, Environment $env = null, $unredu
35033507
$nextIsRoot = false;
35043508
$hasNamespace = $normalizedName[0] === '^' || $normalizedName[0] === '@' || $normalizedName[0] === '%';
35053509

3506-
$max_depth = 10000;
3510+
$maxDepth = 10000;
3511+
35073512
for (;;) {
3508-
if ($max_depth-- <= 0) {
3513+
if ($maxDepth-- <= 0) {
35093514
break;
35103515
}
35113516
if (array_key_exists($normalizedName, $env->store)) {
@@ -3534,7 +3539,7 @@ public function get($name, $shouldThrow = true, Environment $env = null, $unredu
35343539
}
35353540

35363541
if ($shouldThrow) {
3537-
$this->throwError("Undefined variable \$$name" . ($max_depth<=0 ? " (infinite recursion)" : ""));
3542+
$this->throwError("Undefined variable \$$name" . ($maxDepth<=0 ? " (infinite recursion)" : ""));
35383543
}
35393544

35403545
// found nothing

src/SourceMap/SourceMapGenerator.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class SourceMapGenerator
8585
* @var array
8686
*/
8787
protected $sources = [];
88-
protected $source_keys = [];
88+
protected $sourceKeys = [];
8989

9090
/**
9191
* @var array
@@ -181,8 +181,8 @@ public function generateJson()
181181
// A list of original sources used by the 'mappings' entry.
182182
$sourceMap['sources'] = [];
183183

184-
foreach ($this->sources as $source_uri => $source_filename) {
185-
$sourceMap['sources'][] = $this->normalizeFilename($source_filename);
184+
foreach ($this->sources as $sourceUri => $sourceFilename) {
185+
$sourceMap['sources'][] = $this->normalizeFilename($sourceFilename);
186186
}
187187

188188
// A list of symbol names used by the 'mappings' entry.
@@ -237,7 +237,7 @@ public function generateMappings()
237237
return '';
238238
}
239239

240-
$this->source_keys = array_flip(array_keys($this->sources));
240+
$this->sourceKeys = array_flip(array_keys($this->sources));
241241

242242
// group mappings by generated line number.
243243
$groupedMap = $groupedMapEncoded = [];
@@ -249,15 +249,15 @@ public function generateMappings()
249249
ksort($groupedMap);
250250
$lastGeneratedLine = $lastOriginalIndex = $lastOriginalLine = $lastOriginalColumn = 0;
251251

252-
foreach ($groupedMap as $lineNumber => $line_map) {
252+
foreach ($groupedMap as $lineNumber => $lineMap) {
253253
while (++$lastGeneratedLine < $lineNumber) {
254254
$groupedMapEncoded[] = ';';
255255
}
256256

257257
$lineMapEncoded = [];
258258
$lastGeneratedColumn = 0;
259259

260-
foreach ($line_map as $m) {
260+
foreach ($lineMap as $m) {
261261
$mapEncoded = $this->encoder->encode($m['generated_column'] - $lastGeneratedColumn);
262262
$lastGeneratedColumn = $m['generated_column'];
263263

@@ -294,7 +294,7 @@ public function generateMappings()
294294
*/
295295
protected function findFileIndex($filename)
296296
{
297-
return $this->source_keys[$filename];
297+
return $this->sourceKeys[$filename];
298298
}
299299

300300
/**

tests/FrameworkTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ public function testFramework($frameworkVerion, $inputdirectory, $inputfiles)
5757
$this->scss->addImportPath($inputdirectory);
5858

5959
$input = file_get_contents($inputdirectory . $inputfiles);
60-
61-
//Test if no exeption are raised for the given framwork
60+
61+
// Test if no exceptions are raised for the given framework
6262
$e = null;
6363

6464
try {

tests/inputs/extends.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,4 +387,3 @@ embed.bar {
387387
.class3:not(:last-child) {
388388
@extend .class1;
389389
}
390-

0 commit comments

Comments
 (0)