Skip to content

Commit 638b73a

Browse files
committed
Cleanup for Wrapper
1 parent 07f8a65 commit 638b73a

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

app/code/Magento/NewRelicReporting/Model/NewRelicWrapper.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class NewRelicWrapper
2121
*/
2222
public function addCustomParameter($param, $value)
2323
{
24-
if (extension_loaded('newrelic')) {
24+
if ($this->isExtensionInstalled()) {
2525
newrelic_add_custom_parameter($param, $value);
2626
return true;
2727
}
@@ -36,7 +36,7 @@ public function addCustomParameter($param, $value)
3636
*/
3737
public function reportError($exception)
3838
{
39-
if (extension_loaded('newrelic')) {
39+
if ($this->isExtensionInstalled()) {
4040
newrelic_notice_error($exception->getMessage(), $exception);
4141
}
4242
}
@@ -55,28 +55,28 @@ public function setAppName(string $appName)
5555
}
5656

5757
/**
58-
* Checks whether newrelic-php5 agent is installed
58+
* Wrapper for 'newrelic_name_transaction'
5959
*
60-
* @return bool
60+
* @param string $transactionName
61+
* @return void
6162
*/
62-
public function isExtensionInstalled()
63+
public function setTransactionName(string $transactionName): void
6364
{
64-
if (extension_loaded('newrelic')) {
65-
return true;
65+
if ($this->isExtensionInstalled()) {
66+
newrelic_name_transaction($transactionName);
6667
}
67-
return false;
6868
}
6969

7070
/**
71-
* Wrapper for 'newrelic_name_transaction'
71+
* Checks whether newrelic-php5 agent is installed
7272
*
73-
* @param string $transactionName
74-
* @return void
73+
* @return bool
7574
*/
76-
public function setTransactionName(string $transactionName): void
75+
public function isExtensionInstalled()
7776
{
78-
if ($this->isExtensionInstalled()) {
79-
newrelic_name_transaction($transactionName);
77+
if (extension_loaded('newrelic')) {
78+
return true;
8079
}
80+
return false;
8181
}
8282
}

0 commit comments

Comments
 (0)