Skip to content
This repository was archived by the owner on Jul 9, 2023. It is now read-only.

Commit e2a704a

Browse files
committed
Solved the Singleton problem
1 parent 868771a commit e2a704a

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

src/BaseType.php

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -89,26 +89,12 @@ abstract class BaseType
8989
*
9090
* private construct for singleton
9191
*/
92-
private function __construct()
92+
public function __construct()
9393
{
9494
//
9595
}
9696

9797

98-
/**
99-
* get new instance of this
100-
*
101-
* @return static
102-
*/
103-
public static function getInstance()
104-
{
105-
if (self::$instance == null)
106-
self::$instance = new static();
107-
108-
return self::$instance;
109-
}
110-
111-
11298
/**
11399
* fetch and set from config (array)
114100
*
@@ -173,7 +159,7 @@ public function useFileNameToUpload($status = true)
173159
* and if not set these when set
174160
* then return handle method
175161
*
176-
* @param \Illuminate\Http\File $file
162+
* @param $file
177163
* @return mixed
178164
*/
179165
public function upload($file)

src/File.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function type($type = null)
2424

2525
/** @var BaseType $providerClass */
2626
$providerClass = $config['provider'];
27-
$providerClass = $providerClass::getInstance();
27+
$providerClass = new $providerClass;
2828
$providerClass->setType($type)
2929
->setConfig($config)
3030
->fetchProperties();

0 commit comments

Comments
 (0)