diff --git a/docs/annotating_code/type_syntax/top_bottom_types.md b/docs/annotating_code/type_syntax/top_bottom_types.md index ead9ffcfd4e..83a04e927c6 100644 --- a/docs/annotating_code/type_syntax/top_bottom_types.md +++ b/docs/annotating_code/type_syntax/top_bottom_types.md @@ -12,6 +12,6 @@ It can be aliased to `no-return` or `never-return` in docblocks. Note: it replac This is the _bottom type_ in PHP's type system. It's used to describe a type that has no possible value. It can happen in multiple cases: - the actual `never` type from PHP 8.1 (can be used in docblocks for older versions). This type can be used as a return type for functions that will never return, either because they always throw exceptions or always exit() -- an union type that have been stripped for all its possible types. (For example, if a variable is `string|int` and we perform a is_bool() check in a condition, the type of the variable in the condition will be `never` as the condition will never be entered) +- a union type that has been stripped of all its possible types. (For example, if a variable is `string|int` and we perform an is_bool() check in a condition, the type of the variable in the condition will be `never` as the condition will never be entered) - it can represent a placeholder for types yet to come — a good example is the type of the empty array `[]`, which Psalm types as `array`, the content of the array is void so it can accept any content - it can also happen in the same context as the line above for templates that have yet to be defined diff --git a/docs/running_psalm/issues/TaintedHeader.md b/docs/running_psalm/issues/TaintedHeader.md index f98e61977c1..767e8ba5e7c 100644 --- a/docs/running_psalm/issues/TaintedHeader.md +++ b/docs/running_psalm/issues/TaintedHeader.md @@ -1,6 +1,6 @@ # TaintedHeader -Potential header injection. This rule is emitted when user-controlled input can be passed into a HTTP header. +Potential header injection. This rule is emitted when user-controlled input can be passed into an HTTP header. ## Risk diff --git a/docs/running_psalm/issues/TaintedHtml.md b/docs/running_psalm/issues/TaintedHtml.md index ff8add010c3..8187338b9b7 100644 --- a/docs/running_psalm/issues/TaintedHtml.md +++ b/docs/running_psalm/issues/TaintedHtml.md @@ -4,7 +4,7 @@ Emitted when user-controlled input that can contain HTML can be passed into to a ## Risk -This could lead to a potential Cross Site Scripting (XSS) vulnerability. Using a XSS vulnerability, an attacker could inject malicious JavaScript and execute any action JavaScript could do. Examples include: +This could lead to a potential Cross Site Scripting (XSS) vulnerability. Using an XSS vulnerability, an attacker could inject malicious JavaScript and execute any action JavaScript could do. Examples include: - Stealing authentication material (e.g. cookies, JWT tokens) - Exfiltrate sensitive information by reading the DOM diff --git a/docs/running_psalm/issues/TaintedSSRF.md b/docs/running_psalm/issues/TaintedSSRF.md index 650655f65ca..a688a3d96af 100644 --- a/docs/running_psalm/issues/TaintedSSRF.md +++ b/docs/running_psalm/issues/TaintedSSRF.md @@ -4,9 +4,9 @@ Potential Server-Side Request Forgery vulnerability. This rule is emitted when u ## Risk -Passing untrusted user input to network requests could be dangerous. +Passing untrusted user input to network requests could be dangerous. -If an attacker can fully control a HTTP request they could connect to internal services. Depending on the nature of these, this can pose a security risk. (e.g. backend services, admin interfaces, AWS metadata, ...) +If an attacker can fully control an HTTP request they could connect to internal services. Depending on the nature of these, this can pose a security risk. (e.g. backend services, admin interfaces, AWS metadata, ...) ## Example diff --git a/docs/running_psalm/issues/TaintedSql.md b/docs/running_psalm/issues/TaintedSql.md index 6b6b1f2a449..c3c75f69794 100644 --- a/docs/running_psalm/issues/TaintedSql.md +++ b/docs/running_psalm/issues/TaintedSql.md @@ -1,6 +1,6 @@ # TaintedSql -Emitted when user-controlled input can be passed into to a SQL command. +Emitted when user-controlled input can be passed into to an SQL command. ```php diff --git a/src/Psalm/Context.php b/src/Psalm/Context.php index bf73229560a..972d9baba53 100644 --- a/src/Psalm/Context.php +++ b/src/Psalm/Context.php @@ -115,7 +115,7 @@ final class Context public $inside_unset = false; /** - * Whether or not we're inside an class_exists call, where + * Whether or not we're inside a class_exists call, where * we don't care about possibly undefined classes * * @var bool diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php index 9bc860de44d..22a8d40f996 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php @@ -1151,7 +1151,7 @@ private static function handleArrayAccessOnArray( $single_atomic = $key_values[0]; $from_mixed_array = $type->type_params[1]->isMixed(); - // ok, type becomes an TKeyedArray + // ok, type becomes a TKeyedArray $type = new TKeyedArray( [ $single_atomic->value => $from_mixed_array ? Type::getMixed() : Type::getNever(), diff --git a/src/Psalm/Type/Atomic.php b/src/Psalm/Type/Atomic.php index c6a247d769d..7add3b2675f 100644 --- a/src/Psalm/Type/Atomic.php +++ b/src/Psalm/Type/Atomic.php @@ -425,7 +425,7 @@ private static function createInner( /** * This is the string that will be used to represent the type in Union::$types. This means that two types sharing - * the same getKey value will override themselves in an Union + * the same getKey value will override themselves in a Union */ abstract public function getKey(bool $include_extra = true): string; diff --git a/src/Psalm/Type/UnionTrait.php b/src/Psalm/Type/UnionTrait.php index b471b795df3..7e397bf0923 100644 --- a/src/Psalm/Type/UnionTrait.php +++ b/src/Psalm/Type/UnionTrait.php @@ -61,7 +61,7 @@ trait UnionTrait { /** - * Constructs an Union instance + * Constructs a Union instance * * @psalm-external-mutation-free * @param non-empty-array $types @@ -1247,7 +1247,7 @@ public function hasLiteralInt(): bool /** * @psalm-mutation-free - * @return bool true if this is a int literal with only one possible value + * @return bool true if this is an int literal with only one possible value */ public function isSingleIntLiteral(): bool { diff --git a/stubs/CoreGenericClasses.phpstub b/stubs/CoreGenericClasses.phpstub index 93cb8cb42f0..74dbe1ddd2a 100644 --- a/stubs/CoreGenericClasses.phpstub +++ b/stubs/CoreGenericClasses.phpstub @@ -74,7 +74,7 @@ class Generator implements Traversable { interface ArrayAccess { /** - * Whether a offset exists + * Whether an offset exists * @link http://php.net/manual/en/arrayaccess.offsetexists.php * * @param TKey $offset An offset to check for.