File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 16
16
use Bazinga \GeocoderBundle \Mapping \ClassMetadata ;
17
17
use Bazinga \GeocoderBundle \Mapping \Exception ;
18
18
use Doctrine \Common \Annotations \Reader ;
19
+ use Doctrine \Common \Util \ClassUtils ;
19
20
20
21
/**
21
22
* @author Markus Bachmann <[email protected] >
@@ -31,14 +32,15 @@ public function __construct(Reader $reader)
31
32
32
33
public function isGeocodeable ($ object ): bool
33
34
{
34
- $ reflection = new \ ReflectionObject ($ object );
35
+ $ reflection = ClassUtils:: newReflectionObject ($ object );
35
36
36
37
return (bool ) $ this ->reader ->getClassAnnotation ($ reflection , Annotations \Geocodeable::class);
37
38
}
38
39
39
40
public function loadMetadataFromObject ($ object )
40
41
{
41
- $ reflection = new \ReflectionObject ($ object );
42
+ $ reflection = ClassUtils::newReflectionObject ($ object );
43
+
42
44
if (!$ annotation = $ this ->reader ->getClassAnnotation ($ reflection , Annotations \Geocodeable::class)) {
43
45
throw new Exception \MappingException (sprintf ('The class %s is not geocodeable ' , get_class ($ object )));
44
46
}
You can’t perform that action at this time.
0 commit comments