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