Skip to content

Commit

Permalink
Patch for v8 str func issues
Browse files Browse the repository at this point in the history
  • Loading branch information
nicksagona committed Dec 19, 2022
1 parent e3354ed commit 0f0f136
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/Transport/Smtp/AuthHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public function afterEhlo(AgentInterface $agent)
if ($this->username) {
$count = 0;
foreach ($this->getAuthenticatorsForAgent() as $authenticator) {
if (in_array(strtolower($authenticator->getAuthKeyword()),
if (in_array(strtolower((string)$authenticator->getAuthKeyword()),
array_map('strtolower', $this->esmtpParams))) {
++$count;
if ($authenticator->authenticate($agent, $this->username, $this->password)) {
Expand Down Expand Up @@ -246,12 +246,12 @@ public function resetState()
*/
protected function getAuthenticatorsForAgent()
{
if (!$mode = strtolower($this->authMode)) {
if (!$mode = strtolower((string)$this->authMode)) {
return $this->authenticators;
}

foreach ($this->authenticators as $authenticator) {
if (strtolower($authenticator->getAuthKeyword()) == $mode) {
if (strtolower((string)$authenticator->getAuthKeyword()) == $mode) {
return [$authenticator];
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Transport/Smtp/EsmtpTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public function getTimeout()
*/
public function setEncryption($encryption)
{
$encryption = strtolower($encryption);
$encryption = strtolower((string)$encryption);
if ('tls' == $encryption) {
$this->params['protocol'] = 'tcp';
$this->params['tls'] = true;
Expand Down Expand Up @@ -289,7 +289,7 @@ public function __call($method, $args)
if (method_exists($handler, $method)) {
$return = call_user_func_array([$handler, $method], $args);
// Allow fluid method calls
if (is_null($return) && substr(strtolower($method), 0, 3) == 'set') {
if (is_null($return) && substr(strtolower((string)$method), 0, 3) == 'set') {
return $this;
} else {
return $return;
Expand Down

0 comments on commit 0f0f136

Please sign in to comment.