Field_Textarea   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 33
rs 10
c 0
b 0
f 0
wmc 6
lcom 1
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getInput() 0 14 6
1
<?php
2
/**
3
 * Part of the Joomla Framework Form Package
4
 *
5
 * @copyright  Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
6
 * @license    GNU General Public License version 2 or later; see LICENSE
7
 */
8
9
namespace Joomla\Form;
10
11
/**
12
 * Form Field class for the Joomla Framework.
13
 * Supports a multi line area for entry of plain text
14
 *
15
 * @link        http://www.w3.org/TR/html-markup/textarea.html#textarea
16
 * @since       1.0
17
 * @deprecated  The joomla/form package is deprecated
18
 */
19
class Field_Textarea extends Field
0 ignored issues
show
Deprecated Code introduced by
The class Joomla\Form\Field has been deprecated with message: The joomla/form package is deprecated

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
20
{
21
	/**
22
	 * The form field type.
23
	 *
24
	 * @var    string
25
	 * @since  1.0
26
	 */
27
	protected $type = 'Textarea';
28
29
	/**
30
	 * Method to get the textarea field input markup.
31
	 * Use the rows and columns attributes to specify the dimensions of the area.
32
	 *
33
	 * @return  string  The field input markup.
34
	 *
35
	 * @since   1.0
36
	 */
37
	protected function getInput()
38
	{
39
		// Initialize some field attributes.
40
		$class = $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : '';
41
		$disabled = ((string) $this->element['disabled'] == 'true') ? ' disabled="disabled"' : '';
42
		$columns = $this->element['cols'] ? ' cols="' . (int) $this->element['cols'] . '"' : '';
43
		$rows = $this->element['rows'] ? ' rows="' . (int) $this->element['rows'] . '"' : '';
44
45
		// Initialize JavaScript field attributes.
46
		$onchange = $this->element['onchange'] ? ' onchange="' . (string) $this->element['onchange'] . '"' : '';
47
48
		return '<textarea name="' . $this->name . '" id="' . $this->id . '"' . $columns . $rows . $class . $disabled . $onchange . '>'
49
			. htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '</textarea>';
50
	}
51
}
52