public function isCloneable() { if (!$this->isInstantiable()) { return false; } if (!$this->hasMethod('__clone')) { return true; } return $this->getMethod('__clone')->isPublic(); }
function it_might_be_cloneable(ReflectionClass $reflectionClass) { $reflectionClass->isCloneable()->willReturn(true); $this->isCloneable()->shouldBe(true); $reflectionClass->isCloneable()->willReturn(false); $this->isCloneable()->shouldBe(false); }