Code Duplication    Length = 18-19 lines in 2 locations

src/Aimeos/Shop/Command/AccountCommand.php 2 locations

@@ 143-160 (lines=18) @@
140
	 * @param string $password New user password
141
	 * @return \Aimeos\MShop\Customer\Item\Iface Aimeos customer item object
142
	 */
143
	protected function createCustomerItem( \Aimeos\MShop\Context\Item\Iface $context, $email, $password )
144
	{
145
		$manager = \Aimeos\MShop\Factory::createManager( $context, 'customer' );
146
147
		try {
148
			$item = $manager->findItem( $email );
149
		} catch( \Aimeos\MShop\Exception $e ) {
150
			$item = $manager->createItem();
151
		}
152
153
		$item->setCode( $email );
154
		$item->getPaymentAddress()->setEmail( $email );
155
		$item->setPassword( $password );
156
157
		$manager->saveItem( $item );
158
159
		return $item;
160
	}
161
162
163
	/**
@@ 184-202 (lines=19) @@
181
	 * @param string $code Unique customer group code
182
	 * @return \Aimeos\MShop\Customer\Item\Group\Iface Aimeos customer group item object
183
	 */
184
	protected function getGroupItem( \Aimeos\MShop\Context\Item\Iface $context, $code )
185
	{
186
		$manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( $context )->getSubmanager( 'group' );
187
188
		try
189
		{
190
			$item = $manager->findItem( $code );
191
		}
192
		catch( \Aimeos\MShop\Exception $e )
193
		{
194
			$item = $manager->createItem();
195
			$item->setLabel( $code );
196
			$item->setCode( $code );
197
198
			$manager->saveItem( $item );
199
		}
200
201
		return $item;
202
	}
203
204
205
	/**