lajax\translatemanager\services\scanners\ScannerPhpFunction::getLanguageItem PHP Method

getLanguageItem() protected method

If there are no recognisable language elements in the array, returns null
protected getLanguageItem ( array $buffer ) : array | null
$buffer array
return array | null
    protected function getLanguageItem($buffer)
    {
        if (isset($buffer[0][0], $buffer[1], $buffer[2][0]) && $buffer[0][0] === T_CONSTANT_ENCAPSED_STRING && $buffer[1] === ',' && $buffer[2][0] === T_CONSTANT_ENCAPSED_STRING) {
            // is valid call we can extract
            $category = stripcslashes($buffer[0][1]);
            $category = mb_substr($category, 1, mb_strlen($category) - 2);
            if (!$this->isValidCategory($category)) {
                return null;
            }
            $message = implode('', $this->concatMessage($buffer));
            return [['category' => $category, 'message' => $message]];
        }
        return null;
    }