Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
tipuloidea
/
back
/
vendor
/
phpdocumentor
/
reflection
/
src
/
phpDocumentor
/
Reflection
/
Php
/
Factory
:
IfStatement.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php declare(strict_types=1); namespace phpDocumentor\Reflection\Php\Factory; use Override; use phpDocumentor\Reflection\Php\ProjectFactoryStrategy; use phpDocumentor\Reflection\Php\StrategyContainer; use PhpParser\Node\Stmt\Else_; use PhpParser\Node\Stmt\If_; class IfStatement implements ProjectFactoryStrategy { #[Override] public function matches(ContextStack $context, object $object): bool { return $object instanceof If_; } /** @param If_ $object */ #[Override] public function create(ContextStack $context, object $object, StrategyContainer $strategies): void { foreach ($object->stmts as $stmt) { $strategies->findMatching($context, $stmt)->create($context, $stmt, $strategies); } foreach ($object->elseifs as $elseIf) { foreach ($elseIf->stmts as $stmt) { $strategies->findMatching($context, $stmt)->create($context, $stmt, $strategies); } } if (!($object->else instanceof Else_)) { return; } foreach ($object->else->stmts as $stmt) { $strategies->findMatching($context, $stmt)->create($context, $stmt, $strategies); } } }