Code Duplication    Length = 14-14 lines in 3 locations

src/Environment/ActiveProfile.php 3 locations

@@ 76-89 (lines=14) @@
73
	 *
74
	 * @return $this
75
	 */
76
	public function changeCountry($country, $persist = TRUE)
77
	{
78
		if (!in_array($country, $this->getCountries())) {
79
			throw new ProfileConfigurationException("Country with code \"{$country}\" is not defined in active profile.");
80
		}
81
82
		$this->country = $country;
83
84
		if ($persist) {
85
			$this->profileStorage->persist();
86
		}
87
88
		return $this;
89
	}
90
91
	/**
92
	 * @param string        $language
@@ 97-110 (lines=14) @@
94
	 *
95
	 * @return $this
96
	 */
97
	public function changeLanguage($language, $persist = TRUE)
98
	{
99
		if (!in_array($language, $this->getLanguages())) {
100
			throw new ProfileConfigurationException("Language with code \"{$language}\" is not defined in active profile.");
101
		}
102
103
		$this->language = $language;
104
105
		if ($persist) {
106
			$this->profileStorage->persist();
107
		}
108
109
		return $this;
110
	}
111
112
	/**
113
	 * @param string        $currency
@@ 118-131 (lines=14) @@
115
	 *
116
	 * @return $this
117
	 */
118
	public function changeCurrency($currency, $persist = TRUE)
119
	{
120
		if (!in_array($currency, $this->getCurrencies())) {
121
			throw new ProfileConfigurationException("Currency with code \"{$currency}\" is not defined in active profile.");
122
		}
123
124
		$this->currency = $currency;
125
126
		if ($persist) {
127
			$this->profileStorage->persist();
128
		}
129
130
		return $this;
131
	}
132
133
	/***************** interface \SixtyEightPublishers\Application\Environment\IProfile *****************/
134