I have a class:
class Validator { private $validationArray; private $cleanedValues; public function __construct($arg1, $arg2=NULL) { if(empty($arg2)) { $this->LoadValidatorByName($arg1); } else { $this->LoadValidatorFromLeadType($arg1, $arg2); } } private function LoadValidatorFromLeadType($lead_type, $vocabulary) { $ErrorReporter = new ErrorReporter; $taxonomy_term = reset(taxonomy_get_term_by_name($lead_type, $vocabulary)); ...some more stuff
The taxonomy_get_term_by_name function is a Drupal function, but the problem I'm experiencing is the PHP code.
When this method is called PHP, it complains:
Strict warning: Only variables should be passed by reference in Validator->LoadValidatorFromLeadType() (line 32 of [path to my file])
Line 32 is the line with:
$taxonomy_term = reset(taxonomy_get_term_by_name($lead_type, $vocabulary));
I looked at the error, and I'm sure I know what this means, but I canโt understand what is wrong with my code, which causes this warning.
source share