File tree Expand file tree Collapse file tree 6 files changed +17
-27
lines changed
Expand file tree Collapse file tree 6 files changed +17
-27
lines changed Original file line number Diff line number Diff line change 22
33namespace Uuid \Providers ;
44
5- use Illuminate \Support \Str ;
6- use Illuminate \Filesystem \Filesystem ;
75use Illuminate \Support \ServiceProvider ;
86
97class UuidServiceProvider extends ServiceProvider
@@ -13,15 +11,12 @@ class UuidServiceProvider extends ServiceProvider
1311 */
1412 public function boot ()
1513 {
16-
1714 }
1815
1916 /**
2017 * Register the application services.
2118 */
2219 public function register ()
2320 {
24-
2521 }
26-
2722}
Original file line number Diff line number Diff line change 66
77trait GeneratesUuid
88{
9-
10- public static function bootGeneratesUuid (): void
9+ public static function bootGeneratesUuid (): void
1110 {
1211 static ::creating (function ($ model ) {
1312 $ model ->attributes [$ model ->uuidColumn ()] = (string ) Str::uuid ();
@@ -21,10 +20,10 @@ public function uuidColumn(): string
2120
2221 public function getIncrementing ()
2322 {
24- if ($ this ->uuidColumn () == $ this ->getKeyName ()){
25- return false ;
26- }
27- return true ;
28- }
23+ if ($ this ->uuidColumn () == $ this ->getKeyName ()) {
24+ return false ;
25+ }
2926
30- }
27+ return true ;
28+ }
29+ }
Original file line number Diff line number Diff line change 22
33namespace Uuid \Tests ;
44
5- use Uuid \Traits \GeneratesUuid ;
65use Illuminate \Database \Eloquent \Model ;
6+ use Uuid \Traits \GeneratesUuid ;
77
88class PrimaryTest extends Model
99{
@@ -13,5 +13,4 @@ public function uuidColumn(): string
1313 {
1414 return 'id ' ;
1515 }
16-
17- }
16+ }
Original file line number Diff line number Diff line change 22
33namespace Uuid \Tests ;
44
5- use Uuid \Traits \GeneratesUuid ;
65use Illuminate \Database \Eloquent \Model ;
6+ use Uuid \Traits \GeneratesUuid ;
77
88class Test extends Model
99{
1010 use GeneratesUuid;
11-
12- }
11+ }
Original file line number Diff line number Diff line change 22
33namespace Uuid \Tests ;
44
5- use Illuminate \Support \Facades \Schema ;
65use Illuminate \Database \Schema \Blueprint ;
6+ use Illuminate \Support \Facades \Schema ;
77use Orchestra \Testbench \TestCase as Orchestra ;
88
99abstract class TestCase extends Orchestra
1010{
11- public function setUp () : void
11+ public function setUp () : void
1212 {
13- parent ::setUp ();
13+ parent ::setUp ();
1414
1515 Schema::create ('primary_tests ' , function (Blueprint $ table ) {
1616 $ table ->uuid ('id ' )->primary ();
@@ -20,10 +20,9 @@ public function setUp() : void
2020
2121 Schema::create ('tests ' , function (Blueprint $ table ) {
2222 $ table ->bigIncrements ('id ' );
23- $ table ->uuid ('uuid ' );
23+ $ table ->uuid ('uuid ' );
2424 $ table ->string ('name ' );
2525 $ table ->timestamps ();
2626 });
27-
2827 }
29- }
28+ }
Original file line number Diff line number Diff line change 22
33namespace Uuid \Tests \Unit ;
44
5+ use Uuid \Tests \PrimaryTest ;
56use Uuid \Tests \Test ;
67use Uuid \Tests \TestCase ;
7- use Uuid \Tests \PrimaryTest ;
8- use Illuminate \Foundation \Testing \RefreshDatabase ;
98
109class UuidTest extends TestCase
1110{
You can’t perform that action at this time.
0 commit comments