Skip to content

Commit

Permalink
minor #36244 [Typo] Rename occurence to occurrence (pgrimaud)
Browse files Browse the repository at this point in the history
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Typo] Rename occurence to occurrence

| Q             | A
| ------------- | ---
| Branch?       | master (5.1)
| Bug fix?      | yes (typo)
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #36242
| License       | MIT
| Doc PR        | Not needed

This PR will fix correct spelling of methods containing the word occurrence implemented with PR :
- [PHPUnitBridge] Improved deprecations display #35271

This changes are on master branch, because the original PR is a new feature for Symfony 5.1.

Commits
-------

11f746a [Typo] Rename occurence to occurrence
  • Loading branch information
xabbuh committed Mar 28, 2020
2 parents e0de6cc + 11f746a commit eb0e47b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
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
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
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 eb0e47b

Please sign in to comment.