/
home
/
techb158
/
ileadtechnology.com
/
SSM
/
vendor
/
psy
/
psysh
/
src
/
CodeCleaner
/
/home/techb158/ileadtechnology.com/SSM/vendor/psy/psysh/src/CodeCleaner
mkdir
upload
Name
Size
Mode
Actions
AbstractClassPass.php
2200
0644
edit
dl
rm
AssignThisVariablePass.php
1034
0644
edit
dl
rm
CalledClassPass.php
2386
0644
edit
dl
rm
CallTimePassByReferencePass.php
1391
0644
edit
dl
rm
CodeCleanerPass.php
415
0644
edit
dl
rm
EmptyArrayDimFetchPass.php
1283
0644
edit
dl
rm
ExitPass.php
773
0644
edit
dl
rm
FinalClassPass.php
1666
0644
edit
dl
rm
FunctionContextPass.php
1339
0644
edit
dl
rm
FunctionReturnInWriteContextPass.php
2498
0644
edit
dl
rm
ImplicitReturnPass.php
4240
0644
edit
dl
rm
InstanceOfPass.php
1604
0644
edit
dl
rm
LabelContextPass.php
2356
0644
edit
dl
rm
LeavePsyshAlonePass.php
913
0644
edit
dl
rm
ListPass.php
3282
0644
edit
dl
rm
LoopContextPass.php
3476
0644
edit
dl
rm
MagicConstantsPass.php
1068
0644
edit
dl
rm
NamespaceAwarePass.php
1856
0644
edit
dl
rm
NamespacePass.php
2416
0644
edit
dl
rm
NoReturnValue.php
870
0644
edit
dl
rm
PassableByReferencePass.php
4024
0644
edit
dl
rm
RequirePass.php
3035
0644
edit
dl
rm
StrictTypesPass.php
2704
0644
edit
dl
rm
UseStatementPass.php
4356
0644
edit
dl
rm
ValidClassNamePass.php
12176
0644
edit
dl
rm
ValidConstantPass.php
3202
0644
edit
dl
rm
ValidConstructorPass.php
3884
0644
edit
dl
rm
ValidFunctionNamePass.php
3239
0644
edit
dl
rm
Edit:
/home/techb158/ileadtechnology.com/SSM/vendor/psy/psysh/src/CodeCleaner/LabelContextPass.php
(2356B)
<?php /* * This file is part of Psy Shell. * * (c) 2012-2020 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Psy\CodeCleaner; use PhpParser\Node; use PhpParser\Node\FunctionLike; use PhpParser\Node\Stmt\Goto_; use PhpParser\Node\Stmt\Label; use Psy\Exception\FatalErrorException; /** * CodeCleanerPass for label context. * * This class partially emulates the PHP label specification. * PsySH can not declare labels by sequentially executing lines with eval, * but since it is not a syntax error, no error is raised. * This class warns before invalid goto causes a fatal error. * Since this is a simple checker, it does not block real fatal error * with complex syntax. (ex. it does not parse inside function.) * * @see http://php.net/goto */ class LabelContextPass extends CodeCleanerPass { /** @var int */ private $functionDepth; /** @var array */ private $labelDeclarations; /** @var array */ private $labelGotos; /** * @param array $nodes */ public function beforeTraverse(array $nodes) { $this->functionDepth = 0; $this->labelDeclarations = []; $this->labelGotos = []; } public function enterNode(Node $node) { if ($node instanceof FunctionLike) { $this->functionDepth++; return; } // node is inside function context if ($this->functionDepth !== 0) { return; } if ($node instanceof Goto_) { $this->labelGotos[\strtolower($node->name)] = $node->getLine(); } elseif ($node instanceof Label) { $this->labelDeclarations[\strtolower($node->name)] = $node->getLine(); } } /** * @param \PhpParser\Node $node */ public function leaveNode(Node $node) { if ($node instanceof FunctionLike) { $this->functionDepth--; } } public function afterTraverse(array $nodes) { foreach ($this->labelGotos as $name => $line) { if (!isset($this->labelDeclarations[$name])) { $msg = "'goto' to undefined label '{$name}'"; throw new FatalErrorException($msg, 0, E_ERROR, null, $line); } } } }
Save
cmd:
run