Skip to content

Commit

Permalink
Fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
szepeviktor committed Jan 20, 2025
1 parent 5abbdf3 commit 2e20c87
Show file tree
Hide file tree
Showing 47 changed files with 83 additions and 83 deletions.
2 changes: 1 addition & 1 deletion docs/contributing/adding_issues.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ There a number of abstract classes you can extend:
* `FunctionIssue` - issue related to a specific function. Can be suppressed with `referencedFunction` attribute.
* `ArgumentIssue` - issue related to a specific argument. Can be targeted with `referencedFunction` attribute.
* `MethodIssue` - issue related to a specific method. Can be targeted with `referencedMethod` attribute.
* `ClassConstantIssue` - issue related ot a specific class constant. Can be targeted with `referencedConstant`.
* `ClassConstantIssue` - issue related to a specific class constant. Can be targeted with `referencedConstant`.
* `VariableIssue` - issue for a specific variable. Targeted with `referencedVariable`

## Add a `config.xsd` entry
Expand Down
2 changes: 1 addition & 1 deletion docs/contributing/philosophy.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ All other functionality – the language server, security analysis, manipulating

Psalm is almost always run on PHP code that parses a lint check (`php -l <filename>`) – i.e. syntactically-correct code. Psalm is not a replacement for that syntax check.

Given Psalm is almost always used on syntatically-correct code it should use a parser built for that purpose, and `nikic/php-parser` is the gold-standard.
Given Psalm is almost always used on syntactically-correct code it should use a parser built for that purpose, and `nikic/php-parser` is the gold-standard.

Where Psalm needs to run on syntactically-incorrect code (e.g. in language server mode) Psalm should still use the same parser (and work around any issues that it produces).

Expand Down
2 changes: 1 addition & 1 deletion docs/running_psalm/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Read more about plugins in [Using Plugins chapter](plugins/using_plugins.md).
Sometimes your project can conflict with one or more of Psalm’s dependencies. In
that case you may find the Phar (a self-contained PHP executable) useful.

The Phar can be downloaded from Github:
The Phar can be downloaded from GitHub:

