| @@ 498-513 (lines=16) @@ | ||
| 495 | * |
|
| 496 | * @return EditableRepository The resource repository. |
|
| 497 | */ |
|
| 498 | public function getRepository() |
|
| 499 | { |
|
| 500 | if (!$this->started) { |
|
| 501 | throw new LogicException('Puli was not started'); |
|
| 502 | } |
|
| 503 | ||
| 504 | if (!$this->context instanceof ProjectContext) { |
|
| 505 | return null; |
|
| 506 | } |
|
| 507 | ||
| 508 | if (!$this->repo) { |
|
| 509 | $this->repo = $this->getFactory()->createRepository(); |
|
| 510 | } |
|
| 511 | ||
| 512 | return $this->repo; |
|
| 513 | } |
|
| 514 | ||
| 515 | /** |
|
| 516 | * Returns the resource discovery of the project. |
|
| @@ 520-535 (lines=16) @@ | ||
| 517 | * |
|
| 518 | * @return EditableDiscovery The resource discovery. |
|
| 519 | */ |
|
| 520 | public function getDiscovery() |
|
| 521 | { |
|
| 522 | if (!$this->started) { |
|
| 523 | throw new LogicException('Puli was not started'); |
|
| 524 | } |
|
| 525 | ||
| 526 | if (!$this->context instanceof ProjectContext) { |
|
| 527 | return null; |
|
| 528 | } |
|
| 529 | ||
| 530 | if (!$this->discovery) { |
|
| 531 | $this->discovery = $this->getFactory()->createDiscovery($this->getRepository()); |
|
| 532 | } |
|
| 533 | ||
| 534 | return $this->discovery; |
|
| 535 | } |
|
| 536 | ||
| 537 | /** |
|
| 538 | * @return object |
|