Skip to content

Fixed various typos #5716

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/doctrine-dbal.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
fwrite(
STDERR,
'[Warning] The use of this script is discouraged.'
. ' You find instructions on how to boostrap the console runner in our documentation.'
. ' You find instructions on how to bootstrap the console runner in our documentation.'
. PHP_EOL,
);

Expand Down
2 changes: 1 addition & 1 deletion docs/en/reference/portability.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Using the following code block in your initialization will:

This sort of portability handling is pretty expensive because all the result
rows and columns have to be looped inside PHP before being returned to you.
This is why by default Doctrine ORM does not use this compability wrapper but
This is why by default Doctrine ORM does not use this compatibility wrapper but
implements another approach to handle assoc-key casing and ignores the other
two issues.

Expand Down
12 changes: 6 additions & 6 deletions src/ExpandArrayParameters.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ final class ExpandArrayParameters implements Visitor
private array $convertedSQL = [];

/** @var list<mixed> */
private array $convertedParameteres = [];
private array $convertedParameters = [];

/** @var array<int,Type|int|string|null> */
private array $convertedTypes = [];
Expand Down Expand Up @@ -79,7 +79,7 @@ public function getSQL(): string
/** @return list<mixed> */
public function getParameters(): array
{
return $this->convertedParameteres;
return $this->convertedParameters;
}

/**
Expand All @@ -89,8 +89,8 @@ public function getParameters(): array
private function acceptParameter($key, $value): void
{
if (! isset($this->originalTypes[$key])) {
$this->convertedSQL[] = '?';
$this->convertedParameteres[] = $value;
$this->convertedSQL[] = '?';
$this->convertedParameters[] = $value;

return;
}
Expand Down Expand Up @@ -130,10 +130,10 @@ private function appendTypedParameter(array $values, $type): void
{
$this->convertedSQL[] = implode(', ', array_fill(0, count($values), '?'));

$index = count($this->convertedParameteres);
$index = count($this->convertedParameters);

foreach ($values as $value) {
$this->convertedParameteres[] = $value;
$this->convertedParameters[] = $value;
$this->convertedTypes[$index] = $type;

$index++;
Expand Down
2 changes: 1 addition & 1 deletion src/Query/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ public function set($key, $value)
* ->from('counters', 'c')
* ->where('c.id = ?');
*
* // You can optionally programatically build and/or expressions
* // You can optionally programmatically build and/or expressions
* $qb = $conn->createQueryBuilder();
*
* $or = $qb->expr()->orx();
Expand Down
2 changes: 1 addition & 1 deletion src/Schema/Comparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,6 @@ public function diffColumn(Column $column1, Column $column2)
*/
public function diffIndex(Index $index1, Index $index2)
{
return ! ($index1->isFullfilledBy($index2) && $index2->isFullfilledBy($index1));
return ! ($index1->isFulfilledBy($index2) && $index2->isFulfilledBy($index1));
}
}
10 changes: 9 additions & 1 deletion src/Schema/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,19 @@ public function spansColumns(array $columnNames)
}

/**
* Checks if the other index already fulfills all the indexing and constraint needs of the current one.
* Keeping misspelled function name for backwards compatibility
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although we need to keep the method around in the current major release, it should be deprecated and removed in the next major.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, @greg0ire already mentioned that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@morozov I think this can be merged as is, then the deprecation can be added on 3.5.x

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nexxai please don't mark as resolved conversations you do not open in general, and here in particular because it hides my comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh no, I'm sorry! I'll leave them open for the commenter to close. Again, my apologies.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries.

*
* @return bool
*/
public function isFullfilledBy(Index $other)
{
return $this->isFulfilledBy($other);
}

