Code Duplication    Length = 14-14 lines in 3 locations

src/Environment/ActiveProfile.php 3 locations

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