-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from mkusher/class-repository
Class Repository
- Loading branch information
Showing
24 changed files
with
562 additions
and
364 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
namespace Padawan\Command; | ||
|
||
use Padawan\Domain\Project; | ||
use Padawan\Domain\ProjectRepository; | ||
use Padawan\Domain\Generator\IndexGenerator; | ||
use Padawan\Framework\Domain\Project\Persister; | ||
use Padawan\Framework\Domain\Project\InMemoryIndex; | ||
use Symfony\Component\Console\Input\InputArgument; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Padawan\Framework\Application\Socket\SocketOutput; | ||
|
||
class UpdateCommand extends AsyncCommand | ||
{ | ||
protected function configure() | ||
{ | ||
$this->setName("update") | ||
->setDescription("Updates index for the project") | ||
->addArgument( | ||
"path", | ||
InputArgument::REQUIRED, | ||
"Path to the project root. Default: current directory" | ||
); | ||
} | ||
protected function executeAsync(InputInterface $input, SocketOutput $output) | ||
{ | ||
$path = $input->getArgument("path"); | ||
|
||
$projectRepository = $this->getContainer()->get(ProjectRepository::class); | ||
$project = $projectRepository->findByPath($path); | ||
$generator = $this->getContainer()->get(IndexGenerator::class); | ||
|
||
$generator->generateProjectIndex($project, false); | ||
$persister = $this->getContainer()->get(Persister::class); | ||
|
||
yield $output->disconnect(); | ||
yield $persister->save($project); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
namespace Padawan\Domain\Project; | ||
|
||
|
||
use Padawan\Domain\Project; | ||
|
||
/** | ||
* Interface ClassRepository | ||
*/ | ||
interface ClassRepository | ||
{ | ||
public function findByName(Project $project, FQCN $name); | ||
public function findAllByNamePart(Project $project, $name); | ||
} |
Oops, something went wrong.