Skip to content

Commit

Permalink
[Typo] Rename occurence to occurrence
Browse files Browse the repository at this point in the history
  • Loading branch information
pgrimaud committed Mar 27, 2020
1 parent e0de6cc commit 11f746a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ final class DeprecationGroup
*/
public function addNoticeFromObject($message, $class, $method)
{
$this->deprecationNotice($message)->addObjectOccurence($class, $method);
$this->deprecationNotice($message)->addObjectOccurrence($class, $method);
$this->addNotice();
}

Expand All @@ -39,7 +39,7 @@ public function addNoticeFromObject($message, $class, $method)
*/
public function addNoticeFromProceduralCode($message)
{
$this->deprecationNotice($message)->addProceduralOccurence();
$this->deprecationNotice($message)->addProceduralOccurrence();
$this->addNotice();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ final class DeprecationNotice
*/
private $countsByCaller = [];

public function addObjectOccurence($class, $method)
public function addObjectOccurrence($class, $method)
{
if (!isset($this->countsByCaller["$class::$method"])) {
$this->countsByCaller["$class::$method"] = 0;
Expand All @@ -32,7 +32,7 @@ public function addObjectOccurence($class, $method)
++$this->count;
}

public function addProceduralOccurence()
public function addProceduralOccurrence()
{
++$this->count;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ final class DeprecationNoticeTest extends TestCase
public function testItGroupsByCaller()
{
$notice = new DeprecationNotice();
$notice->addObjectOccurence('MyAction', '__invoke');
$notice->addObjectOccurence('MyAction', '__invoke');
$notice->addObjectOccurence('MyOtherAction', '__invoke');
$notice->addObjectOccurrence('MyAction', '__invoke');
$notice->addObjectOccurrence('MyAction', '__invoke');
$notice->addObjectOccurrence('MyOtherAction', '__invoke');

$countsByCaller = $notice->getCountsByCaller();

Expand All @@ -23,13 +23,13 @@ public function testItGroupsByCaller()
$this->assertSame(1, $countsByCaller['MyOtherAction::__invoke']);
}

public function testItCountsBothTypesOfOccurences()
public function testItCountsBothTypesOfOccurrences()
{
$notice = new DeprecationNotice();
$notice->addObjectOccurence('MyAction', '__invoke');
$notice->addObjectOccurrence('MyAction', '__invoke');
$this->assertSame(1, $notice->count());

$notice->addProceduralOccurence();
$notice->addProceduralOccurrence();
$this->assertSame(2, $notice->count());
}
}

0 comments on commit 11f746a

Please sign in to comment.