File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 1616use Bazinga \GeocoderBundle \Mapping \ClassMetadata ;
1717use Bazinga \GeocoderBundle \Mapping \Exception ;
1818use Doctrine \Common \Annotations \Reader ;
19+ use Doctrine \Common \Util \ClassUtils ;
1920
2021/**
2122 * @author Markus Bachmann <markus.bachmann@bachi.biz>
@@ -31,14 +32,15 @@ public function __construct(Reader $reader)
3132
3233 public function isGeocodeable ($ object ): bool
3334 {
34- $ reflection = new \ ReflectionObject ($ object );
35+ $ reflection = ClassUtils:: newReflectionObject ($ object );
3536
3637 return (bool ) $ this ->reader ->getClassAnnotation ($ reflection , Annotations \Geocodeable::class);
3738 }
3839
3940 public function loadMetadataFromObject ($ object )
4041 {
41- $ reflection = new \ReflectionObject ($ object );
42+ $ reflection = ClassUtils::newReflectionObject ($ object );
43+
4244 if (!$ annotation = $ this ->reader ->getClassAnnotation ($ reflection , Annotations \Geocodeable::class)) {
4345 throw new Exception \MappingException (sprintf ('The class %s is not geocodeable ' , get_class ($ object )));
4446 }
You can’t perform that action at this time.
0 commit comments