```bash
wget https://github.com/vimeo/psalm/releases/latest/download/psalm.phar
Expand Down
2 changes: 1 addition & 1 deletion docs/running_psalm/issues/DirectConstructorCall.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DirectConstructorCall

Emitted when `__construct()` is called directly as a method. Constructors are supposed to be called implicitely, as a result of `new ClassName` statement.
Emitted when `__construct()` is called directly as a method. Constructors are supposed to be called implicitly, as a result of `new ClassName` statement.

```php
<?php
Expand Down
2 changes: 1 addition & 1 deletion docs/running_psalm/issues/InvalidOverride.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class A {

class B extends A {
#[Override]
function recieve(): void
function obtain(): void
{
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/running_psalm/issues/MissingConstructor.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MissingConstructor

Unitialized properties are statically hard to analyze. To prevent mistakes, Psalm will enforce that all properties should be initialized.
Uninitialized properties are statically hard to analyze. To prevent mistakes, Psalm will enforce that all properties should be initialized.

It does that through [PropertyNotSetInConstructor](./PropertyNotSetInConstructor.md) and this issue.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# RedundantPropertyInitializationCheck

Unitialized properties are hard to statically analyze. To prevent mistakes, Psalm will enforce that all properties should be initialized.
Uninitialized properties are hard to statically analyze. To prevent mistakes, Psalm will enforce that all properties should be initialized.

It does that through [PropertyNotSetInConstructor](./PropertyNotSetInConstructor.md) and [MissingConstructor](./MissingConstructor.md).

Expand Down
2 changes: 1 addition & 1 deletion docs/running_psalm/plugins/authoring_plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### Using a template repository

Head over to [plugin template repository](https://github.com/weirdan/psalm-plugin-skeleton) on Github, login and click `Use this template` button.
Head over to [plugin template repository](https://github.com/weirdan/psalm-plugin-skeleton) on GitHub, login and click `Use this template` button.

### Using skeleton project

Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ final class Context
/**
* A set of references that might still be in scope from a scope likely to cause confusion. This applies
* to references set inside a loop or if statement, since it's easy to forget about PHP's weird scope
* rules, and assinging to a reference will change the referenced variable rather than shadowing it.
* rules, and assigning to a reference will change the referenced variable rather than shadowing it.
*
* @var array<string, CodeLocation>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ private static function checkFunctionLikeTypeMatches(
$readonly_template_result = new TemplateResult($class_generic_params, []);

// This flag ensures that the template results will never be written to
// It also supercedes the `$add_lower_bounds` flag so that closure params
// It also supersedes the `$add_lower_bounds` flag so that closure params
// don’t get overwritten
$readonly_template_result->readonly = true;

Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Internal/Cli/Psalm.php
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ private static function restart(array $options, int $threads, Progress $progress

$ini_handler->disableExtensions([
'uopz',
// extesions that are incompatible with JIT (they are also usually make Psalm slow)
// extensions that are incompatible with JIT (they are also usually make Psalm slow)
'pcov',
'blackfire',
]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ protected function fillScrutinizer(): self
}

/**
* Fill Github Actions environment variables.
* Fill GitHub Actions environment variables.
*
* @return $this
* @psalm-suppress PossiblyUndefinedStringArrayOffset
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Internal/LanguageServer/Server/Workspace.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function didChangeWatchedFiles(array $changes): void
continue;
}

//If the file is currently open then dont analize it because its tracked in didChange
//If the file is currently open then dont analyze it because its tracked in didChange
if (!$this->codebase->file_provider->isOpen($file_path)) {
$this->server->queueClosedFileAnalysis($file_path, $change->uri);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Internal/Type/AssertionReconciler.php
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ private static function refine(
}

/**
* This method receives two types. The goal is to use datas in the new type to reduce the existing_type to a more
* This method receives two types. The goal is to use data in the new type to reduce the existing_type to a more
* precise version. For example: new is `array<int>` old is `list<mixed>` so the result is `list<int>`
*/
private static function filterTypeWithAnother(
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Internal/Type/Comparator/UnionTypeComparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ public static function canExpressionTypesBeIdentical(
foreach (self::getTypeParts($codebase, $type1) as $type1_part) {
foreach (self::getTypeParts($codebase, $type2) as $type2_part) {
//special case for TIntRange because it can contain a part of another TIntRange.
//For exemple int<0,10> and int<5, 15> can be identical but none contain the other
//For example int<0,10> and int<5, 15> can be identical but none contain the other
if ($type1_part instanceof TIntRange && $type2_part instanceof TIntRange) {
$intersection_range = TIntRange::intersectIntRanges(
$type1_part,
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Internal/Type/NegatedAssertionReconciler.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public static function reconcile(
&& $assertion_type instanceof TNamedObject
&& isset($existing_var_type->getAtomicTypes()[$assertion_type->getKey()])
) {
// checking if two types share a common parent is not enough to guarantee childs are instanceof each other
// checking if two types share a common parent is not enough to guarantee children are instanceof each other
// fall through
} elseif ($existing_var_type->isArray()
&& ($assertion->getAtomicType() instanceof TArray
Expand Down
4 changes: 2 additions & 2 deletions src/Psalm/Internal/Type/TypeParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -717,15 +717,15 @@ private static function getTypeFromGenericTree(
}

if ($generic_type_value === 'arraylike-object') {
$array_acccess = new TGenericObject('ArrayAccess', $generic_params, false, false, [], $from_docblock);
$array_access = new TGenericObject('ArrayAccess', $generic_params, false, false, [], $from_docblock);
$countable = new TNamedObject('Countable', false, false, [], $from_docblock);
return new TGenericObject(
'Traversable',
$generic_params,
false,
false,
[
$array_acccess->getKey() => $array_acccess,
$array_access->getKey() => $array_access,
$countable->getKey() => $countable,
],
$from_docblock,
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 @@ -701,7 +701,7 @@ final public function __toString(): string
}

/**
* This is the true identifier for the type. It defaults to self::getKey() but can be overrided to be more precise
* This is the true identifier for the type. It defaults to self::getKey() but can be overridden to be more precise
*/
public function getId(bool $exact = true, bool $nested = false): string
{
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Type/Atomic/TKeyedArray.php
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ private function escapeAndQuote($name)
}

if (preg_match('/^-?[1-9][0-9]*$/', $name)
&& (string)(int) $name !== $name // overflow occured
&& (string)(int) $name !== $name // overflow occurred
) {
$quote = true;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Psalm/Type/Atomic/TPropertiesOf.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

/**
* Type that resolves to a keyed-array with properties of a class as keys and
* their apropriate types as values.
* their appropriate types as values.
*
* @psalm-type TokenName = 'properties-of'|'public-properties-of'|'protected-properties-of'|'private-properties-of'
* @psalm-immutable
Expand All @@ -15,7 +15,7 @@ final class TPropertiesOf extends Atomic
{
// These should match the values of
// `Psalm\Internal\Analyzer\ClassLikeAnalyzer::VISIBILITY_*`, as they are
// used to compared against properties visibililty.
// used to compared against properties visibility.
public const VISIBILITY_PUBLIC = 1;
public const VISIBILITY_PROTECTED = 2;
public const VISIBILITY_PRIVATE = 3;
Expand Down
4 changes: 2 additions & 2 deletions tests/AnnotationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ function example(string $_x) : void {}',
$arr["a"]();',
],
'multipeLineGenericArray' => [
'multipleLineGenericArray' => [
'code' => '<?php
/**
* @psalm-type MiddlewareArray = array<
Expand All @@ -513,7 +513,7 @@ function example(string $_x) : void {}',
*/
class A {}',
],
'multipeLineGenericArray2' => [
'multipleLineGenericArray2' => [
'code' => '<?php
/**
* @psalm-type TRelAlternate =
Expand Down
2 changes: 1 addition & 1 deletion tests/ArrayAccessTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ function f(array $p): void
'$e' => 'DOMElement|null',
],
],
'getOnArrayAcccess' => [
'getOnArrayAccess' => [
'code' => '<?php
/** @param ArrayAccess<int, string> $a */
function foo(ArrayAccess $a) : string {
Expand Down
6 changes: 3 additions & 3 deletions tests/ArrayFunctionCallTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,7 @@ function mapdef(string $_a, int $_b = 0): string {
',
'assertions' => [
'$a===' => 'list{0, 0, 0}',
// Techinically this doesn't cover the case of running on 8.0 but nvm
// Technically this doesn't cover the case of running on 8.0 but nvm
'$b===' => 'array{-1: 0, 0: 0, 1: 0}',
'$c===' => 'array{-2: 0, 0: 0, 1: 0}',
],
Expand Down Expand Up @@ -2700,7 +2700,7 @@ function takes_non_empty_array(array $input): void {}
public function providerInvalidCodeParse(): iterable
{
return [
'arrayFilterUseMethodOnInferrableInt' => [
'arrayFilterUseMethodOnInferableInt' => [
'code' => '<?php
$a = array_filter([1, 2, 3, 4], function ($i) { return $i->foo(); });',
'error_message' => 'InvalidMethodCall',
Expand Down Expand Up @@ -2746,7 +2746,7 @@ public function providerInvalidCodeParse(): iterable
array_filter($arg, "strlen", ARRAY_FILTER_USE_KEY);',
'error_message' => 'InvalidScalarArgument',
],
'arrayMapUseMethodOnInferrableInt' => [
'arrayMapUseMethodOnInferableInt' => [
'code' => '<?php
$a = array_map(function ($i) { return $i->foo(); }, [1, 2, 3, 4]);',
'error_message' => 'InvalidMethodCall',
Expand Down
6 changes: 3 additions & 3 deletions tests/AssertAnnotationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function requiresString(string $_str): void {}
$this->analyzeFile('somefile.php', new Context());
}

public function testAssertsAllongCallStaticMethodWork(): void
public function testAssertsAlongCallStaticMethodWork(): void
{
$this->addFile(
'somefile.php',
Expand Down Expand Up @@ -150,7 +150,7 @@ function assertNotSame($expected, $actual) : void {}
public function providerValidCodeParse(): iterable
{
return [
'implictAssertInstanceOfB' => [
'implicitAssertInstanceOfB' => [
'code' => '<?php
namespace Bar;
Expand Down Expand Up @@ -249,7 +249,7 @@ function bar(?string $s) : string {
return $s;
}',
],
'implictAssertInstanceOfInterface' => [
'implicitAssertInstanceOfInterface' => [
'code' => '<?php
namespace Bar;
Expand Down
2 changes: 1 addition & 1 deletion tests/CallableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3376,7 +3376,7 @@ function foo(string $c) : void {
}',
'error_message' => 'InvalidArgument',
],
'inexistantCallableinCallableString' => [
'inexistentCallableinCallableString' => [
'code' => '<?php
/**
* @param callable-string $c
Expand Down
4 changes: 2 additions & 2 deletions tests/ClassTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ function foo(string $s) : void {
}
}',
],
'classAliasOnNonexistantClass' => [
'classAliasOnNonexistentClass' => [
'code' => '<?php
if (!class_exists(\PHPUnit\Framework\TestCase::class)) {
/** @psalm-suppress UndefinedClass */
Expand Down Expand Up @@ -1156,7 +1156,7 @@ function foo(A $a): B {
class A extends A {}',
'error_message' => 'CircularReference',
],
'preventAbstractInstantiationDefiniteClasss' => [
'preventAbstractInstantiationDefiniteClass' => [
'code' => '<?php
abstract class A {}
Expand Down
4 changes: 2 additions & 2 deletions tests/ClosureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ private function handler(): void {
'ignored_issues' => [],
'php_version' => '8.1',
],
'arrowFunctionReturnsNeverImplictly' => [
'arrowFunctionReturnsNeverImplicitly' => [
'code' => '<?php
$bar = ["foo", "bar"];
Expand All @@ -931,7 +931,7 @@ private function handler(): void {
'ignored_issues' => [],
'php_version' => '8.1',
],
'arrowFunctionReturnsNeverExplictly' => [
'arrowFunctionReturnsNeverExplicitly' => [
'code' => '<?php
$bar = ["foo", "bar"];
Expand Down
4 changes: 2 additions & 2 deletions tests/ConstantTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2437,7 +2437,7 @@ enum State {
'ignored_issues' => [],
'php_version' => '8.1',
],
'returnValueofNonExistantConstant' => [
'returnValueofNonExistentConstant' => [
'code' => '<?php
class Foo
{
Expand Down Expand Up @@ -2471,7 +2471,7 @@ public function bar(): string
',
'error_message' => 'UnresolvableConstant',
],
'takeKeyofNonExistantConstant' => [
'takeKeyofNonExistentConstant' => [
'code' => '<?php
class Foo
{
Expand Down
4 changes: 2 additions & 2 deletions tests/DeprecatedAnnotationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,10 @@ class Bar
/**
* @deprecated
*/
public static bool $deprecatedPropery = false;
public static bool $deprecatedProperty = false;
}
Bar::$deprecatedPropery;
Bar::$deprecatedProperty;
',
'error_message' => 'DeprecatedProperty',
],
Expand Down
8 changes: 4 additions & 4 deletions tests/ErrorBaselineTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -353,26 +353,26 @@ public function testCreateShouldAggregateIssuesPerFile(): void
$this->assertSame(
3,
count($file1Issues[0]->getElementsByTagName('code')),
'MixedAssignment should have occured 3 times',
'MixedAssignment should have occurred 3 times',
);
$this->assertSame('MixedOperand', $file1Issues[1]->tagName);
$this->assertSame(
1,
count($file1Issues[1]->getElementsByTagName('code')),
'MixedOperand should have occured 1 time',
'MixedOperand should have occurred 1 time',
);

$this->assertSame('MixedAssignment', $file2Issues[0]->tagName);
$this->assertSame(
2,
count($file2Issues[0]->getElementsByTagName('code')),
'MixedAssignment should have occured 2 times',
'MixedAssignment should have occurred 2 times',
);
$this->assertSame('TypeCoercion', $file2Issues[1]->tagName);
$this->assertSame(
1,
count($file2Issues[1]->getElementsByTagName('code')),
'TypeCoercion should have occured 1 time',
'TypeCoercion should have occurred 1 time',
);

return true;
Expand Down
Loading

0 comments on commit 2e20c87

Please sign in to comment.