| Conditions | 6 |
| Paths | 7 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 6.0359 |
| Changes | 0 | ||
| 1 | <?php |
||
| 46 | 1 | public function buildModel() |
|
| 47 | { |
||
| 48 | 1 | if (!is_dir($this->schemaTarget)) { |
|
| 49 | 1 | if (!mkdir($this->schemaTarget, 0777) && !is_dir($this->schemaTarget)) { |
|
| 50 | throw new \RuntimeException(sprintf('Directory "%s" was not created', $this->schemaTarget)); |
||
| 51 | } |
||
| 52 | } |
||
| 53 | |||
| 54 | 1 | foreach ($this->schemaPaths as $schemaPath) { |
|
| 55 | 1 | $finder = new Finder(); |
|
| 56 | 1 | $finder->files()->name('*.schema.xml')->in($schemaPath); |
|
| 57 | 1 | foreach ($finder as $schemaFile) { |
|
| 58 | 1 | copy($schemaFile->getRealPath(), $this->schemaTarget . '/' . basename($schemaFile->getRealPath())); |
|
| 59 | } |
||
| 60 | } |
||
| 61 | |||
| 62 | 1 | $this->propelCommandProvider->execute('model:build'); |
|
| 63 | } |
||
| 64 | } |