REDROOM
PHP 8.3.31
Path:
Logout
Edit File
Size: 4.82 KB
Close
/home/getspomw/royalsquad.us/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesLoops.php
Text
Base64
<?php namespace Illuminate\View\Compilers\Concerns; use Illuminate\Contracts\View\ViewCompilationException; trait CompilesLoops { /** * Counter to keep track of nested forelse statements. * * @var int */ protected $forElseCounter = 0; /** * Compile the for-else statements into valid PHP. * * @param string|null $expression * @return string * * @throws \Illuminate\Contracts\View\ViewCompilationException */ protected function compileForelse($expression) { $empty = '$__empty_'.++$this->forElseCounter; preg_match('/\( *(.+) +as +(.+)\)$/is', $expression ?? '', $matches); if (count($matches) === 0) { throw new ViewCompilationException('Malformed @forelse statement.'); } $iteratee = trim($matches[1]); $iteration = trim($matches[2]); $initLoop = "\$__currentLoopData = {$iteratee}; \$__env->addLoop(\$__currentLoopData);"; $iterateLoop = '$__env->incrementLoopIndices(); $loop = $__env->getLastLoop();'; return "<?php {$empty} = true; {$initLoop} foreach(\$__currentLoopData as {$iteration}): {$iterateLoop} {$empty} = false; ?>"; } /** * Compile the for-else-empty and empty statements into valid PHP. * * @param string $expression * @return string */ protected function compileEmpty($expression) { if ($expression) { return "<?php if(empty{$expression}): ?>"; } $empty = '$__empty_'.$this->forElseCounter--; return "<?php endforeach; \$__env->popLoop(); \$loop = \$__env->getLastLoop(); if ({$empty}): ?>"; } /** * Compile the end-for-else statements into valid PHP. * * @return string */ protected function compileEndforelse() { return '<?php endif; ?>'; } /** * Compile the end-empty statements into valid PHP. * * @return string */ protected function compileEndEmpty() { return '<?php endif; ?>'; } /** * Compile the for statements into valid PHP. * * @param string $expression * @return string */ protected function compileFor($expression) { return "<?php for{$expression}: ?>"; } /** * Compile the for-each statements into valid PHP. * * @param string|null $expression * @return string * * @throws \Illuminate\Contracts\View\ViewCompilationException */ protected function compileForeach($expression) { preg_match('/\( *(.+) +as +(.*)\)$/is', $expression ?? '', $matches); if (count($matches) === 0) { throw new ViewCompilationException('Malformed @foreach statement.'); } $iteratee = trim($matches[1]); $iteration = trim($matches[2]); $initLoop = "\$__currentLoopData = {$iteratee}; \$__env->addLoop(\$__currentLoopData);"; $iterateLoop = '$__env->incrementLoopIndices(); $loop = $__env->getLastLoop();'; return "<?php {$initLoop} foreach(\$__currentLoopData as {$iteration}): {$iterateLoop} ?>"; } /** * Compile the break statements into valid PHP. * * @param string $expression * @return string */ protected function compileBreak($expression) { if ($expression) { preg_match('/\(\s*(-?\d+)\s*\)$/', $expression, $matches); return $matches ? '<?php break '.max(1, $matches[1]).'; ?>' : "<?php if{$expression} break; ?>"; } return '<?php break; ?>'; } /** * Compile the continue statements into valid PHP. * * @param string $expression * @return string */ protected function compileContinue($expression) { if ($expression) { preg_match('/\(\s*(-?\d+)\s*\)$/', $expression, $matches); return $matches ? '<?php continue '.max(1, $matches[1]).'; ?>' : "<?php if{$expression} continue; ?>"; } return '<?php continue; ?>'; } /** * Compile the end-for statements into valid PHP. * * @return string */ protected function compileEndfor() { return '<?php endfor; ?>'; } /** * Compile the end-for-each statements into valid PHP. * * @return string */ protected function compileEndforeach() { return '<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>'; } /** * Compile the while statements into valid PHP. * * @param string $expression * @return string */ protected function compileWhile($expression) { return "<?php while{$expression}: ?>"; } /** * Compile the end-while statements into valid PHP. * * @return string */ protected function compileEndwhile() { return '<?php endwhile; ?>'; } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 21
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
CompilesAuthorizations.php
2.44 KB
lrw-rw-rw-
2025-09-17 06:52:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CompilesClasses.php
446 B
lrw-rw-rw-
2025-09-17 06:52:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CompilesComments.php
413 B
lrw-rw-rw-
2025-09-17 06:52:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CompilesComponents.php
6.46 KB
lrw-rw-rw-
2025-09-17 06:52:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CompilesConditionals.php
9.27 KB
lrw-rw-rw-
2025-09-17 06:52:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CompilesEchos.php
4.52 KB
lrw-rw-rw-
2025-09-17 06:52:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CompilesErrors.php
933 B
lrw-rw-rw-
2025-09-17 06:52:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CompilesFragments.php
729 B
lrw-rw-rw-
2025-09-17 06:52:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CompilesHelpers.php
1.56 KB
lrw-rw-rw-
2025-09-17 06:52:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CompilesIncludes.php
2.38 KB
lrw-rw-rw-
2025-09-17 06:52:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CompilesInjections.php
505 B
lrw-rw-rw-
2025-09-17 06:52:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CompilesJs.php
447 B
lrw-rw-rw-
2025-09-17 06:52:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CompilesJson.php
725 B
lrw-rw-rw-
2025-09-17 06:52:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CompilesLayouts.php
3.01 KB
lrw-rw-rw-
2025-09-17 06:52:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CompilesLoops.php
4.82 KB
lrw-rw-rw-
2025-09-17 06:52:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CompilesRawPhp.php
620 B
lrw-rw-rw-
2025-09-17 06:52:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CompilesSessions.php
1013 B
lrw-rw-rw-
2025-09-17 06:52:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CompilesStacks.php
2.73 KB
lrw-rw-rw-
2025-09-17 06:52:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CompilesStyles.php
443 B
lrw-rw-rw-
2025-09-17 06:52:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CompilesTranslations.php
1.03 KB
lrw-rw-rw-
2025-09-17 06:52:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CompilesUseStatements.php
532 B
lrw-rw-rw-
2025-09-17 06:52:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).