Skip to content

Commit a98de77

Browse files
committed
Update ClassMerger.php
1 parent 84b5a63 commit a98de77

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/Ubiquity/orm/comparator/ClassMerger.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,14 @@ public function getMethodCode($methodName,$newCode){
8585
if(\method_exists($this->class,$methodName)){
8686
$r=new \ReflectionMethod($this->class.'::'.$methodName);
8787
$oldCode=UIntrospection::getMethodCode($r,$this->classCode);
88-
$annotations=$r->getAttributes();
89-
if(\count($annotations)>0) {
90-
$oldCode = $this->model->getAnnotsEngine()->getAnnotationsStr($annotations).$oldCode;
91-
}
92-
if($this->removeBlank($oldCode)!==$this->removeBlank($newCode)){
93-
return $oldCode;
88+
if(\method_exists(\ReflectionMethod::class,'getAttributes')){
89+
$annotations=$r->getAttributes();
90+
if(\count($annotations)>0) {
91+
$oldCode = $this->model->getAnnotsEngine()->getAnnotationsStr($annotations).$oldCode;
92+
}
93+
if($this->removeBlank($oldCode)!==$this->removeBlank($newCode)){
94+
return $oldCode;
95+
}
9496
}
9597
}
9698
return $newCode;

0 commit comments

Comments
 (0)