Code Duplication    Length = 13-13 lines in 3 locations

src/RunOpenCode/ExchangeRate/Source/Api/NationalBankOfSerbiaXmlSaxParser.php 3 locations

@@ 121-133 (lines=13) @@
118
119
            if ($name === 'ITEM') {
120
121
                if (array_key_exists('buyingRate', $this->currentRate)) {
122
123
                    $this->rates[] = new Rate(
124
                        NationalBankOfSerbiaDomCrawlerSource::NAME,
125
                        $this->currentRate['buyingRate'] / $this->currentRate['unit'],
126
                        $this->currentRate['currencyCode'],
127
                        $this->rateType . '_buying',
128
                        $this->date,
129
                        'RSD',
130
                        new \DateTime('now'),
131
                        new \DateTime('now')
132
                    );
133
                }
134
135
                if (array_key_exists('sellingRate', $this->currentRate)) {
136
@@ 135-147 (lines=13) @@
132
                    );
133
                }
134
135
                if (array_key_exists('sellingRate', $this->currentRate)) {
136
137
                    $this->rates[] = new Rate(
138
                        NationalBankOfSerbiaDomCrawlerSource::NAME,
139
                        $this->currentRate['sellingRate'] / $this->currentRate['unit'],
140
                        $this->currentRate['currencyCode'],
141
                        $this->rateType . '_selling',
142
                        $this->date,
143
                        'RSD',
144
                        new \DateTime('now'),
145
                        new \DateTime('now')
146
                    );
147
                }
148
149
                if (array_key_exists('middleRate', $this->currentRate)) {
150
@@ 149-161 (lines=13) @@
146
                    );
147
                }
148
149
                if (array_key_exists('middleRate', $this->currentRate)) {
150
151
                    $this->rates[] = new Rate(
152
                        NationalBankOfSerbiaDomCrawlerSource::NAME,
153
                        $this->currentRate['middleRate'] / $this->currentRate['unit'],
154
                        $this->currentRate['currencyCode'],
155
                        'default',
156
                        $this->date,
157
                        'RSD',
158
                        new \DateTime('now'),
159
                        new \DateTime('now')
160
                    );
161
                }
162
163
                $this->currentRate = array();
164
            }