From fdf88639bb51c5cd4e88b963af02de908729d978 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev <1695147@gmail.com> Date: Sun, 2 Mar 2025 21:33:55 +0000 Subject: [PATCH] Remove redundant comments --- src/Statements/ContinueStatement.php | 2 - src/Statements/StatementAbstract.php | 2 - src/Variable/Variable.php | 144 +-------------------------- 3 files changed, 4 insertions(+), 144 deletions(-) diff --git a/src/Statements/ContinueStatement.php b/src/Statements/ContinueStatement.php index deb8ed161..9c06da73b 100644 --- a/src/Statements/ContinueStatement.php +++ b/src/Statements/ContinueStatement.php @@ -19,8 +19,6 @@ class ContinueStatement extends StatementAbstract { /** - * @param CompilationContext $compilationContext - * * @throws CompilerException */ public function compile(CompilationContext $compilationContext): void diff --git a/src/Statements/StatementAbstract.php b/src/Statements/StatementAbstract.php index f2bcf5729..3609c3b6a 100644 --- a/src/Statements/StatementAbstract.php +++ b/src/Statements/StatementAbstract.php @@ -29,8 +29,6 @@ public function __construct(protected array $statement) /** * Compiles the statement. - * - * @param CompilationContext $compilationContext */ abstract public function compile(CompilationContext $compilationContext); diff --git a/src/Variable/Variable.php b/src/Variable/Variable.php index 4adcdf398..0b6d6bc17 100644 --- a/src/Variable/Variable.php +++ b/src/Variable/Variable.php @@ -162,8 +162,6 @@ public function getAssociatedClass(): Definition | ReflectionClass | null /** * Get the branch where the variable was declared. - * - * @return Branch|null */ public function getBranch(): ?Branch { @@ -172,8 +170,6 @@ public function getBranch(): ?Branch /** * Returns the PHP classes associated to the variable. - * - * @return array */ public function getClassTypes(): array { @@ -182,8 +178,6 @@ public function getClassTypes(): array /** * Returns the default init value. - * - * @return mixed */ public function getDefaultInitValue(): mixed { @@ -192,8 +186,6 @@ public function getDefaultInitValue(): mixed /** * Returns the current dynamic type in a polymorphic variable. - * - * @return array */ public function getDynamicTypes(): array { @@ -202,8 +194,6 @@ public function getDynamicTypes(): array /** * Get init branch. - * - * @return bool */ public function getInitBranch(): bool { @@ -230,8 +220,6 @@ public function getLastUsedNode(): ?array /** * Returns variable's name. - * - * @return string */ public function getName(): string { @@ -240,8 +228,6 @@ public function getName(): string /** * Returns the number of mutations performed over the variable. - * - * @return int */ public function getNumberMutations(): int { @@ -250,8 +236,6 @@ public function getNumberMutations(): int /** * Return the number of uses. - * - * @return int */ public function getNumberUses(): int { @@ -260,8 +244,6 @@ public function getNumberUses(): int /** * Returns the original AST node where the variable was declared. - * - * @return array */ public function getOriginal(): array { @@ -274,8 +256,6 @@ public function getOriginal(): array /** * Returns the latest CompiledExpression assigned to a variable. - * - * @return mixed */ public function getPossibleValue(): mixed { @@ -292,8 +272,6 @@ public function getPossibleValueBranch(): ?Branch /** * Returns variable's real name. - * - * @return string */ public function getRealName(): string { @@ -302,8 +280,6 @@ public function getRealName(): string /** * Get the number of initializations remaining to skip. - * - * @return int */ public function getSkipVariant(): int { @@ -312,8 +288,6 @@ public function getSkipVariant(): int /** * Returns the type of variable. - * - * @return string */ public function getType(): string { @@ -322,8 +296,6 @@ public function getType(): string /** * Get the number of times the variable has been initialized. - * - * @return int */ public function getVariantInits(): int { @@ -332,10 +304,6 @@ public function getVariantInits(): int /** * Checks if the variable has any of the passed dynamic. - * - * @param array|string $types - * - * @return bool */ public function hasAnyDynamicType(array | string $types): bool { @@ -354,10 +322,6 @@ public function hasAnyDynamicType(array | string $types): bool /** * Check if the variable has at least one dynamic type to the ones passed in the list. - * - * @param array $types - * - * @return bool */ public function hasDifferentDynamicType(array $types): bool { @@ -398,8 +362,6 @@ public function increaseVariantIfNull(): void /** * Initializes a variant variable that is intended to have the special * behavior of only freed its body value instead of the full variable. - * - * @param CompilationContext $compilationContext */ public function initComplexLiteralVariant(CompilationContext $compilationContext): void { @@ -438,8 +400,6 @@ public function initComplexLiteralVariant(CompilationContext $compilationContext /** * Allocate memory for variable and init it null val - * - * @param CompilationContext $compilationContext */ public function initNonReferenced(CompilationContext $compilationContext): void { @@ -448,8 +408,6 @@ public function initNonReferenced(CompilationContext $compilationContext): void /** * Initializes a variant variable. - * - * @param CompilationContext $compilationContext */ public function initVariant(CompilationContext $compilationContext): void { @@ -504,8 +462,6 @@ public function initVariant(CompilationContext $compilationContext): void /** * Shortcut is type double? - * - * @return bool */ public function isArray(): bool { @@ -514,8 +470,6 @@ public function isArray(): bool /** * Shortcut is type bool? - * - * @return bool */ public function isBoolean(): bool { @@ -524,8 +478,6 @@ public function isBoolean(): bool /** * Shortcut is type double? - * - * @return bool */ public function isDouble(): bool { @@ -542,8 +494,6 @@ public function isDoublePointer(): bool /** * Check if the variable is a parameter. - * - * @return bool */ public function isExternal(): bool { @@ -552,8 +502,6 @@ public function isExternal(): bool /** * Checks if the variable is idle. - * - * @return bool */ public function isIdle(): bool { @@ -562,8 +510,6 @@ public function isIdle(): bool /** * Check if the variable is initialized or not. - * - * @return bool */ public function isInitialized(): bool { @@ -572,8 +518,6 @@ public function isInitialized(): bool /** * Shortcut is type int? - * - * @return bool */ public function isInt(): bool { @@ -582,8 +526,6 @@ public function isInt(): bool /** * Checks if the variable is local-only scoped. - * - * @return bool */ public function isLocalOnly(): bool { @@ -592,8 +534,6 @@ public function isLocalOnly(): bool /** * Checks if a variable is a local static. - * - * @return bool */ public function isLocalStatic(): bool { @@ -602,8 +542,6 @@ public function isLocalStatic(): bool /** * Checks if the variable is tracked by the memory manager. - * - * @return bool */ public function isMemoryTracked(): bool { @@ -612,8 +550,6 @@ public function isMemoryTracked(): bool /** * Shortcut is type mixed? - * - * @return bool */ public function isMixed(): bool { @@ -622,8 +558,6 @@ public function isMixed(): bool /** * Shortcut is type variable or string? - * - * @return bool */ public function isNotVariable(): bool { @@ -632,8 +566,6 @@ public function isNotVariable(): bool /** * Shortcut is type variable or array? - * - * @return bool */ public function isNotVariableAndArray(): bool { @@ -642,8 +574,6 @@ public function isNotVariableAndArray(): bool /** * Shortcut is type variable or mixed or string? - * - * @return bool */ public function isNotVariableAndMixedAndString(): bool { @@ -652,8 +582,6 @@ public function isNotVariableAndMixedAndString(): bool /** * Shortcut is type variable or string? - * - * @return bool */ public function isNotVariableAndString(): bool { @@ -662,8 +590,6 @@ public function isNotVariableAndString(): bool /** * Returns if the variable is read only. - * - * @return bool */ public function isReadOnly(): bool { @@ -672,8 +598,6 @@ public function isReadOnly(): bool /** * Checks if the temporary variable is reusable. - * - * @return bool */ public function isReusable(): bool { @@ -682,8 +606,6 @@ public function isReusable(): bool /** * Shortcut is type string? - * - * @return bool */ public function isString(): bool { @@ -692,8 +614,6 @@ public function isString(): bool /** * Checks if a variable is a super global. - * - * @return bool */ public function isSuperGlobal(): bool { @@ -702,8 +622,6 @@ public function isSuperGlobal(): bool /** * Returns whether the variable is temporal or not. - * - * @return bool */ public function isTemporal(): bool { @@ -712,8 +630,6 @@ public function isTemporal(): bool /** * Checks whether the last value assigned was used. - * - * @return bool */ public function isUsed(): bool { @@ -722,8 +638,6 @@ public function isUsed(): bool /** * Shortcut is type variable? - * - * @return bool */ public function isVariable(): bool { @@ -732,8 +646,6 @@ public function isVariable(): bool /** * Get if the variable must be initialized to null. - * - * @return bool */ public function mustInitNull(): bool { @@ -743,8 +655,6 @@ public function mustInitNull(): bool /** * Observes a variable in the memory frame without initialization or nullify * an existing allocated variable. - * - * @param CompilationContext $compilationContext */ public function observeOrNullifyVariant(CompilationContext $compilationContext): void { @@ -774,8 +684,6 @@ public function observeOrNullifyVariant(CompilationContext $compilationContext): /** * Observes a variable in the memory frame without initialization. - * - * @param CompilationContext $compilationContext */ public function observeVariant(CompilationContext $compilationContext): void { @@ -808,8 +716,6 @@ public function observeVariant(CompilationContext $compilationContext): void /** * Separates variables before being updated. - * - * @param CompilationContext $compilationContext */ public function separate(CompilationContext $compilationContext): void { @@ -822,8 +728,6 @@ public function separate(CompilationContext $compilationContext): void /** * Sets the PHP class related to variable. - * - * @param ReflectionClass|Definition $associatedClass */ public function setAssociatedClass(ReflectionClass | Definition $associatedClass): void { @@ -832,8 +736,6 @@ public function setAssociatedClass(ReflectionClass | Definition $associatedClass /** * Sets the PHP class related to variable. - * - * @param array|string $classTypes */ public function setClassTypes(array | string $classTypes): void { @@ -854,8 +756,6 @@ public function setClassTypes(array | string $classTypes): void /** * Sets the default init value. - * - * @param mixed $value */ public function setDefaultInitValue(mixed $value): void { @@ -864,8 +764,6 @@ public function setDefaultInitValue(mixed $value): void /** * Sets the current dynamic type in a polymorphic variable. - * - * @param array|string $types */ public function setDynamicTypes(array | string $types): void { @@ -884,8 +782,6 @@ public function setDynamicTypes(array | string $types): void /** * Once a temporal variable is unused in a specific branch it is marked as idle. - * - * @param bool $idle */ public function setIdle(bool $idle): void { @@ -900,8 +796,6 @@ public function setIdle(bool $idle): void /** * Marks the variable to be defined as a double pointer. - * - * @param bool $doublePointer */ public function setIsDoublePointer(bool $doublePointer): void { @@ -910,8 +804,6 @@ public function setIsDoublePointer(bool $doublePointer): void /** * Set if the symbol is a parameter of the method or not. - * - * @param bool $isExternal */ public function setIsExternal(bool $isExternal): void { @@ -922,9 +814,6 @@ public function setIsExternal(bool $isExternal): void /** * Sets if the variable is initialized * This allow to throw an exception if the variable is being read without prior initialization. - * - * @param bool $initialized - * @param CompilationContext $compilationContext */ public function setIsInitialized(bool $initialized, CompilationContext $compilationContext): void { @@ -943,8 +832,6 @@ public function setIsInitialized(bool $initialized, CompilationContext $compilat /** * Sets if the variable is local-only scoped. - * - * @param bool $localOnly */ public function setLocalOnly(bool $localOnly): void { @@ -953,8 +840,6 @@ public function setLocalOnly(bool $localOnly): void /** * Sets the compiled variable's name. - * - * @param string $lowName */ public function setLowName(string $lowName): void { @@ -963,8 +848,6 @@ public function setLowName(string $lowName): void /** * Sets if the variable is not tracked by the memory manager. - * - * @param bool $memoryTracked */ public function setMemoryTracked(bool $memoryTracked): void { @@ -973,8 +856,6 @@ public function setMemoryTracked(bool $memoryTracked): void /** * Set if the variable must be initialized to null. - * - * @param bool $mustInitNull */ public function setMustInitNull(bool $mustInitNull): void { @@ -983,8 +864,6 @@ public function setMustInitNull(bool $mustInitNull): void /** * Set the original AST node where the variable was declared. - * - * @param array $node */ public function setOriginal(array $node): void { @@ -993,11 +872,11 @@ public function setOriginal(array $node): void /** * Sets the latest CompiledExpression assigned to a variable. - * - * @param CompiledExpression $possibleValue - * @param CompilationContext $compilationContext */ - public function setPossibleValue(CompiledExpression $possibleValue, CompilationContext $compilationContext): void + public function setPossibleValue( + CompiledExpression $possibleValue, + CompilationContext $compilationContext, + ): void { $this->possibleValue = $possibleValue; $this->possibleValueBranch = $compilationContext->branchManager->getCurrentBranch(); @@ -1005,8 +884,6 @@ public function setPossibleValue(CompiledExpression $possibleValue, CompilationC /** * Sets if the variable is read only. - * - * @param bool $readOnly */ public function setReadOnly(bool $readOnly): void { @@ -1015,8 +892,6 @@ public function setReadOnly(bool $readOnly): void /** * Some temporary variables can't be reused. - * - * @param bool $reusable */ public function setReusable(bool $reusable): void { @@ -1025,8 +900,6 @@ public function setReusable(bool $reusable): void /** * Sets whether the variable is temporal or not. - * - * @param bool $temporal */ public function setTemporal(bool $temporal): void { @@ -1035,8 +908,6 @@ public function setTemporal(bool $temporal): void /** * Sets the type of variable. - * - * @param string $type */ public function setType(string $type): void { @@ -1045,9 +916,6 @@ public function setType(string $type): void /** * Sets the latest node where a variable was used. - * - * @param bool $used - * @param array|null $node */ public function setUsed(bool $used, ?array $node = null): void { @@ -1057,8 +925,6 @@ public function setUsed(bool $used, ?array $node = null): void /** * Skips variable initialization. - * - * @param int $numberSkips */ public function skipInitVariant(int $numberSkips): void { @@ -1067,8 +933,6 @@ public function skipInitVariant(int $numberSkips): void /** * Tells the compiler a generated code will track the variable. - * - * @param CompilationContext $compilationContext */ public function trackVariant(CompilationContext $compilationContext): void {