mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-28 02:30:20 +02:00
Merge remote-tracking branch 'origin/main' into fr-translation
This commit is contained in:
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
namespace DesignPatterns\Creational\Singleton;
|
namespace DesignPatterns\Creational\Singleton;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
|
|
||||||
final class Singleton
|
final class Singleton
|
||||||
{
|
{
|
||||||
private static ?Singleton $instance = null;
|
private static ?Singleton $instance = null;
|
||||||
@@ -36,7 +38,8 @@ final class Singleton
|
|||||||
/**
|
/**
|
||||||
* prevent from being unserialized (which would create a second instance of it)
|
* prevent from being unserialized (which would create a second instance of it)
|
||||||
*/
|
*/
|
||||||
private function __wakeup()
|
public function __wakeup()
|
||||||
{
|
{
|
||||||
|
throw new Exception("Cannot unserialize singleton");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
FROM composer:1 AS composer
|
FROM composer AS composer
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
ADD . /app
|
ADD . /app
|
||||||
RUN composer global require hirak/prestissimo
|
|
||||||
RUN composer install \
|
RUN composer install \
|
||||||
&& ./vendor/bin/phpcs --ignore=_build . \
|
&& ./vendor/bin/phpcs --ignore=_build . \
|
||||||
&& ./vendor/bin/phpunit \
|
&& ./vendor/bin/phpunit \
|
||||||
|
4438
composer.lock
generated
4438
composer.lock
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user