diff --git a/src/Transport/File.php b/src/Transport/File.php index 3b4b9783..ec18bb06 100644 --- a/src/Transport/File.php +++ b/src/Transport/File.php @@ -70,7 +70,7 @@ public function setOptions(FileOptions $options) public function send(Message $message) { $options = $this->options; - $filename = call_user_func($options->getCallback(), $this); + $filename = $options->getCallback()($this); $file = $options->getPath() . DIRECTORY_SEPARATOR . $filename; $email = $message->toString(); diff --git a/src/Transport/Sendmail.php b/src/Transport/Sendmail.php index 3223b3fa..15b64065 100644 --- a/src/Transport/Sendmail.php +++ b/src/Transport/Sendmail.php @@ -133,7 +133,7 @@ public function send(Mail\Message $message) $headers = str_replace("\r\n", "\n", $headers); } - call_user_func($this->callable, $to, $subject, $body, $headers, $params); + ($this->callable)($to, $subject, $body, $headers, $params); } /** diff --git a/test/Header/AddressListHeaderTest.php b/test/Header/AddressListHeaderTest.php index 621422d3..2822bc25 100644 --- a/test/Header/AddressListHeaderTest.php +++ b/test/Header/AddressListHeaderTest.php @@ -118,7 +118,7 @@ public function getStringHeaders() public function testDeserializationFromString($headerLine, $class) { $callback = sprintf('%s::fromString', $class); - $header = call_user_func($callback, $headerLine); + $header = $callback($headerLine); $this->assertInstanceOf($class, $header); $list = $header->getAddressList(); $this->assertEquals(4, count($list)); @@ -175,7 +175,7 @@ public function getHeadersWithComments() public function testAllowsNoWhitespaceBetweenHeaderAndValue($headerLine, $class) { $callback = sprintf('%s::fromString', $class); - $header = call_user_func($callback, $headerLine); + $header = $callback($headerLine); $this->assertInstanceOf($class, $header); $list = $header->getAddressList(); $this->assertEquals(4, count($list)); diff --git a/test/Transport/FileOptionsTest.php b/test/Transport/FileOptionsTest.php index e037deaf..b7ecff33 100644 --- a/test/Transport/FileOptionsTest.php +++ b/test/Transport/FileOptionsTest.php @@ -35,7 +35,7 @@ public function testDefaultCallbackIsSetByDefault() { $callback = $this->options->getCallback(); $this->assertInternalType('callable', $callback); - $test = call_user_func($callback, ''); + $test = $callback(''); $this->assertRegExp('#^LaminasMail_\d+_\d+\.eml$#', $test); }