Code Duplication    Length = 8-9 lines in 6 locations

framework/Web/UI/TControl.php 1 location

@@ 721-728 (lines=8) @@
718
	/**
719
	 * @param bool $value set whether to enable viewstate
720
	 */
721
	public function setEnableViewState($value)
722
	{
723
		if (TPropertyValue::ensureBoolean($value)) {
724
			$this->_flags &= ~self::IS_DISABLE_VIEWSTATE;
725
		} else {
726
			$this->_flags |= self::IS_DISABLE_VIEWSTATE;
727
		}
728
	}
729
730
	/**
731
	 * Returns a controlstate value.

framework/Web/UI/WebControls/TFont.php 5 locations

@@ 92-100 (lines=9) @@
89
	/**
90
	 * @param bool $value whether the font is in bold face
91
	 */
92
	public function setBold($value)
93
	{
94
		$this->_flags |= self::IS_SET_BOLD;
95
		if (TPropertyValue::ensureBoolean($value)) {
96
			$this->_flags |= self::IS_BOLD;
97
		} else {
98
			$this->_flags &= ~self::IS_BOLD;
99
		}
100
	}
101
102
	/**
103
	 * @return bool whether the font is in italic face. Defaults to false.
@@ 113-121 (lines=9) @@
110
	/**
111
	 * @param bool $value whether the font is italic
112
	 */
113
	public function setItalic($value)
114
	{
115
		$this->_flags |= self::IS_SET_ITALIC;
116
		if (TPropertyValue::ensureBoolean($value)) {
117
			$this->_flags |= self::IS_ITALIC;
118
		} else {
119
			$this->_flags &= ~self::IS_ITALIC;
120
		}
121
	}
122
123
	/**
124
	 * @return bool whether the font is overlined. Defaults to false.
@@ 134-142 (lines=9) @@
131
	/**
132
	 * @param bool $value whether the font is overlined
133
	 */
134
	public function setOverline($value)
135
	{
136
		$this->_flags |= self::IS_SET_OVERLINE;
137
		if (TPropertyValue::ensureBoolean($value)) {
138
			$this->_flags |= self::IS_OVERLINE;
139
		} else {
140
			$this->_flags &= ~self::IS_OVERLINE;
141
		}
142
	}
143
144
	/**
145
	 * @return string the font size
@@ 172-180 (lines=9) @@
169
	/**
170
	 * @param bool $value whether the font is strikeout
171
	 */
172
	public function setStrikeout($value)
173
	{
174
		$this->_flags |= self::IS_SET_STRIKEOUT;
175
		if (TPropertyValue::ensureBoolean($value)) {
176
			$this->_flags |= self::IS_STRIKEOUT;
177
		} else {
178
			$this->_flags &= ~self::IS_STRIKEOUT;
179
		}
180
	}
181
182
	/**
183
	 * @return bool whether the font is underlined. Defaults to false.
@@ 193-201 (lines=9) @@
190
	/**
191
	 * @param bool $value whether the font is underlined
192
	 */
193
	public function setUnderline($value)
194
	{
195
		$this->_flags |= self::IS_SET_UNDERLINE;
196
		if (TPropertyValue::ensureBoolean($value)) {
197
			$this->_flags |= self::IS_UNDERLINE;
198
		} else {
199
			$this->_flags &= ~self::IS_UNDERLINE;
200
		}
201
	}
202
203
	/**
204
	 * @return string the font name (family)