| Conditions | 4 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | protected function insert ( Row $row ) : void |
||
| 31 | { |
||
| 32 | if ( $this->output == null ) { |
||
| 33 | throw new SourceWatcherException( "An output must be provided" ); |
||
| 34 | } |
||
| 35 | |||
| 36 | if ( !( $this->output instanceof DatabaseOutput ) ) { |
||
| 37 | throw new SourceWatcherException( sprintf( "The output must be an instance of %s", DatabaseOutput::class ) ); |
||
| 38 | } |
||
| 39 | |||
| 40 | if ( $this->output->getOutput() == null ) { |
||
| 41 | throw new SourceWatcherException( "No database connector found. Set a connector before trying to insert a row" ); |
||
| 42 | } |
||
| 43 | |||
| 44 | $this->output->getOutput()->insert( $row ); |
||
| 45 | } |
||
| 62 |