| @@ -26,8 +26,8 @@ discard block | ||
| 26 | 26 | * @param array $mapping Associative list of field position in CSV as key and domain item key as value | 
| 27 | 27 | * @param \Aimeos\Controller\Common\Product\Import\Csv\Processor\Iface $processor Decorated processor | 
| 28 | 28 | */ | 
| 29 | - public function __construct( \Aimeos\MShop\Context\Item\Iface $context, array $mapping, | |
| 30 | - \Aimeos\Controller\Common\Product\Import\Csv\Processor\Iface $processor = null ); | |
| 29 | + public function __construct(\Aimeos\MShop\Context\Item\Iface $context, array $mapping, | |
| 30 | + \Aimeos\Controller\Common\Product\Import\Csv\Processor\Iface $processor = null); | |
| 31 | 31 | |
| 32 | 32 | |
| 33 | 33 | /** | 
| @@ -37,5 +37,5 @@ discard block | ||
| 37 | 37 | * @param array $data List of CSV fields with position as key and data as value | 
| 38 | 38 | * @return array List of data which hasn't been imported | 
| 39 | 39 | */ | 
| 40 | - public function process( \Aimeos\MShop\Product\Item\Iface $product, array $data ); | |
| 40 | + public function process(\Aimeos\MShop\Product\Item\Iface $product, array $data); | |
| 41 | 41 | } | 
| 42 | 42 | \ No newline at end of file | 
| @@ -24,7 +24,7 @@ discard block | ||
| 24 | 24 | * | 
| 25 | 25 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object | 
| 26 | 26 | */ | 
| 27 | - public function __construct( \Aimeos\MShop\Context\Item\Iface $context ); | |
| 27 | + public function __construct(\Aimeos\MShop\Context\Item\Iface $context); | |
| 28 | 28 | |
| 29 | 29 | /** | 
| 30 | 30 | * Returns the item or ID for the given code | 
| @@ -33,12 +33,12 @@ discard block | ||
| 33 | 33 | * @param string|null $type Item type if used and required | 
| 34 | 34 | * @return \Aimeos\MShop\Common\Item\Iface|string|null Item object, unique ID or null if not found | 
| 35 | 35 | */ | 
| 36 | - public function get( $code, $type = null ); | |
| 36 | + public function get($code, $type = null); | |
| 37 | 37 | |
| 38 | 38 | /** | 
| 39 | 39 | * Adds the item or ID to the cache | 
| 40 | 40 | * | 
| 41 | 41 | * @param \Aimeos\MShop\Common\Item\Iface $item Item object | 
| 42 | 42 | */ | 
| 43 | - public function set( \Aimeos\MShop\Common\Item\Iface $item ); | |
| 43 | + public function set(\Aimeos\MShop\Common\Item\Iface $item); | |
| 44 | 44 | } | 
| @@ -40,15 +40,15 @@ discard block | ||
| 40 | 40 | * | 
| 41 | 41 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object | 
| 42 | 42 | */ | 
| 43 | - public function __construct( \Aimeos\MShop\Context\Item\Iface $context ) | |
| 43 | + public function __construct(\Aimeos\MShop\Context\Item\Iface $context) | |
| 44 | 44 |  	{ | 
| 45 | - parent::__construct( $context ); | |
| 45 | + parent::__construct($context); | |
| 46 | 46 | |
| 47 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'catalog' ); | |
| 48 | - $result = $manager->searchItems( $manager->createSearch() ); | |
| 47 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'catalog'); | |
| 48 | + $result = $manager->searchItems($manager->createSearch()); | |
| 49 | 49 | |
| 50 | -		foreach( $result as $id => $item ) { | |
| 51 | - $this->categories[ $item->getCode() ] = $id; | |
| 50 | +		foreach ($result as $id => $item) { | |
| 51 | + $this->categories[$item->getCode()] = $id; | |
| 52 | 52 | } | 
| 53 | 53 | } | 
| 54 | 54 | |
| @@ -60,20 +60,20 @@ discard block | ||
| 60 | 60 | * @param string|null $type Not used | 
| 61 | 61 | * @return string|null Catalog ID or null if not found | 
| 62 | 62 | */ | 
| 63 | - public function get( $code, $type = null ) | |
| 63 | + public function get($code, $type = null) | |
| 64 | 64 |  	{ | 
| 65 | -		if( isset( $this->categories[$code] ) ) { | |
| 65 | +		if (isset($this->categories[$code])) { | |
| 66 | 66 | return $this->categories[$code]; | 
| 67 | 67 | } | 
| 68 | 68 | |
| 69 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'catalog' ); | |
| 69 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'catalog'); | |
| 70 | 70 | |
| 71 | 71 | $search = $manager->createSearch(); | 
| 72 | - $search->setConditions( $search->compare( '==', 'catalog.code', $code ) ); | |
| 72 | +		$search->setConditions($search->compare('==', 'catalog.code', $code)); | |
| 73 | 73 | |
| 74 | - $result = $manager->searchItems( $search ); | |
| 74 | + $result = $manager->searchItems($search); | |
| 75 | 75 | |
| 76 | - if( ( $item = reset( $result ) ) !== false ) | |
| 76 | + if (($item = reset($result)) !== false) | |
| 77 | 77 |  		{ | 
| 78 | 78 | $this->categories[$code] = $item->getId(); | 
| 79 | 79 | return $item->getId(); | 
| @@ -86,8 +86,8 @@ discard block | ||
| 86 | 86 | * | 
| 87 | 87 | * @param \Aimeos\MShop\Common\Item\Iface $item Catalog object | 
| 88 | 88 | */ | 
| 89 | - public function set( \Aimeos\MShop\Common\Item\Iface $item ) | |
| 89 | + public function set(\Aimeos\MShop\Common\Item\Iface $item) | |
| 90 | 90 |  	{ | 
| 91 | - $this->categories[ $item->getCode() ] = $item->getId(); | |
| 91 | + $this->categories[$item->getCode()] = $item->getId(); | |
| 92 | 92 | } | 
| 93 | 93 | } | 
| 94 | 94 | \ No newline at end of file | 
| @@ -42,20 +42,20 @@ discard block | ||
| 42 | 42 | * @param string|null $type Attribute type | 
| 43 | 43 | * @return string|null Product ID or null if not found | 
| 44 | 44 | */ | 
| 45 | - public function get( $code, $type = null ) | |
| 45 | + public function get($code, $type = null) | |
| 46 | 46 |  	{ | 
| 47 | -		if( isset( $this->prodmap[$code] ) ) { | |
| 47 | +		if (isset($this->prodmap[$code])) { | |
| 48 | 48 | return $this->prodmap[$code]; | 
| 49 | 49 | } | 
| 50 | 50 | |
| 51 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'product' ); | |
| 51 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'product'); | |
| 52 | 52 | |
| 53 | 53 | $search = $manager->createSearch(); | 
| 54 | - $search->setConditions( $search->compare( '==', 'product.code', $code ) ); | |
| 54 | +		$search->setConditions($search->compare('==', 'product.code', $code)); | |
| 55 | 55 | |
| 56 | - $result = $manager->searchItems( $search ); | |
| 56 | + $result = $manager->searchItems($search); | |
| 57 | 57 | |
| 58 | - if( ( $item = reset( $result ) ) !== false ) | |
| 58 | + if (($item = reset($result)) !== false) | |
| 59 | 59 |  		{ | 
| 60 | 60 | $this->prodmap[$code] = $item->getId(); | 
| 61 | 61 | return $this->prodmap[$code]; | 
| @@ -68,8 +68,8 @@ discard block | ||
| 68 | 68 | * | 
| 69 | 69 | * @param \Aimeos\MShop\Common\Item\Iface $item Product object | 
| 70 | 70 | */ | 
| 71 | - public function set( \Aimeos\MShop\Common\Item\Iface $item ) | |
| 71 | + public function set(\Aimeos\MShop\Common\Item\Iface $item) | |
| 72 | 72 |  	{ | 
| 73 | - $this->prodmap[ $item->getCode() ] = $item->getId(); | |
| 73 | + $this->prodmap[$item->getCode()] = $item->getId(); | |
| 74 | 74 | } | 
| 75 | 75 | } | 
| 76 | 76 | \ No newline at end of file | 
| @@ -27,7 +27,7 @@ | ||
| 27 | 27 | * | 
| 28 | 28 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object | 
| 29 | 29 | */ | 
| 30 | - public function __construct( \Aimeos\MShop\Context\Item\Iface $context ) | |
| 30 | + public function __construct(\Aimeos\MShop\Context\Item\Iface $context) | |
| 31 | 31 |  	{ | 
| 32 | 32 | $this->context = $context; | 
| 33 | 33 | } | 
| @@ -11,22 +11,22 @@ | ||
| 11 | 11 | * Set error reporting to maximum | 
| 12 | 12 | */ | 
| 13 | 13 | error_reporting( -1 ); | 
| 14 | -ini_set( 'display_errors', '1' ); | |
| 14 | +ini_set('display_errors', '1'); | |
| 15 | 15 | |
| 16 | -date_default_timezone_set( 'UTC' ); | |
| 16 | +date_default_timezone_set('UTC'); | |
| 17 | 17 | |
| 18 | 18 | /** | 
| 19 | 19 | * Set locale settings to reasonable defaults | 
| 20 | 20 | */ | 
| 21 | -setlocale( LC_ALL, 'en_US.UTF-8' ); | |
| 22 | -setlocale( LC_NUMERIC, 'POSIX' ); | |
| 23 | -setlocale( LC_CTYPE, 'en_US.UTF-8' ); | |
| 24 | -setlocale( LC_TIME, 'POSIX' ); | |
| 21 | +setlocale(LC_ALL, 'en_US.UTF-8'); | |
| 22 | +setlocale(LC_NUMERIC, 'POSIX'); | |
| 23 | +setlocale(LC_CTYPE, 'en_US.UTF-8'); | |
| 24 | +setlocale(LC_TIME, 'POSIX'); | |
| 25 | 25 | |
| 26 | 26 | /* | 
| 27 | 27 | * Set include path for tests | 
| 28 | 28 | */ | 
| 29 | -define( 'PATH_TESTS', __DIR__ ); | |
| 29 | +define('PATH_TESTS', __DIR__); | |
| 30 | 30 | |
| 31 | 31 | require_once 'TestHelperCntl.php'; | 
| 32 | 32 | \TestHelperCntl::bootstrap(); | 
| @@ -14,44 +14,44 @@ | ||
| 14 | 14 | |
| 15 | 15 | protected function setUp() | 
| 16 | 16 |  	{ | 
| 17 | - \Aimeos\MShop\Factory::setCache( true ); | |
| 17 | + \Aimeos\MShop\Factory::setCache(true); | |
| 18 | 18 | |
| 19 | 19 | $context = \TestHelperCntl::getContext(); | 
| 20 | - $this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Cache\Catalog\Standard( $context ); | |
| 20 | + $this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Cache\Catalog\Standard($context); | |
| 21 | 21 | } | 
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | protected function tearDown() | 
| 25 | 25 |  	{ | 
| 26 | - \Aimeos\MShop\Factory::setCache( false ); | |
| 26 | + \Aimeos\MShop\Factory::setCache(false); | |
| 27 | 27 | \Aimeos\MShop\Factory::clear(); | 
| 28 | 28 | } | 
| 29 | 29 | |
| 30 | 30 | |
| 31 | 31 | public function testGet() | 
| 32 | 32 |  	{ | 
| 33 | - $result = $this->object->get( 'root' ); | |
| 33 | +		$result = $this->object->get('root'); | |
| 34 | 34 | |
| 35 | - $this->assertNotEquals( null, $result ); | |
| 36 | - $this->assertInternalType( 'integer', $result ); | |
| 35 | + $this->assertNotEquals(null, $result); | |
| 36 | +		$this->assertInternalType('integer', $result); | |
| 37 | 37 | } | 
| 38 | 38 | |
| 39 | 39 | |
| 40 | 40 | public function testGetUnknown() | 
| 41 | 41 |  	{ | 
| 42 | - $this->assertEquals( null, $this->object->get( 'cache-test' ) ); | |
| 42 | +		$this->assertEquals(null, $this->object->get('cache-test')); | |
| 43 | 43 | } | 
| 44 | 44 | |
| 45 | 45 | |
| 46 | 46 | public function testSet() | 
| 47 | 47 |  	{ | 
| 48 | - $item = \Aimeos\MShop\Factory::createManager( \TestHelperCntl::getContext(), 'catalog' )->createItem(); | |
| 49 | - $item->setCode( 'cache-test' ); | |
| 50 | - $item->setId( 1 ); | |
| 48 | + $item = \Aimeos\MShop\Factory::createManager(\TestHelperCntl::getContext(), 'catalog')->createItem(); | |
| 49 | +		$item->setCode('cache-test'); | |
| 50 | + $item->setId(1); | |
| 51 | 51 | |
| 52 | - $this->object->set( $item ); | |
| 53 | - $id = $this->object->get( 'cache-test' ); | |
| 52 | + $this->object->set($item); | |
| 53 | +		$id = $this->object->get('cache-test'); | |
| 54 | 54 | |
| 55 | - $this->assertEquals( $item->getId(), $id ); | |
| 55 | + $this->assertEquals($item->getId(), $id); | |
| 56 | 56 | } | 
| 57 | 57 | } | 
| 58 | 58 | \ No newline at end of file | 
| @@ -14,41 +14,41 @@ | ||
| 14 | 14 | |
| 15 | 15 | protected function setUp() | 
| 16 | 16 |  	{ | 
| 17 | - \Aimeos\MShop\Factory::setCache( true ); | |
| 17 | + \Aimeos\MShop\Factory::setCache(true); | |
| 18 | 18 | |
| 19 | 19 | $context = \TestHelperCntl::getContext(); | 
| 20 | - $this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Cache\Product\Standard( $context ); | |
| 20 | + $this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Cache\Product\Standard($context); | |
| 21 | 21 | } | 
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | protected function tearDown() | 
| 25 | 25 |  	{ | 
| 26 | - \Aimeos\MShop\Factory::setCache( false ); | |
| 26 | + \Aimeos\MShop\Factory::setCache(false); | |
| 27 | 27 | \Aimeos\MShop\Factory::clear(); | 
| 28 | 28 | } | 
| 29 | 29 | |
| 30 | 30 | |
| 31 | 31 | public function testGet() | 
| 32 | 32 |  	{ | 
| 33 | - $this->assertNotEquals( null, $this->object->get( 'CNC' ) ); | |
| 33 | +		$this->assertNotEquals(null, $this->object->get('CNC')); | |
| 34 | 34 | } | 
| 35 | 35 | |
| 36 | 36 | |
| 37 | 37 | public function testGetUnknown() | 
| 38 | 38 |  	{ | 
| 39 | - $this->assertEquals( null, $this->object->get( 'cache-test' ) ); | |
| 39 | +		$this->assertEquals(null, $this->object->get('cache-test')); | |
| 40 | 40 | } | 
| 41 | 41 | |
| 42 | 42 | |
| 43 | 43 | public function testSet() | 
| 44 | 44 |  	{ | 
| 45 | - $item = \Aimeos\MShop\Factory::createManager( \TestHelperCntl::getContext(), 'product' )->createItem(); | |
| 46 | - $item->setCode( 'cache-test' ); | |
| 47 | - $item->setId( 1 ); | |
| 45 | + $item = \Aimeos\MShop\Factory::createManager(\TestHelperCntl::getContext(), 'product')->createItem(); | |
| 46 | +		$item->setCode('cache-test'); | |
| 47 | + $item->setId(1); | |
| 48 | 48 | |
| 49 | - $this->object->set( $item ); | |
| 50 | - $id = $this->object->get( 'cache-test' ); | |
| 49 | + $this->object->set($item); | |
| 50 | +		$id = $this->object->get('cache-test'); | |
| 51 | 51 | |
| 52 | - $this->assertEquals( $item->getId(), $id ); | |
| 52 | + $this->assertEquals($item->getId(), $id); | |
| 53 | 53 | } | 
| 54 | 54 | } | 
| 55 | 55 | \ No newline at end of file | 
| @@ -30,7 +30,7 @@ discard block | ||
| 30 | 30 | * @param string|null $name Name of the controller or "Standard" if null | 
| 31 | 31 | * @return \Aimeos\Controller\Jobs\Iface New controller object | 
| 32 | 32 | */ | 
| 33 | - public static function createController( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null ) | |
| 33 | + public static function createController(\Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null) | |
| 34 | 34 |  	{ | 
| 35 | 35 | /** controller/jobs/order/cleanup/unpaid/name | 
| 36 | 36 | * Class name of the used order cleanup unpaid scheduler controller implementation | 
| @@ -65,20 +65,20 @@ discard block | ||
| 65 | 65 | * @since 2014.07 | 
| 66 | 66 | * @category Developer | 
| 67 | 67 | */ | 
| 68 | -		if( $name === null ) { | |
| 69 | - $name = $context->getConfig()->get( 'controller/jobs/order/cleanup/unpaid/name', 'Standard' ); | |
| 68 | +		if ($name === null) { | |
| 69 | +			$name = $context->getConfig()->get('controller/jobs/order/cleanup/unpaid/name', 'Standard'); | |
| 70 | 70 | } | 
| 71 | 71 | |
| 72 | - if( ctype_alnum( $name ) === false ) | |
| 72 | + if (ctype_alnum($name) === false) | |
| 73 | 73 |  		{ | 
| 74 | - $classname = is_string( $name ) ? '\\Aimeos\\Controller\\Jobs\\Order\\Cleanup\\Unpaid\\' . $name : '<not a string>'; | |
| 75 | - throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); | |
| 74 | + $classname = is_string($name) ? '\\Aimeos\\Controller\\Jobs\\Order\\Cleanup\\Unpaid\\' . $name : '<not a string>'; | |
| 75 | +			throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); | |
| 76 | 76 | } | 
| 77 | 77 | |
| 78 | 78 | $iface = '\\Aimeos\\Controller\\Jobs\\Iface'; | 
| 79 | 79 | $classname = '\\Aimeos\\Controller\\Jobs\\Order\\Cleanup\\Unpaid\\' . $name; | 
| 80 | 80 | |
| 81 | - $controller = self::createControllerBase( $context, $aimeos, $classname, $iface ); | |
| 81 | + $controller = self::createControllerBase($context, $aimeos, $classname, $iface); | |
| 82 | 82 | |
| 83 | 83 | /** controller/jobs/order/cleanup/unpaid/decorators/excludes | 
| 84 | 84 | * Excludes decorators added by the "common" option from the order cleanup unpaid controllers | 
| @@ -154,6 +154,6 @@ discard block | ||
| 154 | 154 | * @see controller/jobs/order/cleanup/unpaid/decorators/excludes | 
| 155 | 155 | * @see controller/jobs/order/cleanup/unpaid/decorators/global | 
| 156 | 156 | */ | 
| 157 | - return self::addControllerDecorators( $context, $aimeos, $controller, 'order/cleanup/unpaid' ); | |
| 157 | + return self::addControllerDecorators($context, $aimeos, $controller, 'order/cleanup/unpaid'); | |
| 158 | 158 | } | 
| 159 | 159 | } | 
| 160 | 160 | \ No newline at end of file |