-
-
Notifications
You must be signed in to change notification settings - Fork 389
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 #1054 from doctrine/circular-refs-resolution
Fix circular ref in dependency resolution
- Loading branch information
Showing
3 changed files
with
57 additions
and
1 deletion.
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
31 changes: 31 additions & 0 deletions
31
tests/Doctrine/Migrations/Tests/Stub/CustomClassNameMigrationFactory.php
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,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\Migrations\Tests\Stub; | ||
|
||
use Doctrine\Migrations\AbstractMigration; | ||
use Doctrine\Migrations\Version\MigrationFactory; | ||
|
||
class CustomClassNameMigrationFactory implements MigrationFactory | ||
{ | ||
/** @var MigrationFactory */ | ||
private $parentMigrationFactory; | ||
|
||
/** @psalm-var class-string<AbstractMigration> */ | ||
private $migrationClassName; | ||
|
||
/** | ||
* @param class-string<AbstractMigration> $migrationClassName | ||
*/ | ||
public function __construct(MigrationFactory $parentMigrationFactory, string $migrationClassName) | ||
{ | ||
$this->parentMigrationFactory = $parentMigrationFactory; | ||
$this->migrationClassName = $migrationClassName; | ||
} | ||
|
||
public function createVersion(string $migrationClassName): AbstractMigration | ||
{ | ||
return $this->parentMigrationFactory->createVersion($this->migrationClassName); | ||
} | ||
} |