Skip to content

Commit

Permalink
PHPLIB-1143: Renamed add_logger() and remove_logger() functions
Browse files Browse the repository at this point in the history
This renames the camelCase names introduced in 1acfab0 to snake_case, which is consistent with other functions.
  • Loading branch information
jmikola committed Sep 26, 2023
1 parent 28bcd68 commit 5384a14
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
* Calling this method again with a logger that has already been added will have
* no effect.
*/
function addLogger(LoggerInterface $logger): void
function add_logger(LoggerInterface $logger): void
{
PsrLogAdapter::addLogger($logger);
}
Expand All @@ -64,7 +64,7 @@ function addLogger(LoggerInterface $logger): void
* Calling this method with a logger that has not been added will have no
* effect.
*/
function removeLogger(LoggerInterface $logger): void
function remove_logger(LoggerInterface $logger): void
{
PsrLogAdapter::removeLogger($logger);
}
Expand Down
8 changes: 4 additions & 4 deletions tests/LogNonGenuineHostTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
use Psr\Log\LoggerInterface;

use function func_get_args;
use function MongoDB\addLogger;
use function MongoDB\removeLogger;
use function MongoDB\add_logger;
use function MongoDB\remove_logger;

/** @see https://jira.mongodb.org/browse/DRIVERS-2583 */
class LogNonGenuineHostTest extends TestCase
Expand All @@ -20,12 +20,12 @@ public function setUp(): void
{
$this->logger = $this->createTestPsrLogger();

addLogger($this->logger);
add_logger($this->logger);
}

public function tearDown(): void
{
removeLogger($this->logger);
remove_logger($this->logger);
}

/** @dataProvider provideCosmosUris */
Expand Down
8 changes: 4 additions & 4 deletions tests/PsrLogAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
use Psr\Log\LogLevel;

use function func_get_args;
use function MongoDB\addLogger;
use function MongoDB\add_logger;
use function MongoDB\Driver\Monitoring\mongoc_log;
use function MongoDB\removeLogger;
use function MongoDB\remove_logger;
use function sprintf;

class PsrLogAdapterTest extends BaseTestCase
Expand All @@ -39,12 +39,12 @@ public function testAddAndRemoveLoggerFunctions(): void
mongoc_log(LogSubscriber::LEVEL_INFO, 'domain1', 'info1');
PsrLogAdapter::writeLog(PsrLogAdapter::INFO, 'domain2', 'info2');

addLogger($logger);
add_logger($logger);

mongoc_log(LogSubscriber::LEVEL_INFO, 'domain3', 'info3');
PsrLogAdapter::writeLog(PsrLogAdapter::INFO, 'domain4', 'info4');

removeLogger($logger);
remove_logger($logger);

mongoc_log(LogSubscriber::LEVEL_INFO, 'domain5', 'info5');
PsrLogAdapter::writeLog(PsrLogAdapter::INFO, 'domain6', 'info6');
Expand Down

0 comments on commit 5384a14

Please sign in to comment.