@@ -28,7 +28,7 @@ |
||
28 | 28 | * |
29 | 29 | * This function will return a UUID |
30 | 30 | * |
31 | - * @return type string |
|
31 | + * @return string string |
|
32 | 32 | */ |
33 | 33 | public static function generate() |
34 | 34 | { |
@@ -35,17 +35,17 @@ |
||
35 | 35 | |
36 | 36 | mt_srand((double)microtime()*10000); |
37 | 37 | $charid = strtoupper(md5(uniqid(rand(), true))); |
38 | - $hyphen = chr(45);// "-" |
|
38 | + $hyphen = chr(45); // "-" |
|
39 | 39 | $uuid = chr(123)// "{" |
40 | 40 | .substr($charid, 0, 8).$hyphen |
41 | 41 | .substr($charid, 8, 4).$hyphen |
42 | - .substr($charid,12, 4).$hyphen |
|
43 | - .substr($charid,16, 4).$hyphen |
|
44 | - .substr($charid,20,12) |
|
45 | - .chr(125);// "}" |
|
42 | + .substr($charid, 12, 4).$hyphen |
|
43 | + .substr($charid, 16, 4).$hyphen |
|
44 | + .substr($charid, 20, 12) |
|
45 | + .chr(125); // "}" |
|
46 | 46 | |
47 | - $uuid = str_replace('{', '' , $uuid); |
|
48 | - $uuid = str_replace('}', '' , $uuid); |
|
47 | + $uuid = str_replace('{', '', $uuid); |
|
48 | + $uuid = str_replace('}', '', $uuid); |
|
49 | 49 | |
50 | 50 | return $uuid; |
51 | 51 |
@@ -14,6 +14,6 @@ |
||
14 | 14 | */ |
15 | 15 | protected static function getFacadeAccessor() |
16 | 16 | { |
17 | - return UUID::class; |
|
17 | + return UUID::class; |
|
18 | 18 | } |
19 | 19 | } |
20 | 20 | \ No newline at end of file |
@@ -7,11 +7,11 @@ discard block |
||
7 | 7 | |
8 | 8 | class larauuidServiceProvider extends ServiceProvider |
9 | 9 | { |
10 | - /** |
|
11 | - * Indicates if loading of the provider is deferred. |
|
12 | - * |
|
13 | - * @var bool |
|
14 | - */ |
|
10 | + /** |
|
11 | + * Indicates if loading of the provider is deferred. |
|
12 | + * |
|
13 | + * @var bool |
|
14 | + */ |
|
15 | 15 | protected $defer = false; |
16 | 16 | |
17 | 17 | /** |
@@ -47,21 +47,21 @@ discard block |
||
47 | 47 | $this->app->singleton(UUIDManager::class, function () { |
48 | 48 | return new UUIDManager(); |
49 | 49 | }); |
50 | - /* $this->app->bind('larauuid',function($app){ |
|
50 | + /* $this->app->bind('larauuid',function($app){ |
|
51 | 51 | return new UUID; |
52 | 52 | });*/ |
53 | 53 | |
54 | - /* $this->app->singleton(UuidService::class, function($app){ |
|
54 | + /* $this->app->singleton(UuidService::class, function($app){ |
|
55 | 55 | return new UuidService; |
56 | 56 | });*/ |
57 | 57 | // use this if your package has a config file |
58 | 58 | // config([ |
59 | 59 | // 'config/larauuid.php', |
60 | 60 | // ]); |
61 | - /* $this->app['guid'] = $this->app->share(function($app) { |
|
61 | + /* $this->app['guid'] = $this->app->share(function($app) { |
|
62 | 62 | return new GUID; |
63 | 63 | });*/ |
64 | - /* $this->app->booting(function() { |
|
64 | + /* $this->app->booting(function() { |
|
65 | 65 | $loader = \Illuminate\Foundation\AliasLoader::getInstance(); |
66 | 66 | $loader->alias('UUID', 'emadadly\larauuid\Facades\UUID'); |
67 | 67 | });*/ |
@@ -44,7 +44,7 @@ |
||
44 | 44 | */ |
45 | 45 | public function register() |
46 | 46 | { |
47 | - $this->app->singleton(UUIDManager::class, function () { |
|
47 | + $this->app->singleton(UUIDManager::class, function() { |
|
48 | 48 | return new UUIDManager(); |
49 | 49 | }); |
50 | 50 | /* $this->app->bind('larauuid',function($app){ |
@@ -11,7 +11,7 @@ |
||
11 | 11 | protected static function boot() |
12 | 12 | { |
13 | 13 | parent::boot(); |
14 | - static::creating(function ($model) { |
|
14 | + static::creating(function($model) { |
|
15 | 15 | $model->{$model->getKeyName()} = UUIDManager::generate(); |
16 | 16 | }); |
17 | 17 | } |