File tree Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ public function __toString(): string
81
81
* @throws LogicException Enums are not cloneable
82
82
* because instances are implemented as singletons
83
83
*/
84
- final protected function __clone ()
84
+ final public function __clone ()
85
85
{
86
86
throw new LogicException ('Enums are not cloneable ' );
87
87
}
Original file line number Diff line number Diff line change @@ -355,12 +355,10 @@ public function testCloneNotCallableAndThrowsLogicException(): void
355
355
356
356
$ reflectionClass = new ReflectionClass ($ enum );
357
357
$ reflectionMethod = $ reflectionClass ->getMethod ('__clone ' );
358
- $ this ->assertTrue ($ reflectionMethod ->isProtected (), 'The method __clone must be protected ' );
359
358
$ this ->assertTrue ($ reflectionMethod ->isFinal (), 'The method __clone must be final ' );
360
359
361
- $ reflectionMethod ->setAccessible (true );
362
360
$ this ->expectException (LogicException::class);
363
- $ reflectionMethod -> invoke ( $ enum) ;
361
+ clone $ enum ;
364
362
}
365
363
366
364
public function testNotSerializable (): void
You can’t perform that action at this time.
0 commit comments