Skip to content

Commit 425903c

Browse files
astyanaxtomasnorremk-mxp
authored
Fix: Various spellchecks (#835)
[no important files changed] --------- Co-authored-by: Tomas Norre Mikkelsen <tomasnorre@gmail.com> Co-authored-by: mk-mxp <55182845+mk-mxp@users.noreply.github.com>
1 parent df2b442 commit 425903c

File tree

8 files changed

+46
-47
lines changed

8 files changed

+46
-47
lines changed

concepts/anonymous-functions-closures/about.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ $add5 = makeAdderFunction(5);
2626
echo $add5(4); // echos 9
2727
```
2828

29-
In the function `makeAdderFunction` above, the `$number` value that is passed in is "closed" over withing the internally defined anonymous function which is then returned. Then whenever that function is executed it knows the value of the `$number` that was passed in. If you were to call this function again with another number, that would return a completely different function. It would not change the values or the functionality returned by the first function call.
30-
29+
In the function `makeAdderFunction` above, the `$number` value that is passed in is "closed over" within the internally defined anonymous function which is then returned. Then whenever that function is executed it knows the value of the `$number` that was passed in. If you were to call this function again with another number, that would return a completely different function. It would not change the values or the functionality returned by the first function call.
3130
If you need to close over more than one variable, they can be added into the `use` keyword separated by a comma.
3231

3332
PHP also has a shorter function syntax called `arrow functions`. They are required to be fairly simple. The basic form of these is:
@@ -63,7 +62,7 @@ function positiveAverage(array $numbers): float
6362
$total = 0;
6463
$count = 0;
6564
return array_walk(
66-
$numbers,
65+
$numbers,
6766
function($num) use (&$count, &$total) {
6867
$total += abs($num);
6968
$count++;

concepts/arithmetic-operators/about.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ $yourApples = $yourApples + 2; 2
4545

4646
## Division (/)
4747

48-
The division operator gives the result of dividing the left value by the right value. If the right value is 0, it will cause a `DivisionByZeroError` error.
48+
The division operator gives the result of dividing the left value by the right value. If the right value is 0, it will cause a `DivisionByZeroError` error.
4949

5050
```php
5151
$slicesOfPizza = 8;
@@ -79,7 +79,7 @@ if ($isOdd === 1) {
7979

8080
## Exponentiation (**)
8181

82-
The exponentiation operator is used to raise the left value to the power of the right value. Prior to PHP 5.6 you would need to use the `pow` function to perform the same thing.
82+
The exponentiation operator is used to raise the left value to the power of the right value. Prior to PHP 5.6 you would need to use the `pow` function to perform the same thing.
8383

8484
```php
8585
$sideLength = 13;
@@ -95,19 +95,19 @@ $side = $squareArea ** .5; // 12
9595

9696
## Order of Operations
9797

98-
PHP follows the standard order of operations for math. This means that rather that performing operations left to right, each operator has a precedence and the operations are resolved according to their precedence. The order of oeprations is:
98+
PHP follows the standard order of operations for math. This means that rather that performing operations left to right, each operator has a precedence and the operations are resolved according to their precedence. The order of operations is:
9999

100100
* parentheses
101101
* exponentiation
102102
* multiplication, division
103103
* addition, subtraction
104104

105-
Multiplication and division are at the same level of precedence as each other. Similarly, addition and subtraction are at the same level of precence.
105+
Multiplication and division are at the same level of precedence as each other. Similarly, addition and subtraction are at the same level of precedence.
106106

107107
This means the value below would be 17 instead of 10, since multiplication has a higher precedence than addition:
108108

109109
```php
110110
$value = 2 + 3 * 5;
111111
```
112112

113-
PHP also provides a number of helpful assignment operators that combine arithmetic operators with assigment when you are perfoming an operation on a variable and assigning the result back to itself. These will be covered in the `Assignment Operators` concept.
113+
PHP also provides a number of helpful assignment operators that combine arithmetic operators with assignment when you are performing an operation on a variable and assigning the result back to itself. These will be covered in the `Assignment Operators` concept.

concepts/basic-syntax/about.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function window_height()
7878
```
7979

8080
Functions inside classes and their instances are called methods.
81-
To call a method, the name is preceeded by the instance and `->`.
81+
To call a method, the name is preceded by the instance and `->`.
8282
A class instance is created by the `new` operation.
8383
Methods have access to the special variable `$this`, which refers to the current instance.
8484

concepts/basic-syntax/introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ window_height(100);
5454
```
5555

5656
Functions inside classes and their instances are called methods.
57-
To call a method, the name is preceeded by the instance and `->`.
57+
To call a method, the name is preceded by the instance and `->`.
5858
Methods have access to the special variable `$this`, which refers to the current instance.
5959

6060
```php
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"blurb": "Type declation in PHP",
2+
"blurb": "Type declaration in PHP",
33
"authors": ["neenjaw"],
44
"contributors": []
55
}

exercises/concept/lasagna/.docs/introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ window_height(100);
5656
```
5757

5858
Functions inside classes and their instances are called methods.
59-
To call a method, the name is preceeded by the instance and `->`.
59+
To call a method, the name is preceded by the instance and `->`.
6060
Methods have access to the special variable `$this`, which refers to the current instance.
6161

6262
```php

exercises/concept/windowing-system/.meta/design.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
## Learning objectives
44

55
- Reference to OOP
6-
- PHP is a multi-paradign general purpose language with OOP features, what does that mean?
7-
- How to use a constructor function
6+
- PHP is a multi-paradigm general purpose language with OOP features, what does that mean?
7+
- How to use a constructor function
88
- What does `$this` mean/do
99
- How to create a new instance with `new`
1010

@@ -23,7 +23,7 @@ The Concept this exercise unlocks is:
2323

2424
## Prerequisites
2525

26-
- `funtions` as they are the basis for classes and are needed in the exercise
26+
- `functions` as they are the basis for classes and are needed in the exercise
2727
- `integers` as they are the basis for the properties underlying type
2828

2929
## Analyzer

exercises/practice/protein-translation/ProteinTranslationTest.php

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class ProteinTranslationTest extends PHPUnit\Framework\TestCase
66
{
7-
private ProteinTranslation $translater;
7+
private ProteinTranslation $translator;
88

99
public static function setUpBeforeClass(): void
1010
{
@@ -13,7 +13,7 @@ public static function setUpBeforeClass(): void
1313

1414
public function setUp(): void
1515
{
16-
$this->translater = new ProteinTranslation();
16+
$this->translator = new ProteinTranslation();
1717
}
1818

1919
/**
@@ -22,7 +22,7 @@ public function setUp(): void
2222
*/
2323
public function testEmptyRnaSequence(): void
2424
{
25-
$this->assertEquals([], $this->translater->getProteins(''));
25+
$this->assertEquals([], $this->translator->getProteins(''));
2626
}
2727

2828
/**
@@ -31,7 +31,7 @@ public function testEmptyRnaSequence(): void
3131
*/
3232
public function testMethionineRnaSequence(): void
3333
{
34-
$this->assertEquals(['Methionine'], $this->translater->getProteins('AUG'));
34+
$this->assertEquals(['Methionine'], $this->translator->getProteins('AUG'));
3535
}
3636

3737
/**
@@ -40,7 +40,7 @@ public function testMethionineRnaSequence(): void
4040
*/
4141
public function testPhenylalanineRnaSequenceOne(): void
4242
{
43-
$this->assertEquals(['Phenylalanine'], $this->translater->getProteins('UUU'));
43+
$this->assertEquals(['Phenylalanine'], $this->translator->getProteins('UUU'));
4444
}
4545

4646
/**
@@ -49,7 +49,7 @@ public function testPhenylalanineRnaSequenceOne(): void
4949
*/
5050
public function testPhenylalanineRnaSequenceTwo(): void
5151
{
52-
$this->assertEquals(['Phenylalanine'], $this->translater->getProteins('UUC'));
52+
$this->assertEquals(['Phenylalanine'], $this->translator->getProteins('UUC'));
5353
}
5454

5555
/**
@@ -58,7 +58,7 @@ public function testPhenylalanineRnaSequenceTwo(): void
5858
*/
5959
public function testLeucineRnaSequenceOne(): void
6060
{
61-
$this->assertEquals(['Leucine'], $this->translater->getProteins('UUA'));
61+
$this->assertEquals(['Leucine'], $this->translator->getProteins('UUA'));
6262
}
6363

6464
/**
@@ -67,7 +67,7 @@ public function testLeucineRnaSequenceOne(): void
6767
*/
6868
public function testLeucineRnaSequenceTwo(): void
6969
{
70-
$this->assertEquals(['Leucine'], $this->translater->getProteins('UUG'));
70+
$this->assertEquals(['Leucine'], $this->translator->getProteins('UUG'));
7171
}
7272

7373
/**
@@ -76,7 +76,7 @@ public function testLeucineRnaSequenceTwo(): void
7676
*/
7777
public function testSerineRnaSequenceOne(): void
7878
{
79-
$this->assertEquals(['Serine'], $this->translater->getProteins('UCU'));
79+
$this->assertEquals(['Serine'], $this->translator->getProteins('UCU'));
8080
}
8181

8282
/**
@@ -85,7 +85,7 @@ public function testSerineRnaSequenceOne(): void
8585
*/
8686
public function testSerineRnaSequenceTwo(): void
8787
{
88-
$this->assertEquals(['Serine'], $this->translater->getProteins('UCC'));
88+
$this->assertEquals(['Serine'], $this->translator->getProteins('UCC'));
8989
}
9090

9191
/**
@@ -94,7 +94,7 @@ public function testSerineRnaSequenceTwo(): void
9494
*/
9595
public function testSerineRnaSequenceThree(): void
9696
{
97-
$this->assertEquals(['Serine'], $this->translater->getProteins('UCA'));
97+
$this->assertEquals(['Serine'], $this->translator->getProteins('UCA'));
9898
}
9999

100100
/**
@@ -103,7 +103,7 @@ public function testSerineRnaSequenceThree(): void
103103
*/
104104
public function testSerineRnaSequenceFour(): void
105105
{
106-
$this->assertEquals(['Serine'], $this->translater->getProteins('UCG'));
106+
$this->assertEquals(['Serine'], $this->translator->getProteins('UCG'));
107107
}
108108

109109
/**
@@ -112,7 +112,7 @@ public function testSerineRnaSequenceFour(): void
112112
*/
113113
public function testTyrosineRnaSequenceOne(): void
114114
{
115-
$this->assertEquals(['Tyrosine'], $this->translater->getProteins('UAU'));
115+
$this->assertEquals(['Tyrosine'], $this->translator->getProteins('UAU'));
116116
}
117117

118118
/**
@@ -121,7 +121,7 @@ public function testTyrosineRnaSequenceOne(): void
121121
*/
122122
public function testTyrosineRnaSequenceTwo(): void
123123
{
124-
$this->assertEquals(['Tyrosine'], $this->translater->getProteins('UAC'));
124+
$this->assertEquals(['Tyrosine'], $this->translator->getProteins('UAC'));
125125
}
126126

127127
/**
@@ -130,7 +130,7 @@ public function testTyrosineRnaSequenceTwo(): void
130130
*/
131131
public function testCysteineRnaSequenceOne(): void
132132
{
133-
$this->assertEquals(['Cysteine'], $this->translater->getProteins('UGU'));
133+
$this->assertEquals(['Cysteine'], $this->translator->getProteins('UGU'));
134134
}
135135

136136
/**
@@ -139,7 +139,7 @@ public function testCysteineRnaSequenceOne(): void
139139
*/
140140
public function testCysteineRnaSequenceTwo(): void
141141
{
142-
$this->assertEquals(['Cysteine'], $this->translater->getProteins('UGC'));
142+
$this->assertEquals(['Cysteine'], $this->translator->getProteins('UGC'));
143143
}
144144

145145
/**
@@ -148,7 +148,7 @@ public function testCysteineRnaSequenceTwo(): void
148148
*/
149149
public function testTryptophanRnaSequence(): void
150150
{
151-
$this->assertEquals(['Tryptophan'], $this->translater->getProteins('UGG'));
151+
$this->assertEquals(['Tryptophan'], $this->translator->getProteins('UGG'));
152152
}
153153

154154
/**
@@ -157,7 +157,7 @@ public function testTryptophanRnaSequence(): void
157157
*/
158158
public function testStopCodonRnaSequenceOne(): void
159159
{
160-
$this->assertEquals([], $this->translater->getProteins('UAA'));
160+
$this->assertEquals([], $this->translator->getProteins('UAA'));
161161
}
162162

163163
/**
@@ -166,7 +166,7 @@ public function testStopCodonRnaSequenceOne(): void
166166
*/
167167
public function testStopCodonRnaSequenceTwo(): void
168168
{
169-
$this->assertEquals([], $this->translater->getProteins('UAG'));
169+
$this->assertEquals([], $this->translator->getProteins('UAG'));
170170
}
171171

172172
/**
@@ -175,7 +175,7 @@ public function testStopCodonRnaSequenceTwo(): void
175175
*/
176176
public function testStopCodonRnaSequenceThree(): void
177177
{
178-
$this->assertEquals([], $this->translater->getProteins('UGA'));
178+
$this->assertEquals([], $this->translator->getProteins('UGA'));
179179
}
180180

181181
/**
@@ -184,7 +184,7 @@ public function testStopCodonRnaSequenceThree(): void
184184
*/
185185
public function testToCodonsTranslateToProteins(): void
186186
{
187-
$this->assertEquals(['Phenylalanine', 'Phenylalanine'], $this->translater->getProteins('UUUUUU'));
187+
$this->assertEquals(['Phenylalanine', 'Phenylalanine'], $this->translator->getProteins('UUUUUU'));
188188
}
189189

190190
/**
@@ -193,18 +193,18 @@ public function testToCodonsTranslateToProteins(): void
193193
*/
194194
public function testToDifferentCodonsTranslateToProteins(): void
195195
{
196-
$this->assertEquals(['Leucine', 'Leucine'], $this->translater->getProteins('UUAUUG'));
196+
$this->assertEquals(['Leucine', 'Leucine'], $this->translator->getProteins('UUAUUG'));
197197
}
198198

199199
/**
200200
* uuid d0f295df-fb70-425c-946c-ec2ec185388e
201201
* @testdox Translate RNA strand into correct protein list
202202
*/
203-
public function testTranslateRnaStrandToCorrectProteinList(): void
203+
public function testTranslateRnaStrandIntoCorrectProteinList(): void
204204
{
205205
$this->assertEquals(
206206
['Methionine', 'Phenylalanine', 'Tryptophan'],
207-
$this->translater->getProteins('AUGUUUUGG')
207+
$this->translator->getProteins('AUGUUUUGG')
208208
);
209209
}
210210

@@ -214,7 +214,7 @@ public function testTranslateRnaStrandToCorrectProteinList(): void
214214
*/
215215
public function testTranslationStopsIfStopCodonAtBeginningOfSequence(): void
216216
{
217-
$this->assertEquals([], $this->translater->getProteins('UAGUGG'));
217+
$this->assertEquals([], $this->translator->getProteins('UAGUGG'));
218218
}
219219

220220
/**
@@ -223,7 +223,7 @@ public function testTranslationStopsIfStopCodonAtBeginningOfSequence(): void
223223
*/
224224
public function testTranslationStopsIfStopCodonAtEndOfTwoCodonSequence(): void
225225
{
226-
$this->assertEquals(['Tryptophan'], $this->translater->getProteins('UGGUAG'));
226+
$this->assertEquals(['Tryptophan'], $this->translator->getProteins('UGGUAG'));
227227
}
228228

229229
/**
@@ -232,7 +232,7 @@ public function testTranslationStopsIfStopCodonAtEndOfTwoCodonSequence(): void
232232
*/
233233
public function testTranslationStopsIfStopCodonAtEndOfThreeCodonSequence(): void
234234
{
235-
$this->assertEquals(['Methionine', 'Phenylalanine'], $this->translater->getProteins('AUGUUUUAA'));
235+
$this->assertEquals(['Methionine', 'Phenylalanine'], $this->translator->getProteins('AUGUUUUAA'));
236236
}
237237

238238
/**
@@ -241,7 +241,7 @@ public function testTranslationStopsIfStopCodonAtEndOfThreeCodonSequence(): void
241241
*/
242242
public function testTranslationStopsIfStopCodonInMiddleOfThreeCodonSequence(): void
243243
{
244-
$this->assertEquals(['Tryptophan'], $this->translater->getProteins('UGGUAGUGG'));
244+
$this->assertEquals(['Tryptophan'], $this->translator->getProteins('UGGUAGUGG'));
245245
}
246246

247247
/**
@@ -252,7 +252,7 @@ public function testTranslationStopsIfStopCodonInMiddleOfSixCodonSequence(): voi
252252
{
253253
$this->assertEquals(
254254
['Tryptophan', 'Cysteine', 'Tyrosine'],
255-
$this->translater->getProteins('UGGUGUUAUUAAUGGUUU')
255+
$this->translator->getProteins('UGGUGUUAUUAAUGGUUU')
256256
);
257257
}
258258

@@ -264,7 +264,7 @@ public function testUnknownAminoAcidsCantTranslate(): void
264264
{
265265
$this->expectException(InvalidArgumentException::class);
266266
$this->expectExceptionMessage('Invalid codon');
267-
$this->translater->getProteins('XYZ');
267+
$this->translator->getProteins('XYZ');
268268
}
269269

270270

@@ -276,7 +276,7 @@ public function testIncompleteRnaSequenceCantTranslate(): void
276276
{
277277
$this->expectException(InvalidArgumentException::class);
278278
$this->expectExceptionMessage('Invalid codon');
279-
$this->translater->getProteins('AUGU');
279+
$this->translator->getProteins('AUGU');
280280
}
281281

282282
/**
@@ -285,6 +285,6 @@ public function testIncompleteRnaSequenceCantTranslate(): void
285285
*/
286286
public function testIncompleteRnaSequenceCanTranslateIfValidUntilStop(): void
287287
{
288-
$this->assertEquals(['Phenylalanine', 'Phenylalanine'], $this->translater->getProteins('UUCUUCUAAUGGU'));
288+
$this->assertEquals(['Phenylalanine', 'Phenylalanine'], $this->translator->getProteins('UUCUUCUAAUGGU'));
289289
}
290290
}

0 commit comments

Comments
 (0)