| Conditions | 6 |
| Paths | 14 |
| Total Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 42 |
| Changes | 0 | ||
| 1 | <?php |
||
| 64 | public function find(StorageInterface $storage) |
||
| 65 | { |
||
| 66 | if ($this->logger) { |
||
| 67 | $this->logger->debug('Searching for importer for storage'); |
||
| 68 | } |
||
| 69 | |||
| 70 | foreach ($this->preconditions as $importerId => $precondition) { |
||
| 71 | if ($this->logger) { |
||
| 72 | $this->logger->debug("Checking preconditions for importer: '".$importerId."'"); |
||
| 73 | } |
||
| 74 | |||
| 75 | if ($precondition->isSatisfiedBy($storage, $this->logger)) { |
||
| 76 | if ($this->logger) { |
||
| 77 | $this->logger->debug("Preconditions matched for importer: '".$importerId."'. Using this import."); |
||
| 78 | } |
||
| 79 | |||
| 80 | return $importerId; |
||
| 81 | } |
||
| 82 | } |
||
| 83 | |||
| 84 | return; |
||
| 85 | } |
||
| 86 | } |
||
| 87 |