Skip to content

Commit

Permalink
Fix various typos in comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dhensby committed May 16, 2020
1 parent 21129b1 commit 080ce15
Show file tree
Hide file tree
Showing 9 changed files with 289 additions and 289 deletions.
2 changes: 1 addition & 1 deletion src/Forms/FileUploadReceiver.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ trait FileUploadReceiver
public $relationAutoSetting = true;

/**
* Parent data record. Will be infered from parent form or controller if blank.
* Parent data record. Will be inferred from parent form or controller if blank.
*
* @var DataObject
*/
Expand Down
4 changes: 2 additions & 2 deletions src/ORM/Connect/DBQueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ protected function buildInsertQuery(SQLInsert $query, array &$parameters)
foreach ($columns as $column) {
// Check if this column has a value for this row
if (isset($assignments[$column])) {
// Assigment is a single item array, expand with a loop here
// Assignment is a single item array, expand with a loop here
foreach ($assignments[$column] as $assignmentSQL => $assignmentParameters) {
$parts[] = $assignmentSQL;
$parameters = array_merge($parameters, $assignmentParameters);
Expand Down Expand Up @@ -220,7 +220,7 @@ public function buildUpdateFragment(SQLUpdate $query, array &$parameters)
// Join SET components together, considering parameters
$parts = [];
foreach ($query->getAssignments() as $column => $assignment) {
// Assigment is a single item array, expand with a loop here
// Assignment is a single item array, expand with a loop here
foreach ($assignment as $assignmentSQL => $assignmentParameters) {
$parts[] = "$column = $assignmentSQL";
$parameters = array_merge($parameters, $assignmentParameters);
Expand Down
2 changes: 1 addition & 1 deletion src/ORM/Queries/SQLAssignmentRow.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public function setAssignments(array $assignments)
/**
* Retrieves the list of assignments in parameterised format
*
* @return array List of assigments. The key of this array will be the
* @return array List of assignments. The key of this array will be the
* column to assign, and the value a parameterised array in the format
* ['SQL' => [parameters]];
*/
Expand Down
2 changes: 1 addition & 1 deletion src/ORM/Queries/SQLInsert.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public function assignSQL($field, $sql)
}

/**
* Clears all currently set assigment values on the current row
* Clears all currently set assignment values on the current row
*
* @return $this The self reference to this query
*/
Expand Down
2 changes: 1 addition & 1 deletion src/ORM/Queries/SQLUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function assignSQL($field, $sql)
}

/**
* Clears all currently set assigment values
* Clears all currently set assignment values
*
* @return $this The self reference to this query
*/
Expand Down
2 changes: 1 addition & 1 deletion src/ORM/Queries/SQLWriteExpression.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function setAssignments(array $assignments);
*
* For multi-row objects returns assignments for the current row.
*
* @return array List of assigments. The key of this array will be the
* @return array List of assignments. The key of this array will be the
* column to assign, and the value a parameterised array in the format
* ['SQL' => [parameters]];
*/
Expand Down
546 changes: 273 additions & 273 deletions src/View/SSTemplateParser.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/php/Core/ObjectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ public function testHasAndAddExtension()
$objectTest_ExtensionTest->hasExtension(ExtendTest3::class),
"Extensions are detected with instance hasExtension() when added through add_extension()"
);

// load in a custom implementation
Injector::inst()->registerService(new ExtendTest5(), ExtendTest4::class);
$this->assertTrue(
Expand Down
16 changes: 8 additions & 8 deletions tests/php/ORM/DataObjectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ public function testHasManyRelationships()
// Test the IDs on the DataObjects are set correctly
$this->assertListEquals($team1Comments, $team1->Comments());

// Test that has_many can be infered from the has_one via getNonReciprocalComponent
// Test that has_many can be inferred from the has_one via getNonReciprocalComponent
$this->assertListEquals(
$team1Comments,
$team1->inferReciprocalComponent(DataObjectTest\TeamComment::class, 'Team')
Expand Down Expand Up @@ -1704,7 +1704,7 @@ public function testMultipleManyManyWithSameClass()
$this->assertInstanceOf(ManyManyList::class, $teamWithoutSponsor->Sponsors());
$this->assertEquals(0, $teamWithoutSponsor->Sponsors()->count());

// Test that belongs_many_many can be infered from with getNonReciprocalComponent
// Test that belongs_many_many can be inferred from with getNonReciprocalComponent
$this->assertListEquals(
[
['Name' => 'Company corp'],
Expand All @@ -1713,7 +1713,7 @@ public function testMultipleManyManyWithSameClass()
$team->inferReciprocalComponent(DataObjectTest\EquipmentCompany::class, 'SponsoredTeams')
);

// Test that many_many can be infered from getNonReciprocalComponent
// Test that many_many can be inferred from getNonReciprocalComponent
$this->assertListEquals(
[
['Title' => 'Team 1'],
Expand Down Expand Up @@ -2149,20 +2149,20 @@ public function testBelongsTo()

$this->assertEquals($company->ID, $ceo->Company()->ID, 'belongs_to returns the right results.');

// Test belongs_to can be infered via getNonReciprocalComponent
// Test belongs_to can be inferred via getNonReciprocalComponent
// Note: Will be returned as has_many since the belongs_to is ignored.
$this->assertListEquals(
[['Name' => 'New Company']],
$ceo->inferReciprocalComponent(DataObjectTest\Company::class, 'CEO')
);

// Test has_one to a belongs_to can be infered via getNonReciprocalComponent
// Test has_one to a belongs_to can be inferred via getNonReciprocalComponent
$this->assertEquals(
$ceo->ID,
$company->inferReciprocalComponent(DataObjectTest\CEO::class, 'Company')->ID
);

// Test automatic creation of class where no assigment exists
// Test automatic creation of class where no assignment exists
$ceo = new DataObjectTest\CEO();
$ceo->write();

Expand Down Expand Up @@ -2443,7 +2443,7 @@ public function testRecursiveWrite()
$root->CycleID = $grandchild->ID;
$root->write();

// Our count will have been set while loading our fixtures, let's reset eveything back to 0
// Our count will have been set while loading our fixtures, let's reset everything back to 0
TreeNode::singleton()->resetCounts();
$root = TreeNode::get()->byID($root->ID);
$child = TreeNode::get()->byID($child->ID);
Expand Down Expand Up @@ -2487,7 +2487,7 @@ public function testShallowRecursiveWrite()
$root->CycleID = $grandchild->ID;
$root->write();

// Our count will have been set while loading our fixtures, let's reset eveything back to 0
// Our count will have been set while loading our fixtures, let's reset everything back to 0
TreeNode::singleton()->resetCounts();
$root = TreeNode::get()->byID($root->ID);
$child = TreeNode::get()->byID($child->ID);
Expand Down

0 comments on commit 080ce15

Please sign in to comment.