visibility changed && few simple fixes
This commit is contained in:
parent
409f6b4bc1
commit
e295a6d05e
@ -73,7 +73,7 @@ class <className> extends <repositoryName>
|
||||
*
|
||||
* @return string $namespace
|
||||
*/
|
||||
protected function getClassNamespace($fullClassName)
|
||||
private function getClassNamespace($fullClassName)
|
||||
{
|
||||
$namespace = substr($fullClassName, 0, strrpos($fullClassName, '\\'));
|
||||
|
||||
@ -119,7 +119,7 @@ class <className> extends <repositoryName>
|
||||
*
|
||||
* @return string $repositoryName
|
||||
*/
|
||||
protected function generateEntityRepositoryName($fullClassName)
|
||||
private function generateEntityRepositoryName($fullClassName)
|
||||
{
|
||||
$namespace = $this->getClassNamespace($fullClassName);
|
||||
|
||||
@ -136,7 +136,7 @@ class <className> extends <repositoryName>
|
||||
* @param string $fullClassName
|
||||
* @param string $outputDirectory
|
||||
*
|
||||
* @return string
|
||||
* @return void
|
||||
*/
|
||||
public function writeEntityRepositoryClass($fullClassName, $outputDirectory)
|
||||
{
|
||||
@ -152,11 +152,7 @@ class <className> extends <repositoryName>
|
||||
|
||||
if ( ! file_exists($path)) {
|
||||
file_put_contents($path, $code);
|
||||
|
||||
return $path;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -74,7 +74,7 @@ class EntityRepositoryGeneratorTest extends \Doctrine\Tests\OrmTestCase
|
||||
$ns = $this->_namespace;
|
||||
|
||||
|
||||
require_once __DIR__.'/../../Models/DDC3231/DDC3231User1.php';
|
||||
require_once __DIR__ . '/../../Models/DDC3231/DDC3231User1.php';
|
||||
|
||||
$className = $ns . '\DDC3231User1Tmp';
|
||||
$this->writeEntityClass('Doctrine\Tests\Models\DDC3231\DDC3231User1', $className);
|
||||
@ -93,7 +93,7 @@ class EntityRepositoryGeneratorTest extends \Doctrine\Tests\OrmTestCase
|
||||
$this->assertSame('Doctrine\ORM\EntityRepository', $repo->getParentClass()->getName());
|
||||
|
||||
|
||||
require_once __DIR__.'/../../Models/DDC3231/DDC3231User1NoNamespace.php';
|
||||
require_once __DIR__ . '/../../Models/DDC3231/DDC3231User1NoNamespace.php';
|
||||
|
||||
$className2 = 'DDC3231User1NoNamespaceTmp';
|
||||
$this->writeEntityClass('DDC3231User1NoNamespace', $className2);
|
||||
@ -121,7 +121,7 @@ class EntityRepositoryGeneratorTest extends \Doctrine\Tests\OrmTestCase
|
||||
$ns = $this->_namespace;
|
||||
|
||||
|
||||
require_once __DIR__.'/../../Models/DDC3231/DDC3231User2.php';
|
||||
require_once __DIR__ . '/../../Models/DDC3231/DDC3231User2.php';
|
||||
|
||||
$className = $ns . '\DDC3231User2Tmp';
|
||||
$this->writeEntityClass('Doctrine\Tests\Models\DDC3231\DDC3231User2', $className);
|
||||
@ -140,7 +140,7 @@ class EntityRepositoryGeneratorTest extends \Doctrine\Tests\OrmTestCase
|
||||
$this->assertSame('Doctrine\Tests\Models\DDC3231\DDC3231EntityRepository', $repo->getParentClass()->getName());
|
||||
|
||||
|
||||
require_once __DIR__.'/../../Models/DDC3231/DDC3231User2NoNamespace.php';
|
||||
require_once __DIR__ . '/../../Models/DDC3231/DDC3231User2NoNamespace.php';
|
||||
|
||||
$className2 = 'DDC3231User2NoNamespaceTmp';
|
||||
$this->writeEntityClass('DDC3231User2NoNamespace', $className2);
|
||||
@ -162,6 +162,7 @@ class EntityRepositoryGeneratorTest extends \Doctrine\Tests\OrmTestCase
|
||||
/**
|
||||
* @param string $className
|
||||
* @param string $newClassName
|
||||
* @return string
|
||||
*/
|
||||
private function writeEntityClass($className, $newClassName)
|
||||
{
|
||||
@ -189,7 +190,9 @@ class EntityRepositoryGeneratorTest extends \Doctrine\Tests\OrmTestCase
|
||||
{
|
||||
$this->_repositoryGenerator->setDefaultRepositoryName($defaultRepository);
|
||||
|
||||
return $this->_repositoryGenerator->writeEntityRepositoryClass($className . 'Repository', $this->_tmpDir);
|
||||
$this->_repositoryGenerator->writeEntityRepositoryClass($className . 'Repository', $this->_tmpDir);
|
||||
|
||||
return $this->_tmpDir . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $className) . 'Repository.php';
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user