-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Doctrine components and add Symfony 5.2 support (#355)
* Update Doctrine components and add Symfony 5.2 support - Add Symfony 5.2 support (requires `symfony/doctrine-bridge:5.2`-> `doctrine/persistence:^2`) - Migrate from `doctrine/common` (deprecated) to `doctrine/*` components - Dropping support for PHP < 7.1 (`doctrine/event-manager` and `doctrine/persistence`) * Remove unused symfony/doctrine-bridge * Remove PHP < 7.1 support * Remove unused condition on CircleCI coverage test Exact same command on PHP >= and < 7.2 * Add tests for ClassInfo util class * Bump PHP minimum version to 7.2 * Bump PHPUnit version to >=8.5 to support PHP >= 7.2 * Restriction of cleaning to used items Close #355 (comment) * Adding tests for (deprecated) Doctrine Proxy Manager Close #355 (comment)
- Loading branch information
1 parent
a26bf6e
commit ffd296f
Showing
28 changed files
with
377 additions
and
242 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 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,61 @@ | ||
<?php | ||
|
||
namespace Algolia\SearchBundle\Util; | ||
|
||
/** | ||
* Retrieves information about a class. | ||
* | ||
* @internal | ||
*/ | ||
final class ClassInfo | ||
{ | ||
/** | ||
* Get class name of the given object. | ||
* | ||
* @param object $object | ||
* | ||
* @return string | ||
*/ | ||
public static function getClass($object) | ||
{ | ||
return self::getRealClassName(get_class($object)); | ||
} | ||
|
||
/** | ||
* Get the real class name of a class name that could be a proxy. | ||
* | ||
* @param string $className | ||
* | ||
* @return string | ||
*/ | ||
public static function getRealClassName($className) | ||
{ | ||
// Define variable for static analysis | ||
$positionPm = false; | ||
// __CG__: Doctrine Common Marker for Proxy (ODM < 2.0 and ORM < 3.0) | ||
// __PM__: Ocramius Proxy Manager (ODM >= 2.0) | ||
if ((false === $positionCg = strrpos($className, '\\__CG__\\')) && | ||
(false === $positionPm = strrpos($className, '\\__PM__\\'))) { | ||
return $className; | ||
} | ||
|
||
if (false !== $positionCg) { | ||
return substr($className, $positionCg + 8); | ||
} | ||
|
||
$className = ltrim($className, '\\'); | ||
|
||
return substr( | ||
$className, | ||
8 + $positionPm, | ||
strrpos($className, '\\') - ($positionPm + 8) | ||
); | ||
} | ||
|
||
/** | ||
* @codeCoverageIgnore | ||
*/ | ||
private function __construct() | ||
{ | ||
} | ||
} |
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
Oops, something went wrong.