Skip to content

Commit

Permalink
Fix usage of a <-> an in comments and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
MoonE committed Nov 10, 2024
1 parent 0f796f1 commit be04deb
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion docs/annotating_code/type_syntax/top_bottom_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<never, never>`, 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
2 changes: 1 addition & 1 deletion docs/running_psalm/issues/TaintedHeader.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/running_psalm/issues/TaintedHtml.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docs/running_psalm/issues/TaintedSSRF.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/running_psalm/issues/TaintedSql.md
Original file line number Diff line number Diff line change
@@ -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
<?php
Expand Down
2 changes: 1 addition & 1 deletion docs/running_psalm/issues/TaintedTextWithQuotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Emitted when user-controlled input that can contain quotation marks can be passe

## 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
Expand Down
4 changes: 2 additions & 2 deletions docs/running_psalm/plugins/authoring_plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ class SomePlugin implements \Psalm\Plugin\EventHandler\AfterStatementAnalysisInt
- `AfterFunctionCallAnalysisInterface` - called after Psalm evaluates a function call to any function defined within the project itself. Can alter the return type or perform modifications of the call.
- `AfterFunctionLikeAnalysisInterface` - called after Psalm has completed its analysis of a given function-like.
- `AfterMethodCallAnalysisInterface` - called after Psalm analyzes a method call.
- `BeforeStatementAnalysisInterface` - called before Psalm evaluates an statement.
- `AfterStatementAnalysisInterface` - called after Psalm evaluates an statement.
- `BeforeStatementAnalysisInterface` - called before Psalm evaluates a statement.
- `AfterStatementAnalysisInterface` - called after Psalm evaluates a statement.
- `BeforeAddIssueInterface` - called before Psalm adds an item to it's internal `IssueBuffer`, allows handling code issues individually
- `BeforeFileAnalysisInterface` - called before Psalm analyzes a file.
- `FunctionExistenceProviderInterface` - can be used to override Psalm's builtin function existence checks for one or more functions.
Expand Down
2 changes: 1 addition & 1 deletion phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
</rule>

<!--
Requires using a underscore separator for long numbers.
Requires using an underscore separator for long numbers.
https://github.com/slevomat/coding-standard/#slevomatcodingstandardnumbersrequirenumericliteralseparator
-->
<rule ref="SlevomatCodingStandard.Numbers.RequireNumericLiteralSeparator">
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Type/Atomic.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions src/Psalm/Type/UnionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
trait UnionTrait
{
/**
* Constructs an Union instance
* Constructs a Union instance
*
* @psalm-external-mutation-free
* @param non-empty-array<Atomic> $types
Expand Down Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion stubs/CoreGenericClasses.phpstub
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit be04deb

Please sign in to comment.