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