Devise\Templates\TemplatesManager::addNewVariable PHP Method

addNewVariable() private method

adds a brand new variable to the location specified in the form
private addNewVariable ( array $configContents, string $templatePath, array $input ) : array
$configContents array
$templatePath string
$input array
return array
    private function addNewVariable($configContents, $templatePath, $input)
    {
        $pathAndMethod = $input['class_path'] . '.' . $input['method_name'];
        //  if array vars array is not empty, push into vars array.
        //  If it is empty then set vars array to input data
        if (!empty($configContents[$templatePath]['vars'])) {
            $configContents[$templatePath]['vars'][$input['var_name']] = $pathAndMethod;
        } else {
            $configContents[$templatePath]['vars'] = array($input['var_name'] => $pathAndMethod);
        }
        return $configContents;
    }