| Conditions | 1 |
| Paths | 1 |
| Total Lines | 56 |
| Code Lines | 45 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 13 | public function testProcess() |
||
| 14 | { |
||
| 15 | $context = \TestHelperCntl::getContext(); |
||
| 16 | $mapping = array( |
||
| 17 | 0 => 'order.base.service.type', |
||
| 18 | 1 => 'order.base.service.code', |
||
| 19 | 2 => 'order.base.service.name', |
||
| 20 | 3 => 'order.base.service.mediaurl', |
||
| 21 | 4 => 'order.base.service.price', |
||
| 22 | 5 => 'order.base.service.costs', |
||
| 23 | 6 => 'order.base.service.rebate', |
||
| 24 | 7 => 'order.base.service.taxrate', |
||
| 25 | 8 => 'order.base.service.attribute.type', |
||
| 26 | 9 => 'order.base.service.attribute.code', |
||
| 27 | 10 => 'order.base.service.attribute.name', |
||
| 28 | 11 => 'order.base.service.attribute.value', |
||
| 29 | ); |
||
| 30 | |||
| 31 | |||
| 32 | $object = new \Aimeos\Controller\Common\Order\Export\Csv\Processor\Service\Standard( $context, $mapping ); |
||
| 33 | |||
| 34 | $invoice = $this->getInvoice( $context ); |
||
| 35 | $order = \Aimeos\MShop::create( $context, 'order/base' )->load( $invoice->getBaseId() ); |
||
|
1 ignored issue
–
show
|
|||
| 36 | |||
| 37 | $data = $object->process( $invoice, $order ); |
||
| 38 | |||
| 39 | |||
| 40 | $this->assertEquals( 2, count( $data ) ); |
||
| 41 | |||
| 42 | $this->assertEquals( 12, count( $data[0] ) ); |
||
| 43 | $this->assertEquals( 'payment', $data[0][0] ); |
||
| 44 | $this->assertEquals( 'OGONE', $data[0][1] ); |
||
| 45 | $this->assertEquals( 'ogone', $data[0][2] ); |
||
| 46 | $this->assertEquals( 'somewhere/thump1.jpg', $data[0][3] ); |
||
| 47 | $this->assertEquals( '0.00', $data[0][4] ); |
||
| 48 | $this->assertEquals( '0.00', $data[0][5] ); |
||
| 49 | $this->assertEquals( '0.00', $data[0][6] ); |
||
| 50 | $this->assertEquals( '0.0000', $data[0][7] ); |
||
| 51 | $this->assertEquals( "payment\npayment\npayment\npayment\npayment\npayment\npayment\npayment\npayment", $data[0][8] ); |
||
| 52 | $this->assertEquals( "ACOWNER\nACSTRING\nNAME\nOgone-alias-name\nOgone-alias-value\nREFID\nTXDATE\nX-ACCOUNT\nX-STATUS", $data[0][9] ); |
||
| 53 | $this->assertEquals( "account owner\naccount number\npayment method\nogone alias name\nogone alias value\nreference id\ntransaction date\ntransaction account\ntransaction status", $data[0][10] ); |
||
| 54 | $this->assertEquals( "test user\n9876543\nCreditCard\naliasName\naliasValue\n12345678\n2009-08-18\nKraft02\n9", $data[0][11] ); |
||
| 55 | |||
| 56 | $this->assertEquals( 12, count( $data[1] ) ); |
||
| 57 | $this->assertEquals( 'delivery', $data[1][0] ); |
||
| 58 | $this->assertEquals( '73', $data[1][1] ); |
||
| 59 | $this->assertEquals( 'solucia', $data[1][2] ); |
||
| 60 | $this->assertEquals( 'somewhere/thump1.jpg', $data[1][3] ); |
||
| 61 | $this->assertEquals( '0.00', $data[1][4] ); |
||
| 62 | $this->assertEquals( '5.00', $data[1][5] ); |
||
| 63 | $this->assertEquals( '0.00', $data[1][6] ); |
||
| 64 | $this->assertEquals( '0.0000', $data[1][7] ); |
||
| 65 | $this->assertEquals( '', $data[1][8] ); |
||
| 66 | $this->assertEquals( '', $data[1][9] ); |
||
| 67 | $this->assertEquals( '', $data[1][10] ); |
||
| 68 | $this->assertEquals( '', $data[1][11] ); |
||
| 69 | } |
||
| 88 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths