Skip to content

Commit 812f7f1

Browse files
committed
Trait - Private methods cannot be final
1 parent 72aa89d commit 812f7f1

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ vendor
77
.scannerwork
88
phpunit.coverage.xml
99
phpunit.report.xml
10-
10+
.phpunit.result.cache

src/Singleton.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,29 @@ trait Singleton
66
{
77
protected function __construct()
88
{
9+
// Constructor cannot be public
910
}
1011

1112
/**
1213
* @throws SingletonException
1314
*/
14-
final public function __clone()
15+
public function __clone()
1516
{
1617
throw new SingletonException('You can not clone a singleton.');
1718
}
1819

1920
/**
2021
* @throws SingletonException
2122
*/
22-
final public function __sleep()
23+
public function __sleep()
2324
{
2425
throw new SingletonException('You can not serialize a singleton.');
2526
}
2627

2728
/**
2829
* @throws SingletonException
2930
*/
30-
final public function __wakeup()
31+
public function __wakeup()
3132
{
3233
throw new SingletonException('You can not deserialize a singleton.');
3334
}

0 commit comments

Comments
 (0)