File tree Expand file tree Collapse file tree 5 files changed +47
-4
lines changed
Expand file tree Collapse file tree 5 files changed +47
-4
lines changed Original file line number Diff line number Diff line change 4343 "php" : " ^7.4 || ^8.0" ,
4444 "behat/transliterator" : " ^1.2" ,
4545 "doctrine/collections" : " ^1.2 || ^2.0" ,
46- "doctrine/common" : " ^2.13 || ^3.0" ,
4746 "doctrine/deprecations" : " ^1.0" ,
4847 "doctrine/event-manager" : " ^1.2 || ^2.0" ,
4948 "doctrine/persistence" : " ^2.2 || ^3.0" ,
5453 "require-dev" : {
5554 "doctrine/annotations" : " ^1.13 || ^2.0" ,
5655 "doctrine/cache" : " ^1.11 || ^2.0" ,
56+ "doctrine/common" : " ^2.13 || ^3.0" ,
5757 "doctrine/dbal" : " ^3.7 || ^4.0" ,
5858 "doctrine/doctrine-bundle" : " ^2.3" ,
5959 "doctrine/mongodb-odm" : " ^2.3" ,
7373 },
7474 "conflict" : {
7575 "doctrine/annotations" : " <1.13 || >=3.0" ,
76+ "doctrine/common" : " <2.13 || >=4.0" ,
7677 "doctrine/dbal" : " <3.7 || >=5.0" ,
7778 "doctrine/mongodb-odm" : " <2.3 || >=3.0" ,
7879 "doctrine/orm" : " <2.14.0 || 2.16.0 || 2.16.1 || >=4.0"
Original file line number Diff line number Diff line change 99
1010namespace Gedmo \Sortable \Mapping \Event \Adapter ;
1111
12- use Doctrine \Common \Util \ClassUtils ;
1312use Doctrine \ODM \MongoDB \Mapping \ClassMetadata ;
1413use Gedmo \Mapping \Event \Adapter \ODM as BaseAdapterODM ;
1514use Gedmo \Sortable \Mapping \Event \SortableAdapter ;
15+ use Gedmo \Tool \ClassUtils ;
1616
1717/**
1818 * Doctrine event adapter for ODM adapted
Original file line number Diff line number Diff line change 1111
1212use Doctrine \Common \Comparable ;
1313use Doctrine \Common \EventArgs ;
14- use Doctrine \Common \Util \ClassUtils ;
1514use Doctrine \Deprecations \Deprecation ;
1615use Doctrine \Persistence \Event \LifecycleEventArgs ;
1716use Doctrine \Persistence \Event \LoadClassMetadataEventArgs ;
2019use Doctrine \Persistence \ObjectManager ;
2120use Gedmo \Mapping \MappedEventSubscriber ;
2221use Gedmo \Sortable \Mapping \Event \SortableAdapter ;
22+ use Gedmo \Tool \ClassUtils ;
2323use ProxyManager \Proxy \GhostObjectInterface ;
2424
2525/**
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ /*
6+ * This file is part of the Doctrine Behavioral Extensions package.
7+ * (c) Gediminas Morkevicius <[email protected] > http://www.gediminasm.org 8+ * For the full copyright and license information, please view the LICENSE
9+ * file that was distributed with this source code.
10+ */
11+
12+ namespace Gedmo \Tool ;
13+
14+ use Doctrine \Common \Util \ClassUtils as CommonClassUtils ;
15+
16+ /**
17+ * Utility class for Doctrine Common proxies.
18+ */
19+ final class ClassUtils
20+ {
21+ private function __construct ()
22+ {
23+ }
24+
25+ /**
26+ * Gets the real class name of an object (even if it's a proxy).
27+ *
28+ * If doctrine/common is not installed, this method behaves like {@see get_class()}.
29+ *
30+ * @param TObject $object
31+ * @return class-string<TObject>
32+ * @template TObject of object
33+ */
34+ public static function getClass (object $ object ): string
35+ {
36+ if (class_exists (CommonClassUtils::class)) {
37+ return CommonClassUtils::getClass ($ object );
38+ }
39+
40+ return get_class ($ object );
41+ }
42+ }
Original file line number Diff line number Diff line change 99
1010namespace Gedmo \Tool \Wrapper ;
1111
12- use Doctrine \Common \Util \ClassUtils ;
1312use Doctrine \ORM \EntityManagerInterface ;
1413use Doctrine \ORM \Mapping \ClassMetadata ;
1514use Doctrine \Persistence \Proxy as PersistenceProxy ;
15+ use Gedmo \Tool \ClassUtils ;
1616
1717/**
1818 * Wraps entity or proxy for more convenient
You can’t perform that action at this time.
0 commit comments