| @@ -17,144 +17,144 @@ | ||
| 17 | 17 | |
| 18 | 18 | public function testGetId() | 
| 19 | 19 |  	{ | 
| 20 | - $this->assertEquals( null, $this->object->getId() ); | |
| 20 | + $this->assertEquals(null, $this->object->getId()); | |
| 21 | 21 | } | 
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | public function testGetSetCompany() | 
| 25 | 25 |  	{ | 
| 26 | - $this->object->setCompany( 'ABC' ); | |
| 27 | - $this->assertEquals( 'ABC', $this->object->getCompany() ); | |
| 26 | +		$this->object->setCompany('ABC'); | |
| 27 | +		$this->assertEquals('ABC', $this->object->getCompany()); | |
| 28 | 28 | } | 
| 29 | 29 | |
| 30 | 30 | |
| 31 | 31 | public function testGetSetVatID() | 
| 32 | 32 |  	{ | 
| 33 | - $this->object->setVatID( 'AT0000' ); | |
| 34 | - $this->assertEquals( 'AT0000', $this->object->getVatID() ); | |
| 33 | +		$this->object->setVatID('AT0000'); | |
| 34 | +		$this->assertEquals('AT0000', $this->object->getVatID()); | |
| 35 | 35 | } | 
| 36 | 36 | |
| 37 | 37 | |
| 38 | 38 | public function testGetSetSalutation() | 
| 39 | 39 |  	{ | 
| 40 | - $this->object->setSalutation( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_UNKNOWN ); | |
| 41 | - $this->assertEquals( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_UNKNOWN, $this->object->getSalutation() ); | |
| 40 | + $this->object->setSalutation(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_UNKNOWN); | |
| 41 | + $this->assertEquals(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_UNKNOWN, $this->object->getSalutation()); | |
| 42 | 42 | |
| 43 | - $this->object->setSalutation( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_COMPANY ); | |
| 44 | - $this->assertEquals( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_COMPANY, $this->object->getSalutation() ); | |
| 43 | + $this->object->setSalutation(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_COMPANY); | |
| 44 | + $this->assertEquals(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_COMPANY, $this->object->getSalutation()); | |
| 45 | 45 | |
| 46 | - $this->object->setSalutation( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MRS ); | |
| 47 | - $this->assertEquals( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MRS, $this->object->getSalutation() ); | |
| 46 | + $this->object->setSalutation(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MRS); | |
| 47 | + $this->assertEquals(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MRS, $this->object->getSalutation()); | |
| 48 | 48 | |
| 49 | - $this->object->setSalutation( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MISS ); | |
| 50 | - $this->assertEquals( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MISS, $this->object->getSalutation() ); | |
| 49 | + $this->object->setSalutation(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MISS); | |
| 50 | + $this->assertEquals(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MISS, $this->object->getSalutation()); | |
| 51 | 51 | |
| 52 | - $this->object->setSalutation( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MR ); | |
| 53 | - $this->assertEquals( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MR, $this->object->getSalutation() ); | |
| 52 | + $this->object->setSalutation(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MR); | |
| 53 | + $this->assertEquals(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MR, $this->object->getSalutation()); | |
| 54 | 54 | } | 
| 55 | 55 | |
| 56 | 56 | |
| 57 | 57 | public function testGetSetTitle() | 
| 58 | 58 |  	{ | 
| 59 | - $this->object->setTitle( 'Prof. Dr.' ); | |
| 60 | - $this->assertEquals( 'Prof. Dr.', $this->object->getTitle() ); | |
| 59 | +		$this->object->setTitle('Prof. Dr.'); | |
| 60 | +		$this->assertEquals('Prof. Dr.', $this->object->getTitle()); | |
| 61 | 61 | } | 
| 62 | 62 | |
| 63 | 63 | |
| 64 | 64 | public function testGetSetFirstname() | 
| 65 | 65 |  	{ | 
| 66 | - $this->object->setFirstname( 'first' ); | |
| 67 | - $this->assertEquals( 'first', $this->object->getFirstname() ); | |
| 66 | +		$this->object->setFirstname('first'); | |
| 67 | +		$this->assertEquals('first', $this->object->getFirstname()); | |
| 68 | 68 | } | 
| 69 | 69 | |
| 70 | 70 | |
| 71 | 71 | public function testGetSetLastname() | 
| 72 | 72 |  	{ | 
| 73 | - $this->object->setLastname( 'last' ); | |
| 74 | - $this->assertEquals( 'last', $this->object->getLastname() ); | |
| 73 | +		$this->object->setLastname('last'); | |
| 74 | +		$this->assertEquals('last', $this->object->getLastname()); | |
| 75 | 75 | } | 
| 76 | 76 | |
| 77 | 77 | |
| 78 | 78 | public function testGetSetAddress1() | 
| 79 | 79 |  	{ | 
| 80 | - $this->object->setAddress1( 'test street' ); | |
| 81 | - $this->assertEquals( 'test street', $this->object->getAddress1() ); | |
| 80 | +		$this->object->setAddress1('test street'); | |
| 81 | +		$this->assertEquals('test street', $this->object->getAddress1()); | |
| 82 | 82 | } | 
| 83 | 83 | |
| 84 | 84 | |
| 85 | 85 | public function testGetSetAddress2() | 
| 86 | 86 |  	{ | 
| 87 | - $this->object->setAddress2( '1' ); | |
| 88 | - $this->assertEquals( '1', $this->object->getAddress2() ); | |
| 87 | +		$this->object->setAddress2('1'); | |
| 88 | +		$this->assertEquals('1', $this->object->getAddress2()); | |
| 89 | 89 | } | 
| 90 | 90 | |
| 91 | 91 | |
| 92 | 92 | public function testGetSetAddress3() | 
| 93 | 93 |  	{ | 
| 94 | - $this->object->setAddress3( 'EG' ); | |
| 95 | - $this->assertEquals( 'EG', $this->object->getAddress3() ); | |
| 94 | +		$this->object->setAddress3('EG'); | |
| 95 | +		$this->assertEquals('EG', $this->object->getAddress3()); | |
| 96 | 96 | } | 
| 97 | 97 | |
| 98 | 98 | |
| 99 | 99 | public function testGetSetPostal() | 
| 100 | 100 |  	{ | 
| 101 | - $this->object->setPostal( '12345' ); | |
| 102 | - $this->assertEquals( '12345', $this->object->getPostal() ); | |
| 101 | +		$this->object->setPostal('12345'); | |
| 102 | +		$this->assertEquals('12345', $this->object->getPostal()); | |
| 103 | 103 | } | 
| 104 | 104 | |
| 105 | 105 | |
| 106 | 106 | public function testGetSetCity() | 
| 107 | 107 |  	{ | 
| 108 | - $this->object->setCity( 'Munich' ); | |
| 109 | - $this->assertEquals( 'Munich', $this->object->getCity() ); | |
| 108 | +		$this->object->setCity('Munich'); | |
| 109 | +		$this->assertEquals('Munich', $this->object->getCity()); | |
| 110 | 110 | } | 
| 111 | 111 | |
| 112 | 112 | |
| 113 | 113 | public function testGetSetState() | 
| 114 | 114 |  	{ | 
| 115 | - $this->object->setState( 'Bayern' ); | |
| 116 | - $this->assertEquals( 'Bayern', $this->object->getState() ); | |
| 115 | +		$this->object->setState('Bayern'); | |
| 116 | +		$this->assertEquals('Bayern', $this->object->getState()); | |
| 117 | 117 | } | 
| 118 | 118 | |
| 119 | 119 | |
| 120 | 120 | public function testGetSetCountryId() | 
| 121 | 121 |  	{ | 
| 122 | - $this->object->setCountryId( 'DE' ); | |
| 123 | - $this->assertEquals( 'DE', $this->object->getCountryId() ); | |
| 122 | +		$this->object->setCountryId('DE'); | |
| 123 | +		$this->assertEquals('DE', $this->object->getCountryId()); | |
| 124 | 124 | } | 
| 125 | 125 | |
| 126 | 126 | |
| 127 | 127 | public function testGetSetLanguageId() | 
| 128 | 128 |  	{ | 
| 129 | - $this->object->setLanguageId( 'de' ); | |
| 130 | - $this->assertEquals( 'de', $this->object->getLanguageId() ); | |
| 129 | +		$this->object->setLanguageId('de'); | |
| 130 | +		$this->assertEquals('de', $this->object->getLanguageId()); | |
| 131 | 131 | } | 
| 132 | 132 | |
| 133 | 133 | |
| 134 | 134 | public function testGetSetTelephone() | 
| 135 | 135 |  	{ | 
| 136 | - $this->object->setTelephone( '089123456789' ); | |
| 137 | - $this->assertEquals( '089123456789', $this->object->getTelephone() ); | |
| 136 | +		$this->object->setTelephone('089123456789'); | |
| 137 | +		$this->assertEquals('089123456789', $this->object->getTelephone()); | |
| 138 | 138 | } | 
| 139 | 139 | |
| 140 | 140 | |
| 141 | 141 | public function testGetSetTelefax() | 
| 142 | 142 |  	{ | 
| 143 | - $this->object->setTelefax( '089987654321' ); | |
| 144 | - $this->assertEquals( '089987654321', $this->object->getTelefax() ); | |
| 143 | +		$this->object->setTelefax('089987654321'); | |
| 144 | +		$this->assertEquals('089987654321', $this->object->getTelefax()); | |
| 145 | 145 | } | 
| 146 | 146 | |
| 147 | 147 | |
| 148 | 148 | public function testGetSetWebsite() | 
| 149 | 149 |  	{ | 
| 150 | - $this->object->setWebsite( 'http://aimeos.org' ); | |
| 151 | - $this->assertEquals( 'http://aimeos.org', $this->object->getWebsite() ); | |
| 150 | +		$this->object->setWebsite('http://aimeos.org'); | |
| 151 | +		$this->assertEquals('http://aimeos.org', $this->object->getWebsite()); | |
| 152 | 152 | } | 
| 153 | 153 | |
| 154 | 154 | |
| 155 | 155 | public function testSetWebsiteInvalid() | 
| 156 | 156 |  	{ | 
| 157 | - $this->setExpectedException( 'Exception' ); | |
| 158 | - $this->object->setWebsite( 'aimeos+org' ); | |
| 157 | +		$this->setExpectedException('Exception'); | |
| 158 | +		$this->object->setWebsite('aimeos+org'); | |
| 159 | 159 | } | 
| 160 | 160 | } | 
| @@ -10,17 +10,17 @@ | ||
| 10 | 10 | public function testTerms() | 
| 11 | 11 |  	{ | 
| 12 | 12 | $client = static::createClient(); | 
| 13 | - $crawler = $client->request( 'GET', '/unittest/de/EUR/terms' ); | |
| 13 | +		$crawler = $client->request('GET', '/unittest/de/EUR/terms'); | |
| 14 | 14 | |
| 15 | -		$this->assertEquals( 1, $crawler->filter( 'body:contains("Terms")' )->count() ); | |
| 15 | +		$this->assertEquals(1, $crawler->filter('body:contains("Terms")')->count()); | |
| 16 | 16 | } | 
| 17 | 17 | |
| 18 | 18 | |
| 19 | 19 | public function testPrivacy() | 
| 20 | 20 |  	{ | 
| 21 | 21 | $client = static::createClient(); | 
| 22 | - $crawler = $client->request( 'GET', '/unittest/de/EUR/privacy' ); | |
| 22 | +		$crawler = $client->request('GET', '/unittest/de/EUR/privacy'); | |
| 23 | 23 | |
| 24 | -		$this->assertEquals( 1, $crawler->filter( 'body:contains("Privacy")' )->count() ); | |
| 24 | +		$this->assertEquals(1, $crawler->filter('body:contains("Privacy")')->count()); | |
| 25 | 25 | } | 
| 26 | 26 | } | 
| @@ -14,13 +14,13 @@ | ||
| 14 | 14 | $kernel = $this->createKernel(); | 
| 15 | 15 | $kernel->boot(); | 
| 16 | 16 | |
| 17 | - $application = new Application( $kernel ); | |
| 18 | - $application->add( new Command\SetupCommand() ); | |
| 17 | + $application = new Application($kernel); | |
| 18 | + $application->add(new Command\SetupCommand()); | |
| 19 | 19 | |
| 20 | - $command = $application->find( 'aimeos:setup' ); | |
| 21 | - $commandTester = new CommandTester( $command ); | |
| 22 | - $commandTester->execute( array( 'command' => $command->getName(), 'site' => 'unittest', 'tplsite' => 'unittest', '--option' => 'setup/default/demo:0' ) ); | |
| 20 | +		$command = $application->find('aimeos:setup'); | |
| 21 | + $commandTester = new CommandTester($command); | |
| 22 | +		$commandTester->execute(array('command' => $command->getName(), 'site' => 'unittest', 'tplsite' => 'unittest', '--option' => 'setup/default/demo:0')); | |
| 23 | 23 | |
| 24 | - $this->assertEquals( 0, $commandTester->getStatusCode() ); | |
| 24 | + $this->assertEquals(0, $commandTester->getStatusCode()); | |
| 25 | 25 | } | 
| 26 | 26 | } | 
| @@ -58,8 +58,7 @@ | ||
| 58 | 58 | |
| 59 | 59 |  			$i18n = $this->container->get('aimeos_i18n')->get( array( $locale ) ); | 
| 60 | 60 | $translation = $i18n[$locale]; | 
| 61 | - } | |
| 62 | - else | |
| 61 | + } else | |
| 63 | 62 |  		{ | 
| 64 | 63 | $translation = new \Aimeos\MW\Translation\None( 'en' ); | 
| 65 | 64 | } | 
| @@ -32,7 +32,7 @@ discard block | ||
| 32 | 32 | * @param RequestStack $requestStack Current request stack | 
| 33 | 33 | * @param Container $container Container object to access parameters | 
| 34 | 34 | */ | 
| 35 | - public function __construct( RequestStack $requestStack, Container $container ) | |
| 35 | + public function __construct(RequestStack $requestStack, Container $container) | |
| 36 | 36 |  	{ | 
| 37 | 37 | $this->requestStack = $requestStack; | 
| 38 | 38 | $this->container = $container; | 
| @@ -47,20 +47,20 @@ discard block | ||
| 47 | 47 | * @param string|null $locale Code of the current language or null for no translation | 
| 48 | 48 | * @return \Aimeos\MW\View\Iface View object | 
| 49 | 49 | */ | 
| 50 | - public function create( \Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $locale = null ) | |
| 50 | + public function create(\Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $locale = null) | |
| 51 | 51 |  	{ | 
| 52 | 52 | $config = $context->getConfig(); | 
| 53 | - $view = new \Aimeos\MW\View\Standard( $templatePaths ); | |
| 54 | - | |
| 55 | - $this->addCsrf( $view ); | |
| 56 | - $this->addAccess( $view, $context ); | |
| 57 | - $this->addConfig( $view, $config ); | |
| 58 | - $this->addNumber( $view, $config ); | |
| 59 | - $this->addParam( $view ); | |
| 60 | - $this->addRequest( $view ); | |
| 61 | - $this->addResponse( $view ); | |
| 62 | - $this->addTranslate( $view, $locale ); | |
| 63 | - $this->addUrl( $view ); | |
| 53 | + $view = new \Aimeos\MW\View\Standard($templatePaths); | |
| 54 | + | |
| 55 | + $this->addCsrf($view); | |
| 56 | + $this->addAccess($view, $context); | |
| 57 | + $this->addConfig($view, $config); | |
| 58 | + $this->addNumber($view, $config); | |
| 59 | + $this->addParam($view); | |
| 60 | + $this->addRequest($view); | |
| 61 | + $this->addResponse($view); | |
| 62 | + $this->addTranslate($view, $locale); | |
| 63 | + $this->addUrl($view); | |
| 64 | 64 | |
| 65 | 65 | return $view; | 
| 66 | 66 | } | 
| @@ -73,17 +73,17 @@ discard block | ||
| 73 | 73 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object | 
| 74 | 74 | * @return \Aimeos\MW\View\Iface Modified view object | 
| 75 | 75 | */ | 
| 76 | - protected function addAccess( \Aimeos\MW\View\Iface $view, \Aimeos\MShop\Context\Item\Iface $context ) | |
| 76 | + protected function addAccess(\Aimeos\MW\View\Iface $view, \Aimeos\MShop\Context\Item\Iface $context) | |
| 77 | 77 |  	{ | 
| 78 | 78 | $container = $this->container; | 
| 79 | 79 | |
| 80 | - $fcn = function() use ( $container, $context ) | |
| 80 | + $fcn = function() use ($container, $context) | |
| 81 | 81 |  		{ | 
| 82 | - return $container->get( 'aimeos_support' )->getGroups( $context ); | |
| 82 | +			return $container->get('aimeos_support')->getGroups($context); | |
| 83 | 83 | }; | 
| 84 | 84 | |
| 85 | - $helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, $fcn ); | |
| 86 | - $view->addHelper( 'access', $helper ); | |
| 85 | + $helper = new \Aimeos\MW\View\Helper\Access\Standard($view, $fcn); | |
| 86 | +		$view->addHelper('access', $helper); | |
| 87 | 87 | |
| 88 | 88 | return $view; | 
| 89 | 89 | } | 
| @@ -96,11 +96,11 @@ discard block | ||
| 96 | 96 | * @param \Aimeos\MW\Config\Iface $config Configuration object | 
| 97 | 97 | * @return \Aimeos\MW\View\Iface Modified view object | 
| 98 | 98 | */ | 
| 99 | - protected function addConfig( \Aimeos\MW\View\Iface $view, \Aimeos\MW\Config\Iface $config ) | |
| 99 | + protected function addConfig(\Aimeos\MW\View\Iface $view, \Aimeos\MW\Config\Iface $config) | |
| 100 | 100 |  	{ | 
| 101 | - $config = new \Aimeos\MW\Config\Decorator\Protect( clone $config, array( 'admin', 'client' ) ); | |
| 102 | - $helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config ); | |
| 103 | - $view->addHelper( 'config', $helper ); | |
| 101 | +		$config = new \Aimeos\MW\Config\Decorator\Protect(clone $config, array('admin', 'client')); | |
| 102 | + $helper = new \Aimeos\MW\View\Helper\Config\Standard($view, $config); | |
| 103 | +		$view->addHelper('config', $helper); | |
| 104 | 104 | |
| 105 | 105 | return $view; | 
| 106 | 106 | } | 
| @@ -112,11 +112,11 @@ discard block | ||
| 112 | 112 | * @param \Aimeos\MW\View\Iface $view View object | 
| 113 | 113 | * @return \Aimeos\MW\View\Iface Modified view object | 
| 114 | 114 | */ | 
| 115 | - protected function addCsrf( \Aimeos\MW\View\Iface $view ) | |
| 115 | + protected function addCsrf(\Aimeos\MW\View\Iface $view) | |
| 116 | 116 |  	{ | 
| 117 | - $token = $this->container->get( 'security.csrf.token_manager' )->getToken( '_token' ); | |
| 118 | - $helper = new \Aimeos\MW\View\Helper\Csrf\Standard( $view, '_token', $token->getValue() ); | |
| 119 | - $view->addHelper( 'csrf', $helper ); | |
| 117 | +		$token = $this->container->get('security.csrf.token_manager')->getToken('_token'); | |
| 118 | + $helper = new \Aimeos\MW\View\Helper\Csrf\Standard($view, '_token', $token->getValue()); | |
| 119 | +		$view->addHelper('csrf', $helper); | |
| 120 | 120 | |
| 121 | 121 | return $view; | 
| 122 | 122 | } | 
| @@ -129,14 +129,14 @@ discard block | ||
| 129 | 129 | * @param \Aimeos\MW\Config\Iface $config Configuration object | 
| 130 | 130 | * @return \Aimeos\MW\View\Iface Modified view object | 
| 131 | 131 | */ | 
| 132 | - protected function addNumber( \Aimeos\MW\View\Iface $view, \Aimeos\MW\Config\Iface $config ) | |
| 132 | + protected function addNumber(\Aimeos\MW\View\Iface $view, \Aimeos\MW\Config\Iface $config) | |
| 133 | 133 |  	{ | 
| 134 | - $sepDec = $config->get( 'client/html/common/format/separatorDecimal', '.' ); | |
| 135 | - $sep1000 = $config->get( 'client/html/common/format/separator1000', ' ' ); | |
| 136 | - $decimals = $config->get( 'client/html/common/format/decimals', 2 ); | |
| 134 | +		$sepDec = $config->get('client/html/common/format/separatorDecimal', '.'); | |
| 135 | +		$sep1000 = $config->get('client/html/common/format/separator1000', ' '); | |
| 136 | +		$decimals = $config->get('client/html/common/format/decimals', 2); | |
| 137 | 137 | |
| 138 | - $helper = new \Aimeos\MW\View\Helper\Number\Standard( $view, $sepDec, $sep1000, $decimals ); | |
| 139 | - $view->addHelper( 'number', $helper ); | |
| 138 | + $helper = new \Aimeos\MW\View\Helper\Number\Standard($view, $sepDec, $sep1000, $decimals); | |
| 139 | +		$view->addHelper('number', $helper); | |
| 140 | 140 | |
| 141 | 141 | return $view; | 
| 142 | 142 | } | 
| @@ -148,17 +148,17 @@ discard block | ||
| 148 | 148 | * @param \Aimeos\MW\View\Iface $view View object | 
| 149 | 149 | * @return \Aimeos\MW\View\Iface Modified view object | 
| 150 | 150 | */ | 
| 151 | - protected function addParam( \Aimeos\MW\View\Iface $view ) | |
| 151 | + protected function addParam(\Aimeos\MW\View\Iface $view) | |
| 152 | 152 |  	{ | 
| 153 | 153 | $params = array(); | 
| 154 | 154 | $request = $this->requestStack->getMasterRequest(); | 
| 155 | 155 | |
| 156 | -		if( $request !== null ) { | |
| 157 | - $params = $request->request->all() + $request->query->all() + $request->attributes->get( '_route_params' ); | |
| 156 | +		if ($request !== null) { | |
| 157 | +			$params = $request->request->all() + $request->query->all() + $request->attributes->get('_route_params'); | |
| 158 | 158 | } | 
| 159 | 159 | |
| 160 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $params ); | |
| 161 | - $view->addHelper( 'param', $helper ); | |
| 160 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $params); | |
| 161 | +		$view->addHelper('param', $helper); | |
| 162 | 162 | |
| 163 | 163 | return $view; | 
| 164 | 164 | } | 
| @@ -170,14 +170,14 @@ discard block | ||
| 170 | 170 | * @param \Aimeos\MW\View\Iface $view View object | 
| 171 | 171 | * @return \Aimeos\MW\View\Iface Modified view object | 
| 172 | 172 | */ | 
| 173 | - protected function addRequest( \Aimeos\MW\View\Iface $view ) | |
| 173 | + protected function addRequest(\Aimeos\MW\View\Iface $view) | |
| 174 | 174 |  	{ | 
| 175 | 175 | $request = $this->requestStack->getMasterRequest(); | 
| 176 | 176 | |
| 177 | - if( $request !== null ) | |
| 177 | + if ($request !== null) | |
| 178 | 178 |  		{ | 
| 179 | - $helper = new \Aimeos\MW\View\Helper\Request\Symfony2( $view, $request ); | |
| 180 | - $view->addHelper( 'request', $helper ); | |
| 179 | + $helper = new \Aimeos\MW\View\Helper\Request\Symfony2($view, $request); | |
| 180 | +			$view->addHelper('request', $helper); | |
| 181 | 181 | } | 
| 182 | 182 | |
| 183 | 183 | return $view; | 
| @@ -190,10 +190,10 @@ discard block | ||
| 190 | 190 | * @param \Aimeos\MW\View\Iface $view View object | 
| 191 | 191 | * @return \Aimeos\MW\View\Iface Modified view object | 
| 192 | 192 | */ | 
| 193 | - protected function addResponse( \Aimeos\MW\View\Iface $view ) | |
| 193 | + protected function addResponse(\Aimeos\MW\View\Iface $view) | |
| 194 | 194 |  	{ | 
| 195 | - $helper = new \Aimeos\MW\View\Helper\Response\Symfony2( $view ); | |
| 196 | - $view->addHelper( 'response', $helper ); | |
| 195 | + $helper = new \Aimeos\MW\View\Helper\Response\Symfony2($view); | |
| 196 | +		$view->addHelper('response', $helper); | |
| 197 | 197 | |
| 198 | 198 | return $view; | 
| 199 | 199 | } | 
| @@ -206,20 +206,20 @@ discard block | ||
| 206 | 206 | * @param string|null $locale ISO language code, e.g. "de" or "de_CH" | 
| 207 | 207 | * @return \Aimeos\MW\View\Iface Modified view object | 
| 208 | 208 | */ | 
| 209 | - protected function addTranslate( \Aimeos\MW\View\Iface $view, $locale ) | |
| 209 | + protected function addTranslate(\Aimeos\MW\View\Iface $view, $locale) | |
| 210 | 210 |  	{ | 
| 211 | - if( $locale !== null ) | |
| 211 | + if ($locale !== null) | |
| 212 | 212 |  		{ | 
| 213 | - $i18n = $this->container->get( 'aimeos_i18n' )->get( array( $locale ) ); | |
| 213 | +			$i18n = $this->container->get('aimeos_i18n')->get(array($locale)); | |
| 214 | 214 | $translation = $i18n[$locale]; | 
| 215 | 215 | } | 
| 216 | 216 | else | 
| 217 | 217 |  		{ | 
| 218 | - $translation = new \Aimeos\MW\Translation\None( 'en' ); | |
| 218 | +			$translation = new \Aimeos\MW\Translation\None('en'); | |
| 219 | 219 | } | 
| 220 | 220 | |
| 221 | - $helper = new \Aimeos\MW\View\Helper\Translate\Standard( $view, $translation ); | |
| 222 | - $view->addHelper( 'translate', $helper ); | |
| 221 | + $helper = new \Aimeos\MW\View\Helper\Translate\Standard($view, $translation); | |
| 222 | +		$view->addHelper('translate', $helper); | |
| 223 | 223 | |
| 224 | 224 | return $view; | 
| 225 | 225 | } | 
| @@ -231,30 +231,30 @@ discard block | ||
| 231 | 231 | * @param \Aimeos\MW\View\Iface $view View object | 
| 232 | 232 | * @return \Aimeos\MW\View\Iface Modified view object | 
| 233 | 233 | */ | 
| 234 | - protected function addUrl( \Aimeos\MW\View\Iface $view ) | |
| 234 | + protected function addUrl(\Aimeos\MW\View\Iface $view) | |
| 235 | 235 |  	{ | 
| 236 | 236 | $fixed = array(); | 
| 237 | 237 | $request = $this->requestStack->getMasterRequest(); | 
| 238 | 238 | |
| 239 | - if( $request !== null ) | |
| 239 | + if ($request !== null) | |
| 240 | 240 |  		{ | 
| 241 | 241 | $attr = $request->attributes; | 
| 242 | 242 | |
| 243 | -			if( ( $site = $attr->get( 'site' ) ) !== null ) { | |
| 243 | +			if (($site = $attr->get('site')) !== null) { | |
| 244 | 244 | $fixed['site'] = $site; | 
| 245 | 245 | } | 
| 246 | 246 | |
| 247 | -			if( ( $lang = $attr->get( 'locale' ) ) !== null ) { | |
| 247 | +			if (($lang = $attr->get('locale')) !== null) { | |
| 248 | 248 | $fixed['locale'] = $lang; | 
| 249 | 249 | } | 
| 250 | 250 | |
| 251 | -			if( ( $currency = $attr->get( 'currency' ) ) !== null ) { | |
| 251 | +			if (($currency = $attr->get('currency')) !== null) { | |
| 252 | 252 | $fixed['currency'] = $currency; | 
| 253 | 253 | } | 
| 254 | 254 | } | 
| 255 | 255 | |
| 256 | - $helper = new \Aimeos\MW\View\Helper\Url\Symfony2( $view, $this->container->get( 'router' ), $fixed ); | |
| 257 | - $view->addHelper( 'url', $helper ); | |
| 256 | +		$helper = new \Aimeos\MW\View\Helper\Url\Symfony2($view, $this->container->get('router'), $fixed); | |
| 257 | +		$view->addHelper('url', $helper); | |
| 258 | 258 | |
| 259 | 259 | return $view; | 
| 260 | 260 | } | 
| @@ -107,8 +107,7 @@ | ||
| 107 | 107 | |
| 108 | 108 |  		if( $this->container->has( 'security.token_storage' ) ) { | 
| 109 | 109 | $token = $this->container->get( 'security.token_storage' )->getToken(); | 
| 110 | - } | |
| 111 | -		else if( $this->container->has( 'security.context' ) ) { | |
| 110 | +		} else if( $this->container->has( 'security.context' ) ) { | |
| 112 | 111 | $token = $this->container->get( 'security.context' )->getToken(); | 
| 113 | 112 | } | 
| 114 | 113 | |
| @@ -31,7 +31,7 @@ discard block | ||
| 31 | 31 | * | 
| 32 | 32 | * @param Container $container Container object to access parameters | 
| 33 | 33 | */ | 
| 34 | - public function __construct( Container $container ) | |
| 34 | + public function __construct(Container $container) | |
| 35 | 35 |  	{ | 
| 36 | 36 | $this->container = $container; | 
| 37 | 37 | } | 
| @@ -44,37 +44,37 @@ discard block | ||
| 44 | 44 |  	 * @param string $type Configuration type ("frontend" or "backend") | 
| 45 | 45 | * @return \Aimeos\MShop\Context\Item\Iface Context object | 
| 46 | 46 | */ | 
| 47 | - public function get( $locale = true, $type = 'frontend' ) | |
| 47 | + public function get($locale = true, $type = 'frontend') | |
| 48 | 48 |  	{ | 
| 49 | - $config = $this->container->get( 'aimeos_config' )->get( $type ); | |
| 49 | +		$config = $this->container->get('aimeos_config')->get($type); | |
| 50 | 50 | |
| 51 | - if( self::$context === null ) | |
| 51 | + if (self::$context === null) | |
| 52 | 52 |  		{ | 
| 53 | 53 | $context = new \Aimeos\MShop\Context\Item\Standard(); | 
| 54 | - $context->setConfig( $config ); | |
| 54 | + $context->setConfig($config); | |
| 55 | 55 | |
| 56 | - $this->addDataBaseManager( $context ); | |
| 57 | - $this->addFilesystemManager( $context ); | |
| 58 | - $this->addMessageQueueManager( $context ); | |
| 59 | - $this->addLogger( $context ); | |
| 60 | - $this->addCache( $context ); | |
| 61 | - $this->addMailer( $context); | |
| 56 | + $this->addDataBaseManager($context); | |
| 57 | + $this->addFilesystemManager($context); | |
| 58 | + $this->addMessageQueueManager($context); | |
| 59 | + $this->addLogger($context); | |
| 60 | + $this->addCache($context); | |
| 61 | + $this->addMailer($context); | |
| 62 | 62 | |
| 63 | 63 | self::$context = $context; | 
| 64 | 64 | } | 
| 65 | 65 | |
| 66 | 66 | $context = self::$context; | 
| 67 | - $context->setConfig( $config ); | |
| 67 | + $context->setConfig($config); | |
| 68 | 68 | |
| 69 | - if( $locale === true ) | |
| 69 | + if ($locale === true) | |
| 70 | 70 |  		{ | 
| 71 | -			$localeItem = $this->container->get('aimeos_locale')->get( $context ); | |
| 72 | -			$context->setI18n( $this->container->get('aimeos_i18n')->get( array( $localeItem->getLanguageId() ) ) ); | |
| 73 | - $context->setLocale( $localeItem ); | |
| 71 | +			$localeItem = $this->container->get('aimeos_locale')->get($context); | |
| 72 | +			$context->setI18n($this->container->get('aimeos_i18n')->get(array($localeItem->getLanguageId()))); | |
| 73 | + $context->setLocale($localeItem); | |
| 74 | 74 | } | 
| 75 | 75 | |
| 76 | - $this->addSession( $context ); | |
| 77 | - $this->addUserGroups( $context); | |
| 76 | + $this->addSession($context); | |
| 77 | + $this->addUserGroups($context); | |
| 78 | 78 | |
| 79 | 79 | return $context; | 
| 80 | 80 | } | 
| @@ -86,10 +86,10 @@ discard block | ||
| 86 | 86 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object including config | 
| 87 | 87 | * @return \Aimeos\MShop\Context\Item\Iface Modified context object | 
| 88 | 88 | */ | 
| 89 | - protected function addCache( \Aimeos\MShop\Context\Item\Iface $context ) | |
| 89 | + protected function addCache(\Aimeos\MShop\Context\Item\Iface $context) | |
| 90 | 90 |  	{ | 
| 91 | - $cache = new \Aimeos\MAdmin\Cache\Proxy\Standard( $context ); | |
| 92 | - $context->setCache( $cache ); | |
| 91 | + $cache = new \Aimeos\MAdmin\Cache\Proxy\Standard($context); | |
| 92 | + $context->setCache($cache); | |
| 93 | 93 | |
| 94 | 94 | return $context; | 
| 95 | 95 | } | 
| @@ -101,10 +101,10 @@ discard block | ||
| 101 | 101 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object | 
| 102 | 102 | * @return \Aimeos\MShop\Context\Item\Iface Modified context object | 
| 103 | 103 | */ | 
| 104 | - protected function addDatabaseManager( \Aimeos\MShop\Context\Item\Iface $context ) | |
| 104 | + protected function addDatabaseManager(\Aimeos\MShop\Context\Item\Iface $context) | |
| 105 | 105 |  	{ | 
| 106 | - $dbm = new \Aimeos\MW\DB\Manager\DBAL( $context->getConfig() ); | |
| 107 | - $context->setDatabaseManager( $dbm ); | |
| 106 | + $dbm = new \Aimeos\MW\DB\Manager\DBAL($context->getConfig()); | |
| 107 | + $context->setDatabaseManager($dbm); | |
| 108 | 108 | |
| 109 | 109 | return $context; | 
| 110 | 110 | } | 
| @@ -116,10 +116,10 @@ discard block | ||
| 116 | 116 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object | 
| 117 | 117 | * @return \Aimeos\MShop\Context\Item\Iface Modified context object | 
| 118 | 118 | */ | 
| 119 | - protected function addFilesystemManager( \Aimeos\MShop\Context\Item\Iface $context ) | |
| 119 | + protected function addFilesystemManager(\Aimeos\MShop\Context\Item\Iface $context) | |
| 120 | 120 |  	{ | 
| 121 | - $fs = new \Aimeos\MW\Filesystem\Manager\Standard( $context->getConfig() ); | |
| 122 | - $context->setFilesystemManager( $fs ); | |
| 121 | + $fs = new \Aimeos\MW\Filesystem\Manager\Standard($context->getConfig()); | |
| 122 | + $context->setFilesystemManager($fs); | |
| 123 | 123 | |
| 124 | 124 | return $context; | 
| 125 | 125 | } | 
| @@ -131,10 +131,10 @@ discard block | ||
| 131 | 131 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object | 
| 132 | 132 | * @return \Aimeos\MShop\Context\Item\Iface Modified context object | 
| 133 | 133 | */ | 
| 134 | - protected function addLogger( \Aimeos\MShop\Context\Item\Iface $context ) | |
| 134 | + protected function addLogger(\Aimeos\MShop\Context\Item\Iface $context) | |
| 135 | 135 |  	{ | 
| 136 | - $logger = \Aimeos\MAdmin\Log\Manager\Factory::createManager( $context ); | |
| 137 | - $context->setLogger( $logger ); | |
| 136 | + $logger = \Aimeos\MAdmin\Log\Manager\Factory::createManager($context); | |
| 137 | + $context->setLogger($logger); | |
| 138 | 138 | |
| 139 | 139 | return $context; | 
| 140 | 140 | } | 
| @@ -147,11 +147,11 @@ discard block | ||
| 147 | 147 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object | 
| 148 | 148 | * @return \Aimeos\MShop\Context\Item\Iface Modified context object | 
| 149 | 149 | */ | 
| 150 | - protected function addMailer( \Aimeos\MShop\Context\Item\Iface $context ) | |
| 150 | + protected function addMailer(\Aimeos\MShop\Context\Item\Iface $context) | |
| 151 | 151 |  	{ | 
| 152 | 152 | $container = $this->container; | 
| 153 | -		$mail = new \Aimeos\MW\Mail\Swift( function() use ( $container) { return $container->get( 'mailer' ); } ); | |
| 154 | - $context->setMail( $mail ); | |
| 153 | +		$mail = new \Aimeos\MW\Mail\Swift(function() use ($container) { return $container->get('mailer'); } ); | |
| 154 | + $context->setMail($mail); | |
| 155 | 155 | |
| 156 | 156 | return $context; | 
| 157 | 157 | } | 
| @@ -163,10 +163,10 @@ discard block | ||
| 163 | 163 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object | 
| 164 | 164 | * @return \Aimeos\MShop\Context\Item\Iface Modified context object | 
| 165 | 165 | */ | 
| 166 | - protected function addMessageQueueManager( \Aimeos\MShop\Context\Item\Iface $context ) | |
| 166 | + protected function addMessageQueueManager(\Aimeos\MShop\Context\Item\Iface $context) | |
| 167 | 167 |  	{ | 
| 168 | - $mq = new \Aimeos\MW\MQueue\Manager\Standard( $context->getConfig() ); | |
| 169 | - $context->setMessageQueueManager( $mq ); | |
| 168 | + $mq = new \Aimeos\MW\MQueue\Manager\Standard($context->getConfig()); | |
| 169 | + $context->setMessageQueueManager($mq); | |
| 170 | 170 | |
| 171 | 171 | return $context; | 
| 172 | 172 | } | 
| @@ -178,10 +178,10 @@ discard block | ||
| 178 | 178 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object | 
| 179 | 179 | * @return \Aimeos\MShop\Context\Item\Iface Modified context object | 
| 180 | 180 | */ | 
| 181 | - protected function addSession( \Aimeos\MShop\Context\Item\Iface $context ) | |
| 181 | + protected function addSession(\Aimeos\MShop\Context\Item\Iface $context) | |
| 182 | 182 |  	{ | 
| 183 | - $session = new \Aimeos\MW\Session\Symfony2( $this->container->get( 'session' ) ); | |
| 184 | - $context->setSession( $session ); | |
| 183 | +		$session = new \Aimeos\MW\Session\Symfony2($this->container->get('session')); | |
| 184 | + $context->setSession($session); | |
| 185 | 185 | |
| 186 | 186 | return $context; | 
| 187 | 187 | } | 
| @@ -192,38 +192,38 @@ discard block | ||
| 192 | 192 | * | 
| 193 | 193 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object | 
| 194 | 194 | */ | 
| 195 | - protected function addUserGroups( \Aimeos\MShop\Context\Item\Iface $context ) | |
| 195 | + protected function addUserGroups(\Aimeos\MShop\Context\Item\Iface $context) | |
| 196 | 196 |  	{ | 
| 197 | 197 | $token = null; | 
| 198 | 198 | $username = ''; | 
| 199 | 199 | |
| 200 | -		if( $this->container->has( 'security.token_storage' ) ) { | |
| 201 | - $token = $this->container->get( 'security.token_storage' )->getToken(); | |
| 200 | +		if ($this->container->has('security.token_storage')) { | |
| 201 | +			$token = $this->container->get('security.token_storage')->getToken(); | |
| 202 | 202 | } | 
| 203 | -		else if( $this->container->has( 'security.context' ) ) { | |
| 204 | - $token = $this->container->get( 'security.context' )->getToken(); | |
| 203 | +		else if ($this->container->has('security.context')) { | |
| 204 | +			$token = $this->container->get('security.context')->getToken(); | |
| 205 | 205 | } | 
| 206 | 206 | |
| 207 | - if( is_object( $token ) ) | |
| 207 | + if (is_object($token)) | |
| 208 | 208 |  		{ | 
| 209 | - if( method_exists( $token->getUser(), 'getId' ) ) | |
| 209 | + if (method_exists($token->getUser(), 'getId')) | |
| 210 | 210 |  			{ | 
| 211 | 211 | $userid = $token->getUser()->getId(); | 
| 212 | - $context->setUserId( $userid ); | |
| 213 | - $context->setGroupIds( function() use ( $context, $userid ) | |
| 212 | + $context->setUserId($userid); | |
| 213 | + $context->setGroupIds(function() use ($context, $userid) | |
| 214 | 214 |  				{ | 
| 215 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'customer' ); | |
| 216 | - return $manager->getItem( $userid, array( 'customer/group' ) )->getGroups(); | |
| 215 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'customer'); | |
| 216 | +					return $manager->getItem($userid, array('customer/group'))->getGroups(); | |
| 217 | 217 | } ); | 
| 218 | 218 | } | 
| 219 | 219 | |
| 220 | -			if( is_object( $token->getUser() ) ) { | |
| 221 | - $username = $token->getUser()->getUsername(); | |
| 220 | +			if (is_object($token->getUser())) { | |
| 221 | + $username = $token->getUser()->getUsername(); | |
| 222 | 222 |  			} else { | 
| 223 | 223 | $username = $token->getUser(); | 
| 224 | 224 | } | 
| 225 | 225 | } | 
| 226 | 226 | |
| 227 | - $context->setEditor( $username ); | |
| 227 | + $context->setEditor($username); | |
| 228 | 228 | } | 
| 229 | 229 | } | 
| @@ -28,7 +28,7 @@ discard block | ||
| 28 | 28 | */ | 
| 29 | 29 | public function privacyAction() | 
| 30 | 30 |  	{ | 
| 31 | - return $this->render( 'AimeosShopBundle:Page:privacy.html.twig' ); | |
| 31 | +		return $this->render('AimeosShopBundle:Page:privacy.html.twig'); | |
| 32 | 32 | } | 
| 33 | 33 | |
| 34 | 34 | |
| @@ -39,6 +39,6 @@ discard block | ||
| 39 | 39 | */ | 
| 40 | 40 | public function termsAction() | 
| 41 | 41 |  	{ | 
| 42 | - return $this->render( 'AimeosShopBundle:Page:terms.html.twig' ); | |
| 42 | +		return $this->render('AimeosShopBundle:Page:terms.html.twig'); | |
| 43 | 43 | } | 
| 44 | 44 | } | 
| @@ -25,15 +25,15 @@ | ||
| 25 | 25 | * @param InputInterface $input Input object | 
| 26 | 26 | * @return \Aimeos\MShop\Locale\Item\Site\Interface[] List of site items | 
| 27 | 27 | */ | 
| 28 | - protected function getSiteItems( \Aimeos\MShop\Context\Item\Iface $context, InputInterface $input ) | |
| 28 | + protected function getSiteItems(\Aimeos\MShop\Context\Item\Iface $context, InputInterface $input) | |
| 29 | 29 |  	{ | 
| 30 | - $manager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context )->getSubManager( 'site' ); | |
| 30 | +		$manager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context)->getSubManager('site'); | |
| 31 | 31 | $search = $manager->createSearch(); | 
| 32 | 32 | |
| 33 | -		if( ( $codes = (string) $input->getArgument( 'site' ) ) !== '' ) { | |
| 34 | - $search->setConditions( $search->compare( '==', 'locale.site.code', explode( ' ', $codes ) ) ); | |
| 33 | +		if (($codes = (string) $input->getArgument('site')) !== '') { | |
| 34 | +			$search->setConditions($search->compare('==', 'locale.site.code', explode(' ', $codes))); | |
| 35 | 35 | } | 
| 36 | 36 | |
| 37 | - return $manager->searchItems( $search ); | |
| 37 | + return $manager->searchItems($search); | |
| 38 | 38 | } | 
| 39 | 39 | } | 
| @@ -14,13 +14,13 @@ | ||
| 14 | 14 | $kernel = $this->createKernel(); | 
| 15 | 15 | $kernel->boot(); | 
| 16 | 16 | |
| 17 | - $application = new Application( $kernel ); | |
| 18 | - $application->add( new Command\JobsCommand() ); | |
| 17 | + $application = new Application($kernel); | |
| 18 | + $application->add(new Command\JobsCommand()); | |
| 19 | 19 | |
| 20 | - $command = $application->find( 'aimeos:jobs' ); | |
| 21 | - $commandTester = new CommandTester( $command ); | |
| 22 | - $commandTester->execute( array( 'command' => $command->getName(), 'site' => 'unittest', 'jobs' => 'index/rebuild' ) ); | |
| 20 | +		$command = $application->find('aimeos:jobs'); | |
| 21 | + $commandTester = new CommandTester($command); | |
| 22 | +		$commandTester->execute(array('command' => $command->getName(), 'site' => 'unittest', 'jobs' => 'index/rebuild')); | |
| 23 | 23 | |
| 24 | - $this->assertEquals( 0, $commandTester->getStatusCode() ); | |
| 24 | + $this->assertEquals(0, $commandTester->getStatusCode()); | |
| 25 | 25 | } | 
| 26 | 26 | } | 
| @@ -14,13 +14,13 @@ | ||
| 14 | 14 | $kernel = $this->createKernel(); | 
| 15 | 15 | $kernel->boot(); | 
| 16 | 16 | |
| 17 | - $application = new Application( $kernel ); | |
| 18 | - $application->add( new Command\CacheCommand() ); | |
| 17 | + $application = new Application($kernel); | |
| 18 | + $application->add(new Command\CacheCommand()); | |
| 19 | 19 | |
| 20 | - $command = $application->find( 'aimeos:cache' ); | |
| 21 | - $commandTester = new CommandTester( $command ); | |
| 22 | - $commandTester->execute( array( 'command' => $command->getName(), 'site' => 'unittest' ) ); | |
| 20 | +		$command = $application->find('aimeos:cache'); | |
| 21 | + $commandTester = new CommandTester($command); | |
| 22 | +		$commandTester->execute(array('command' => $command->getName(), 'site' => 'unittest')); | |
| 23 | 23 | |
| 24 | - $this->assertEquals( 0, $commandTester->getStatusCode() ); | |
| 24 | + $this->assertEquals(0, $commandTester->getStatusCode()); | |
| 25 | 25 | } | 
| 26 | 26 | } |