for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
class EmogrifierMailer extends Mailer
You can fix this by adding a namespace to your class:
namespace YourVendor; class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
{
private static $css_file = '';
$css_file
This check marks private properties in classes that are never used. Those properties can be removed.
public function sendHTML($to, $from, $subject, $htmlContent, $attachedFiles = false, $customheaders = false, $plainContent = false)
$cssFileLocation = Director::baseFolder() . Config::inst()->get("EmogrifierMailer", "css_file");
$cssFileHandler = fopen($cssFileLocation, 'r');
$css = fread($cssFileHandler, filesize($cssFileLocation));
fclose($cssFileHandler);
$emog = new \Pelago\Emogrifier($htmlContent, $css);
$htmlContent = $emog->emogrify();
return parent::sendHTML($to, $from, $subject, $htmlContent, $attachedFiles, $customheaders, $plainContent);
$attachedFiles
boolean
array
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example:
function acceptsInteger($int) { } $x = '123'; // string "123" // Instead of acceptsInteger($x); // we recommend to use acceptsInteger((integer) $x);
$customheaders
$plainContent
string
}
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.