| Conditions | 2 |
| Paths | 2 |
| Total Lines | 21 |
| Code Lines | 9 |
| Lines | 21 |
| Ratio | 100 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | public function actionTwoStep() |
||
| 19 | { |
||
| 20 | /** @var string $providerId */ |
||
| 21 | $providerId = $this->_input->filterSingle('provider', XenForo_Input::STRING); |
||
| 22 | |||
| 23 | /** @var bool $isThreemaGwProvider whether this is a provider handled by us */ |
||
| 24 | $isThreemaGwProvider = in_array($providerId, ThreemaGateway_Constants::TFA_PROVIDER_ARRAY); |
||
| 25 | |||
| 26 | if ($isThreemaGwProvider) { |
||
| 27 | $this->_getTfaModel()->threemagwSetProviderId($providerId); |
||
| 28 | } else { |
||
| 29 | // to be sure, better reset the value if we do not handle the things |
||
| 30 | // (when caching or so might retain this model) |
||
| 31 | $this->_getTfaModel()->threemagwSetProviderId(null); |
||
| 32 | } |
||
| 33 | |||
| 34 | /** @var XenForo_ControllerResponse_View $parent original response */ |
||
| 35 | $parent = parent::actionTwoStep(); |
||
| 36 | |||
| 37 | return $parent; |
||
| 38 | } |
||
| 39 | |||
| 48 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.