| @@ 518-533 (lines=16) @@ | ||
| 515 | * |
|
| 516 | * @return EditableRepository The resource repository. |
|
| 517 | */ |
|
| 518 | public function getRepository() |
|
| 519 | { |
|
| 520 | if (!$this->started) { |
|
| 521 | throw new LogicException('Puli was not started'); |
|
| 522 | } |
|
| 523 | ||
| 524 | if (!$this->context instanceof ProjectContext) { |
|
| 525 | return null; |
|
| 526 | } |
|
| 527 | ||
| 528 | if (!$this->repo) { |
|
| 529 | $this->repo = $this->getFactory()->createRepository(); |
|
| 530 | } |
|
| 531 | ||
| 532 | return $this->repo; |
|
| 533 | } |
|
| 534 | ||
| 535 | /** |
|
| 536 | * Returns the resource discovery of the project. |
|
| @@ 540-555 (lines=16) @@ | ||
| 537 | * |
|
| 538 | * @return EditableDiscovery The resource discovery. |
|
| 539 | */ |
|
| 540 | public function getDiscovery() |
|
| 541 | { |
|
| 542 | if (!$this->started) { |
|
| 543 | throw new LogicException('Puli was not started'); |
|
| 544 | } |
|
| 545 | ||
| 546 | if (!$this->context instanceof ProjectContext) { |
|
| 547 | return null; |
|
| 548 | } |
|
| 549 | ||
| 550 | if (!$this->discovery) { |
|
| 551 | $this->discovery = $this->getFactory()->createDiscovery($this->getRepository()); |
|
| 552 | } |
|
| 553 | ||
| 554 | return $this->discovery; |
|
| 555 | } |
|
| 556 | ||
| 557 | /** |
|
| 558 | * @return object |
|