/**
* Checks if the other index already fulfills all the indexing and constraint needs of the current one.
*/
public function isFulfilledBy(Index $other): bool
{
// allow the other index to be equally large only. It being larger is an option
// but it creates a problem with scenarios of the kind PRIMARY KEY(foo,bar) UNIQUE(foo)
Expand Down
6 changes: 3 additions & 3 deletions src/Schema/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ protected function _addIndex(Index $indexCandidate)
$replacedImplicitIndexes = [];

foreach ($this->implicitIndexes as $name => $implicitIndex) {
if (! $implicitIndex->isFullfilledBy($indexCandidate) || ! isset($this->_indexes[$name])) {
if (! $implicitIndex->isFulfilledBy($indexCandidate) || ! isset($this->_indexes[$name])) {
continue;
}

Expand Down Expand Up @@ -524,7 +524,7 @@ protected function _addUniqueConstraint(UniqueConstraint $constraint): Table
$indexCandidate = $this->_createIndex($constraint->getColumns(), $indexName, true, false);

foreach ($this->_indexes as $existingIndex) {
if ($indexCandidate->isFullfilledBy($existingIndex)) {
if ($indexCandidate->isFulfilledBy($existingIndex)) {
return $this;
}
}
Expand Down Expand Up @@ -569,7 +569,7 @@ protected function _addForeignKeyConstraint(ForeignKeyConstraint $constraint)
$indexCandidate = $this->_createIndex($constraint->getColumns(), $indexName, false, false);

foreach ($this->_indexes as $existingIndex) {
if ($indexCandidate->isFullfilledBy($existingIndex)) {
if ($indexCandidate->isFulfilledBy($existingIndex)) {
return $this;
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Platforms/AbstractMySQLPlatformTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/** @extends AbstractPlatformTestCase<MySQLPlatform> */
abstract class AbstractMySQLPlatformTestCase extends AbstractPlatformTestCase
{
public function testModifyLimitQueryWitoutLimit(): void
public function testModifyLimitQueryWithoutLimit(): void
{
$sql = $this->platform->modifyLimitQuery('SELECT n FROM Foo', null, 10);
self::assertEquals('SELECT n FROM Foo LIMIT 18446744073709551615 OFFSET 10', $sql);
Expand Down
28 changes: 14 additions & 14 deletions tests/Schema/IndexTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public function testFulfilledByUnique(): void
$idx2 = $this->createIndex(true, false);
$idx3 = $this->createIndex();

self::assertTrue($idx1->isFullfilledBy($idx2));
self::assertFalse($idx1->isFullfilledBy($idx3));
self::assertTrue($idx1->isFulfilledBy($idx2));
self::assertFalse($idx1->isFulfilledBy($idx3));
}

public function testFulfilledByPrimary(): void
Expand All @@ -54,8 +54,8 @@ public function testFulfilledByPrimary(): void
$idx2 = $this->createIndex(true, true);
$idx3 = $this->createIndex(true, false);

self::assertTrue($idx1->isFullfilledBy($idx2));
self::assertFalse($idx1->isFullfilledBy($idx3));
self::assertTrue($idx1->isFulfilledBy($idx2));
self::assertFalse($idx1->isFulfilledBy($idx3));
}

public function testFulfilledByIndex(): void
Expand All @@ -65,9 +65,9 @@ public function testFulfilledByIndex(): void
$pri = $this->createIndex(true, true);
$uniq = $this->createIndex(true);

self::assertTrue($idx1->isFullfilledBy($idx2));
self::assertTrue($idx1->isFullfilledBy($pri));
self::assertTrue($idx1->isFullfilledBy($uniq));
self::assertTrue($idx1->isFulfilledBy($idx2));
self::assertTrue($idx1->isFulfilledBy($pri));
self::assertTrue($idx1->isFulfilledBy($uniq));
}

public function testFulfilledWithPartial(): void
Expand All @@ -76,13 +76,13 @@ public function testFulfilledWithPartial(): void
$partial = new Index('partial', ['col1', 'col2'], true, false, [], ['where' => 'col1 IS NULL']);
$another = new Index('another', ['col1', 'col2'], true, false, [], ['where' => 'col1 IS NULL']);

self::assertFalse($partial->isFullfilledBy($without));
self::assertFalse($without->isFullfilledBy($partial));
self::assertFalse($partial->isFulfilledBy($without));
self::assertFalse($without->isFulfilledBy($partial));

self::assertTrue($partial->isFullfilledBy($partial));
self::assertTrue($partial->isFulfilledBy($partial));

self::assertTrue($partial->isFullfilledBy($another));
self::assertTrue($another->isFullfilledBy($partial));
self::assertTrue($partial->isFulfilledBy($another));
self::assertTrue($another->isFulfilledBy($partial));
}

public function testOverrulesWithPartial(): void
Expand Down Expand Up @@ -112,8 +112,8 @@ public function testFulfilledWithLength(array $columns, array $lengths1, array $
$index1 = new Index('index1', $columns, false, false, [], ['lengths' => $lengths1]);
$index2 = new Index('index2', $columns, false, false, [], ['lengths' => $lengths2]);

self::assertSame($expected, $index1->isFullfilledBy($index2));
self::assertSame($expected, $index2->isFullfilledBy($index1));
self::assertSame($expected, $index1->isFulfilledBy($index2));
self::assertSame($expected, $index2->isFulfilledBy($index1));
}

/** @return mixed[][] */
Expand Down
2 changes: 1 addition & 1 deletion tests/Types/TypeRegistryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function testRegister(): void
self::assertSame($newType, $this->registry->get('some'));
}

public function testRegisterWithAlradyRegisteredName(): void
public function testRegisterWithAlreadyRegisteredName(): void
{
$this->registry->register('some', new TextType());

Expand Down