1
0
mirror of synced 2024-12-05 03:06:05 +03:00

visibility changed && few simple fixes

This commit is contained in:
encoder64 2014-09-09 22:17:10 +03:00
parent 409f6b4bc1
commit e295a6d05e
2 changed files with 11 additions and 12 deletions

View File

@ -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;
}
/**

View File

@ -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';
}
}