Skip to content

Fix tests #1677

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/Doctrine/DoctrineHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
use Doctrine\Persistence\Mapping\Driver\MappingDriver;
use Doctrine\Persistence\Mapping\Driver\MappingDriverChain;
use Doctrine\Persistence\Mapping\MappingException as PersistenceMappingException;
use Doctrine\Persistence\Mapping\StaticReflectionService;
use Symfony\Bundle\MakerBundle\Util\ClassNameDetails;
use Symfony\Component\Uid\Ulid;
use Symfony\Component\Uid\Uuid;
Expand Down
62 changes: 62 additions & 0 deletions src/Doctrine/StaticReflectionService.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?php

/*
* This file is part of the Symfony MakerBundle package.
*
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Bundle\MakerBundle\Doctrine;

use Doctrine\Persistence\Mapping\ReflectionService;

/**
* @internal replacing removed Doctrine\Persistence\Mapping\StaticReflectionService
*/
final class StaticReflectionService implements ReflectionService
{
public function getParentClasses(string $class): array
{
return [];
}

public function getClassShortName(string $class): string
{
$nsSeparatorLastPosition = strrpos($class, '\\');

if ($nsSeparatorLastPosition !== false) {
$class = substr($class, $nsSeparatorLastPosition + 1);
}

return $class;
}

public function getClassNamespace(string $class): string
{
$namespace = '';

if (strpos($class, '\\') !== false) {
$namespace = strrev(substr(strrev($class), (int) strpos(strrev($class), '\\') + 1));
}

return $namespace;
}

public function getClass(string $class): \ReflectionClass
{
return new \ReflectionClass($class);
}

public function getAccessibleProperty(string $class, string $property): ?\ReflectionProperty
{
return null;
}

public function hasPublicMethod(string $class, string $method): bool
{
return true;
}
}
Loading