private function Instantiator::isSafeToClone in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/doctrine/instantiator/src/Doctrine/Instantiator/Instantiator.php \Doctrine\Instantiator\Instantiator::isSafeToClone()
Checks if a class is cloneable
Parameters
ReflectionClass $reflection:
Return value
bool
1 call to Instantiator::isSafeToClone()
- Instantiator::buildAndCacheFromFactory in vendor/
doctrine/ instantiator/ src/ Doctrine/ Instantiator/ Instantiator.php - Builds the requested object and caches it in static properties for performance
File
- vendor/
doctrine/ instantiator/ src/ Doctrine/ Instantiator/ Instantiator.php, line 264
Class
- Instantiator
- @author Marco Pivetta <ocramius@gmail.com>
Namespace
Doctrine\InstantiatorCode
private function isSafeToClone(ReflectionClass $reflection) {
if (method_exists($reflection, 'isCloneable') && !$reflection
->isCloneable()) {
return false;
}
// not cloneable if it implements `__clone`, as we want to avoid calling it
return !$reflection
->hasMethod('__clone');
}