DevelMailLog doesn't respect the MailInterface
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #2848968. --> Reported by: [gnuget](https://www.drupal.org/user/992990) >>> <p><code>DevelMailLog</code> extends <code>PhpMail</code> and this one implements <code>MailInterface</code></p> <p>Accord with the MailInterface, the function mail should return a boolean.</p> <blockquote><p> * @return bool<br> * TRUE if the mail was successfully accepted for delivery, otherwise FALSE. </p></blockquote> <p>But as far as I can see in the code, the <code>DevelMailLog::mail</code> method returns:</p> <div class="codeblock"> <pre><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br></span><span style="color: #007700">return </span><span style="color: #0000BB">file_put_contents</span><span style="color: #007700">(</span><span style="color: #0000BB">$output_file</span><span style="color: #007700">, </span><span style="color: #0000BB">$output</span><span style="color: #007700">);<br></span><span style="color: #0000BB">?&gt;</span></span></pre></div> <p>Which accord with PHP's documentation: </p> <blockquote><p>This function returns the number of bytes that were written to the file, or FALSE on failure.</p></blockquote> <p>So when the mail is sent instead to return true it returns a number which can be confused and is not following the interface.</p> <p>I will provide a test and a patch in my next comment. </p>
issue