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
8181 * @throws LogicException Enums are not cloneable
8282 * because instances are implemented as singletons
8383 */
84- final protected function __clone ()
84+ final public function __clone ()
8585 {
8686 throw new LogicException ('Enums are not cloneable ' );
8787 }
Original file line number Diff line number Diff line change @@ -355,12 +355,10 @@ public function testCloneNotCallableAndThrowsLogicException(): void
355355
356356 $ reflectionClass = new ReflectionClass ($ enum );
357357 $ reflectionMethod = $ reflectionClass ->getMethod ('__clone ' );
358- $ this ->assertTrue ($ reflectionMethod ->isProtected (), 'The method __clone must be protected ' );
359358 $ this ->assertTrue ($ reflectionMethod ->isFinal (), 'The method __clone must be final ' );
360359
361- $ reflectionMethod ->setAccessible (true );
362360 $ this ->expectException (LogicException::class);
363- $ reflectionMethod -> invoke ( $ enum) ;
361+ clone $ enum ;
364362 }
365363
366364 public function testNotSerializable (): void
You can’t perform that action at this time.
0 commit comments