Conditions | 1 |
Paths | 1 |
Total Lines | 52 |
Code Lines | 49 |
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 |
||
41 | public function testItAddsTransactionDetailsIfThereArePresentInXml(): void |
||
42 | { |
||
43 | $entry = $this->prophesize(DTO\Entry::class); |
||
44 | $this->mockedEntryTransactionDetailDecoder->addReference( |
||
45 | Argument::type(DTO\EntryTransactionDetail::class), |
||
46 | Argument::type('\SimpleXMLElement') |
||
47 | )->shouldBeCalled(); |
||
48 | $this->mockedEntryTransactionDetailDecoder->addRelatedParties( |
||
49 | Argument::type(DTO\EntryTransactionDetail::class), |
||
50 | Argument::type('\SimpleXMLElement') |
||
51 | )->shouldBeCalled(); |
||
52 | $this->mockedEntryTransactionDetailDecoder->addRelatedAgents( |
||
53 | Argument::type(DTO\EntryTransactionDetail::class), |
||
54 | Argument::type('\SimpleXMLElement') |
||
55 | )->shouldBeCalled(); |
||
56 | $this->mockedEntryTransactionDetailDecoder->addRemittanceInformation( |
||
57 | Argument::type(DTO\EntryTransactionDetail::class), |
||
58 | Argument::type('\SimpleXMLElement') |
||
59 | )->shouldBeCalled(); |
||
60 | $this->mockedEntryTransactionDetailDecoder->addRelatedDates( |
||
61 | Argument::type(DTO\EntryTransactionDetail::class), |
||
62 | Argument::type('\SimpleXMLElement') |
||
63 | )->shouldBeCalled(); |
||
64 | $this->mockedEntryTransactionDetailDecoder->addReturnInformation( |
||
65 | Argument::type(DTO\EntryTransactionDetail::class), |
||
66 | Argument::type('\SimpleXMLElement') |
||
67 | )->shouldBeCalled(); |
||
68 | $this->mockedEntryTransactionDetailDecoder->addAdditionalTransactionInformation( |
||
69 | Argument::type(DTO\EntryTransactionDetail::class), |
||
70 | Argument::type('\SimpleXMLElement') |
||
71 | )->shouldBeCalled(); |
||
72 | $this->mockedEntryTransactionDetailDecoder->addBankTransactionCode( |
||
73 | Argument::type(DTO\EntryTransactionDetail::class), |
||
74 | Argument::type('\SimpleXMLElement') |
||
75 | )->shouldBeCalled(); |
||
76 | $this->mockedEntryTransactionDetailDecoder->addCharges( |
||
77 | Argument::type(DTO\EntryTransactionDetail::class), |
||
78 | Argument::type('\SimpleXMLElement') |
||
79 | )->shouldBeCalled(); |
||
80 | $this->mockedEntryTransactionDetailDecoder->addAmountDetails( |
||
81 | Argument::type(DTO\EntryTransactionDetail::class), |
||
82 | Argument::type('\SimpleXMLElement'), |
||
83 | Argument::type('\SimpleXMLElement') |
||
84 | )->shouldBeCalled(); |
||
85 | $this->mockedEntryTransactionDetailDecoder->addAmount( |
||
86 | Argument::type(DTO\EntryTransactionDetail::class), |
||
87 | Argument::type('\SimpleXMLElement'), |
||
88 | Argument::type('\SimpleXMLElement') |
||
89 | )->shouldBeCalled(); |
||
90 | $entry->addTransactionDetail(Argument::type(DTO\EntryTransactionDetail::class))->shouldBeCalled(); |
||
91 | |||
92 | $this->decoder->addTransactionDetails($entry->reveal(), $this->getXmlEntry()); |
||
93 | } |
||
110 |