Skip to content

Commit 6ad68ac

Browse files
authored
Fix typos (#611)
1 parent 07c1764 commit 6ad68ac

File tree

10 files changed

+22
-22
lines changed

10 files changed

+22
-22
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Additionally errors in code handling the results of sql queries can be detected.
66

77
This extension provides the following features, as long as you [stick to the rules](https://staabm.github.io/2022/07/23/phpstan-dba-inference-placeholder.html#the-golden-phpstan-dba-rules):
88

9-
* [result set type-inferrence](https://staabm.github.io/2022/06/19/phpstan-dba-type-inference.html)
9+
* [result set type-inference](https://staabm.github.io/2022/06/19/phpstan-dba-type-inference.html)
1010
* [detect errors in sql queries](https://staabm.github.io/2022/08/05/phpstan-dba-syntax-error-detection.html)
1111
* [detect placeholder/bound value mismatches](https://staabm.github.io/2022/07/30/phpstan-dba-placeholder-validation.html)
1212
* [query plan analysis](https://staabm.github.io/2022/08/16/phpstan-dba-query-plan-analysis.html) to detect performance issues

docs/pgsql.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
PGSQL/PostgresSQL is supported since `phpstandba 0.2.26`.
44

5-
While the `phpstandba` engine requires `pdo-pgsql` at analysis time, the codebase beeing analyzed can either use Doctrine DBAL or PDO.
5+
While the `phpstandba` engine requires `pdo-pgsql` at analysis time, the codebase being analyzed can either use Doctrine DBAL or PDO.
66

77
**Note:** ["Record and Replay" is not yet supported on the PGSQL driver](https://github.com/staabm/phpstan-dba/issues/353)
88

docs/rules.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ services:
5050
- 'Deployer\runMysqlQuery#0'
5151
```
5252

53-
__the callable format is `funtionName#parameterIndex`, while the parameter-index defines the position of the query-string argument.__
53+
__the callable format is `functionName#parameterIndex`, while the parameter-index defines the position of the query-string argument.__
5454

5555
## use `DoctrineKeyValueStyleRule` for your custom classes
5656

src/Extensions/PdoStatementExecuteTypeSpecifyingExtension.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ public function specifyTypes(MethodReflection $methodReflection, MethodCall $nod
4646
$methodCall = $node;
4747

4848
try {
49-
$inferedType = $this->inferStatementType($methodReflection, $methodCall, $scope);
49+
$inferredType = $this->inferStatementType($methodReflection, $methodCall, $scope);
5050
} catch (UnresolvableQueryException $e) {
5151
return new SpecifiedTypes();
5252
}
5353

54-
if (null !== $inferedType) {
55-
return $this->typeSpecifier->create($methodCall->var, $inferedType, TypeSpecifierContext::createTruthy(), true);
54+
if (null !== $inferredType) {
55+
return $this->typeSpecifier->create($methodCall->var, $inferredType, TypeSpecifierContext::createTruthy(), true);
5656
}
5757

5858
return new SpecifiedTypes();

src/QueryReflection/QuerySimulation.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,17 +148,17 @@ public static function stripTrailers(string $queryString): ?string
148148
// XXX someday we will use a proper SQL parser
149149
$queryString = rtrim($queryString);
150150

151-
// strip trailling delimiting semicolon
151+
// strip trailing delimiting semicolon
152152
$queryString = rtrim($queryString, ';');
153153

154-
// strip trailling FOR UPDATE/FOR SHARE
154+
// strip trailing FOR UPDATE/FOR SHARE
155155
$queryString = preg_replace('/(.*)FOR (UPDATE|SHARE)\s*(SKIP\s+LOCKED|NOWAIT)?$/i', '$1', $queryString);
156156

157157
if (null === $queryString) {
158-
throw new ShouldNotHappenException('Could not strip trailling FOR UPDATE/SHARE from query');
158+
throw new ShouldNotHappenException('Could not strip trailing FOR UPDATE/SHARE from query');
159159
}
160160

161-
// strip trailling OFFSET
161+
// strip trailing OFFSET
162162
$queryString = preg_replace('/(.*)OFFSET\s+["\']?\d+["\']?\s*$/i', '$1', $queryString);
163163

164164
if (null === $queryString) {

src/SqlAst/ConcatReturnTypeExtension.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function getReturnType(FunctionCall $expression, QueryScope $scope): Type
2929
$args = $expression->getArguments();
3030

3131
$results = [];
32-
$containtsNull = false;
32+
$containsNull = false;
3333
$allNumeric = true;
3434
$isNonFalsyString = false;
3535
$isNonEmptyString = false;
@@ -43,7 +43,7 @@ public function getReturnType(FunctionCall $expression, QueryScope $scope): Type
4343
}
4444

4545
if (TypeCombinator::containsNull($argType)) {
46-
$containtsNull = true;
46+
$containsNull = true;
4747
}
4848
}
4949

@@ -75,7 +75,7 @@ public function getReturnType(FunctionCall $expression, QueryScope $scope): Type
7575

7676
$results[] = TypeCombinator::intersect(new StringType(), ...$accessories);
7777

78-
if ($containtsNull) {
78+
if ($containsNull) {
7979
$results[] = new NullType();
8080
}
8181

tests/default/data/pdo-prepare.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public function noInferenceOnBug196(PDO $pdo, array $minorPhpVersions, \DateTime
119119
'SELECT '.implode(', ', $sumQueries).' FROM ada WHERE adaid = :package'
120120
);
121121
$stmt->execute(['package' => 'abc']);
122-
// this query is too dynamic for beeing analyzed.
122+
// this query is too dynamic for being analyzed.
123123
// make sure we don't infer a wrong type.
124124
assertType('PDOStatement', $stmt);
125125
}

tests/defaultFetchAssoc/data/modes.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function assocModeFetch(PDO $pdo)
2626
assertType('array{email: string, adaid: int<-32768, 32767>}|false', $result);
2727
}
2828

29-
public function assocModeFetchOverriden(PDO $pdo)
29+
public function assocModeFetchOverridden(PDO $pdo)
3030
{
3131
$stmt = $pdo->prepare('SELECT email, adaid FROM ada');
3232
assertType('PDOStatement<array{email: string, adaid: int<-32768, 32767>}>', $stmt);
@@ -36,15 +36,15 @@ public function assocModeFetchOverriden(PDO $pdo)
3636
assertType('array{string, int<-32768, 32767>}|false', $result);
3737
}
3838

39-
public function assocModeQueryFetchOverriden(PDO $pdo)
39+
public function assocModeQueryFetchOverridden(PDO $pdo)
4040
{
4141
$stmt = $pdo->query('SELECT email, adaid FROM ada');
4242
assertType('PDOStatement<array{email: string, adaid: int<-32768, 32767>}>', $stmt);
4343
$result = $stmt->fetch(PDO::FETCH_NUM);
4444
assertType('array{string, int<-32768, 32767>}|false', $result);
4545
}
4646

47-
public function assocModeQueryOverriden(PDO $pdo)
47+
public function assocModeQueryOverridden(PDO $pdo)
4848
{
4949
$stmt = $pdo->query('SELECT email, adaid FROM ada', PDO::FETCH_NUM);
5050
assertType('PDOStatement<array{string, int<-32768, 32767>}>', $stmt);

tests/defaultFetchNumeric/data/modes.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function numericModeFetch(PDO $pdo)
2626
assertType('array{string, int<-32768, 32767>}|false', $result);
2727
}
2828

29-
public function numericModeFetchOverriden(PDO $pdo)
29+
public function numericModeFetchOverridden(PDO $pdo)
3030
{
3131
$stmt = $pdo->prepare('SELECT email, adaid FROM ada');
3232
assertType('PDOStatement<array{string, int<-32768, 32767>}>', $stmt);
@@ -36,15 +36,15 @@ public function numericModeFetchOverriden(PDO $pdo)
3636
assertType('array{email: string, adaid: int<-32768, 32767>}|false', $result);
3737
}
3838

39-
public function numericModeQueryFetchOverriden(PDO $pdo)
39+
public function numericModeQueryFetchOverridden(PDO $pdo)
4040
{
4141
$stmt = $pdo->query('SELECT email, adaid FROM ada');
4242
assertType('PDOStatement<array{string, int<-32768, 32767>}>', $stmt);
4343
$result = $stmt->fetch(PDO::FETCH_ASSOC);
4444
assertType('array{email: string, adaid: int<-32768, 32767>}|false', $result);
4545
}
4646

47-
public function numericModeQueryOverriden(PDO $pdo)
47+
public function numericModeQueryOverridden(PDO $pdo)
4848
{
4949
$stmt = $pdo->query('SELECT email, adaid FROM ada', PDO::FETCH_ASSOC);
5050
assertType('PDOStatement<array{email: string, adaid: int<-32768, 32767>}>', $stmt);

tests/rules/data/syntax-error-in-prepared-statement.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public function samePlaceholderMultipleTimes(Connection $connection)
144144
$connection->preparedQuery($query, [':gesperrt' => 1]);
145145
}
146146

147-
public function noErrorOnTraillingSemicolon(Connection $connection)
147+
public function noErrorOnTrailingSemicolon(Connection $connection)
148148
{
149149
$query = 'SELECT email, adaid, gesperrt, freigabe1u1 FROM ada;';
150150
$connection->preparedQuery($query, []);
@@ -307,7 +307,7 @@ public function conditionalNumberOfPlaceholders(Connection $connection, string $
307307
$connection->preparedQuery($sql, $args);
308308
}
309309

310-
public function noErrorOnTraillingSemicolonAndWhitespace(Connection $connection)
310+
public function noErrorOnTrailingSemicolonAndWhitespace(Connection $connection)
311311
{
312312
$query = 'SELECT email, adaid, gesperrt, freigabe1u1 FROM ada; ';
313313
$connection->preparedQuery($query, []);

0 commit comments

Comments
 (0)