Skip to content

Commit e55e145

Browse files
committed
chore: translates singleton pattern
1 parent 131a771 commit e55e145

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ in the factory interface.
5353
php src/Factory/AbstractFactory/client.php
5454
```
5555
### Singleton pattern
56-
Il Pattern Singleton garantisce che una classe abbia una sola istanza e fornisce un punto di accesso globale a essa.
56+
Singleton Pattern ensures that a class has only one instance and provides a global access point to it.
5757
```
5858
php src/Singleton/client.php
5959
```

src/Singleton/Singleton.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ class Singleton
99
private static ?self $instance = null;
1010

1111
/**
12-
* Rendiamo iil costruttore privato al fine di prevenire la creazione di una nuova istanza
13-
* della classe in questione attraverso l'operatore `new` al di fuori della classe.
12+
* Let's make the constructor private in order to prevent the creation of a new instance of the class in question
13+
* via the `new` operator outside the class.
1414
*/
1515
protected function __construct()
1616
{
@@ -26,14 +26,14 @@ public static function getInstance(): self
2626
}
2727

2828
/**
29-
* Rendiamo il metodo __clone() provate al fine di evitare la clonazione dell'istanza.
29+
* Let's make the __clone () method tried in order to avoid cloning the instance.
3030
*/
3131
private function __clone()
3232
{
3333
}
3434

3535
public function method(): void
3636
{
37-
echo 'Faccio qualcosa'."\n";
37+
echo 'I do something'."\n";
3838
}
3939
}

0 commit comments

Comments
 (0)