@@ -14,9 +14,9 @@ |
||
| 14 | 14 | use Modules\Authorization\Entities\Permission; |
| 15 | 15 | use \Modules\Machine\Permissions\MachinePermissions; |
| 16 | 16 | |
| 17 | -Route::get('/{id}', 'MachineController@show')->middleware(['permission:'.MachinePermissions::SHOW_MACHINE]); |
|
| 18 | -Route::patch('/{id}', 'MachineController@update')->middleware(['permission:'.MachinePermissions::UPDATE_MACHINE]); |
|
| 19 | -Route::delete('/{id}', 'MachineController@destroy')->middleware(['permission:'.MachinePermissions::DELETE_MACHINE]); |
|
| 17 | +Route::get('/{id}', 'MachineController@show')->middleware([ 'permission:'.MachinePermissions::SHOW_MACHINE ]); |
|
| 18 | +Route::patch('/{id}', 'MachineController@update')->middleware([ 'permission:'.MachinePermissions::UPDATE_MACHINE ]); |
|
| 19 | +Route::delete('/{id}', 'MachineController@destroy')->middleware([ 'permission:'.MachinePermissions::DELETE_MACHINE ]); |
|
| 20 | 20 | |
| 21 | -Route::post('/', 'MachineController@store')->middleware(['permission:'.MachinePermissions::CREATE_MACHINE]); |
|
| 22 | -Route::get('/', 'MachineController@index')->middleware(['permission:'.MachinePermissions::SHOW_MACHINE]); |
|
| 21 | +Route::post('/', 'MachineController@store')->middleware([ 'permission:'.MachinePermissions::CREATE_MACHINE ]); |
|
| 22 | +Route::get('/', 'MachineController@index')->middleware([ 'permission:'.MachinePermissions::SHOW_MACHINE ]); |
|
@@ -13,9 +13,9 @@ |
||
| 13 | 13 | |
| 14 | 14 | use \Modules\Proxy\Permissions\ProxyPermissions; |
| 15 | 15 | |
| 16 | -Route::get('/{id}', 'ProxyController@show')->middleware(['permission:'.ProxyPermissions::SHOW_PROXY]); |
|
| 17 | -Route::patch('/{id}', 'ProxyController@update')->middleware(['permission:'.ProxyPermissions::UPDATE_PROXY]); |
|
| 18 | -Route::delete('/{id}', 'ProxyController@destroy')->middleware(['permission:'.ProxyPermissions::DELETE_PROXY]); |
|
| 16 | +Route::get('/{id}', 'ProxyController@show')->middleware([ 'permission:'.ProxyPermissions::SHOW_PROXY ]); |
|
| 17 | +Route::patch('/{id}', 'ProxyController@update')->middleware([ 'permission:'.ProxyPermissions::UPDATE_PROXY ]); |
|
| 18 | +Route::delete('/{id}', 'ProxyController@destroy')->middleware([ 'permission:'.ProxyPermissions::DELETE_PROXY ]); |
|
| 19 | 19 | |
| 20 | -Route::post('/', 'ProxyController@store')->middleware(['permission:'.ProxyPermissions::CREATE_PROXY]); |
|
| 21 | -Route::get('/', 'ProxyController@index')->middleware(['permission:'.ProxyPermissions::INDEX_PROXY]); |
|
| 20 | +Route::post('/', 'ProxyController@store')->middleware([ 'permission:'.ProxyPermissions::CREATE_PROXY ]); |
|
| 21 | +Route::get('/', 'ProxyController@index')->middleware([ 'permission:'.ProxyPermissions::INDEX_PROXY ]); |
|
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | $role = static::singleton()->role; |
| 26 | 26 | |
| 27 | 27 | if (!isset($role)) { |
| 28 | - throw new Exception('Role name not set for ' . get_short_class_name(static::class)); |
|
| 28 | + throw new Exception('Role name not set for '.get_short_class_name(static::class)); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | return $role; |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | if (!isset($permissions)) { |
| 43 | - throw new Exception('Permissions not set for role ' . get_short_class_name(static::class)); |
|
| 43 | + throw new Exception('Permissions not set for role '.get_short_class_name(static::class)); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | return $permissions; |
@@ -14,12 +14,12 @@ |
||
| 14 | 14 | { |
| 15 | 15 | public static function getAllPermissions(): array |
| 16 | 16 | { |
| 17 | - return once(function () { |
|
| 18 | - $permissionClasses = []; |
|
| 17 | + return once(function() { |
|
| 18 | + $permissionClasses = [ ]; |
|
| 19 | 19 | foreach (Larapi::getModules() as $module) { |
| 20 | 20 | $permissionClasses = array_merge($permissionClasses, $module->getPermissions()->getClasses()); |
| 21 | 21 | } |
| 22 | - $permissions = []; |
|
| 22 | + $permissions = [ ]; |
|
| 23 | 23 | foreach ($permissionClasses as $permissionClass) { |
| 24 | 24 | $permissions = array_merge($permissions, get_class_constants($permissionClass)); |
| 25 | 25 | } |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | { |
| 16 | 16 | protected $role = Role::SCRIPTER; |
| 17 | 17 | |
| 18 | - protected function permissions(){ |
|
| 18 | + protected function permissions() { |
|
| 19 | 19 | return MemberRole::getPermissions(); |
| 20 | 20 | } |
| 21 | 21 | } |
@@ -15,5 +15,5 @@ |
||
| 15 | 15 | { |
| 16 | 16 | protected $role = Role::GUEST; |
| 17 | 17 | |
| 18 | - protected $permissions = []; |
|
| 18 | + protected $permissions = [ ]; |
|
| 19 | 19 | } |
@@ -65,8 +65,8 @@ discard block |
||
| 65 | 65 | protected function setOptions(): array |
| 66 | 66 | { |
| 67 | 67 | return [ |
| 68 | - ['mongo', null, InputOption::VALUE_OPTIONAL, 'Mongo model.', false], |
|
| 69 | - ['migration', null, InputOption::VALUE_OPTIONAL, 'Create migration for the model.', true], |
|
| 68 | + [ 'mongo', null, InputOption::VALUE_OPTIONAL, 'Mongo model.', false ], |
|
| 69 | + [ 'migration', null, InputOption::VALUE_OPTIONAL, 'Create migration for the model.', true ], |
|
| 70 | 70 | ]; |
| 71 | 71 | } |
| 72 | 72 | |
@@ -96,19 +96,19 @@ discard block |
||
| 96 | 96 | if ($this->isMongoModel()) { |
| 97 | 97 | GeneratorManager::module($this->getModuleName(), $this->isOverwriteable()) |
| 98 | 98 | ->createMigration( |
| 99 | - "Create" . ucfirst($this->getClassName()) . "Collection", |
|
| 99 | + "Create".ucfirst($this->getClassName())."Collection", |
|
| 100 | 100 | strtolower(split_caps_to_underscore(Str::plural($this->getClassName()))), |
| 101 | 101 | true); |
| 102 | 102 | } else { |
| 103 | 103 | GeneratorManager::module($this->getModuleName(), $this->isOverwriteable()) |
| 104 | 104 | ->createMigration( |
| 105 | - "Create" . ucfirst($this->getClassName() . "Table"), |
|
| 105 | + "Create".ucfirst($this->getClassName()."Table"), |
|
| 106 | 106 | strtolower(split_caps_to_underscore(Str::plural($this->getClassName()))), |
| 107 | 107 | false); |
| 108 | 108 | } |
| 109 | 109 | } |
| 110 | 110 | GeneratorManager::module($this->getModuleName(), $this->isOverwriteable()) |
| 111 | - ->createAttribute($this->getClassName() . "Attributes"); |
|
| 111 | + ->createAttribute($this->getClassName()."Attributes"); |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | /** |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | $this->assertEquals($stub, $event->getStub()->getName()); |
| 75 | 75 | $this->assertEquals($class, $event->getClassName()); |
| 76 | 76 | $this->assertEquals($table, $event->getTableName()); |
| 77 | - $this->assertEquals($mongo,$event->isMongoMigration()); |
|
| 77 | + $this->assertEquals($mongo, $event->isMongoMigration()); |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | public function testCreateMongoMigration() |
@@ -95,19 +95,19 @@ discard block |
||
| 95 | 95 | $this->assertEquals($stub, $event->getStub()->getName()); |
| 96 | 96 | $this->assertEquals($class, $event->getClassName()); |
| 97 | 97 | $this->assertEquals($table, $event->getTableName()); |
| 98 | - $this->assertEquals($mongo,$event->isMongoMigration()); |
|
| 98 | + $this->assertEquals($mongo, $event->isMongoMigration()); |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | public function testCreateFactory() |
| 102 | 102 | { |
| 103 | 103 | $module = "User"; |
| 104 | 104 | $model = $module; |
| 105 | - $class = $model . "Factory"; |
|
| 105 | + $class = $model."Factory"; |
|
| 106 | 106 | $this->getModuleGenerator($module)->createFactory($module); |
| 107 | 107 | |
| 108 | - $path = Larapi::getModule($module)->getFactories()->getPath() . "/$class.php"; |
|
| 108 | + $path = Larapi::getModule($module)->getFactories()->getPath()."/$class.php"; |
|
| 109 | 109 | $stub = "factory.stub"; |
| 110 | - $modelNamespace = "Modules\User\Entities\User"; |
|
| 110 | + $modelNamespace = "Modules\User\Entities\User"; |
|
| 111 | 111 | |
| 112 | 112 | /* @var FactoryGeneratedEvent $event */ |
| 113 | 113 | $event = $this->getFirstDispatchedEvent(FactoryGeneratedEvent::class); |
@@ -116,9 +116,9 @@ discard block |
||
| 116 | 116 | $module, |
| 117 | 117 | $stub, |
| 118 | 118 | $path); |
| 119 | - $this->assertEquals($class,$event->getClassName()); |
|
| 120 | - $this->assertEquals($model,$event->getModel()); |
|
| 121 | - $this->assertEquals($modelNamespace,$event->getModelNamespace()); |
|
| 119 | + $this->assertEquals($class, $event->getClassName()); |
|
| 120 | + $this->assertEquals($model, $event->getModel()); |
|
| 121 | + $this->assertEquals($modelNamespace, $event->getModelNamespace()); |
|
| 122 | 122 | |
| 123 | 123 | } |
| 124 | 124 | |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | $class = "UserController"; |
| 129 | 129 | $this->getModuleGenerator($module)->createController($class); |
| 130 | 130 | |
| 131 | - $path = Larapi::getModule($module)->getControllers()->getPath() . "/$class.php"; |
|
| 131 | + $path = Larapi::getModule($module)->getControllers()->getPath()."/$class.php"; |
|
| 132 | 132 | $stub = "controller.stub"; |
| 133 | 133 | $namespace = "Modules\User\Http\Controllers"; |
| 134 | 134 | |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | $class = "UserAttribute"; |
| 150 | 150 | $this->getModuleGenerator($module)->createAttribute($class); |
| 151 | 151 | |
| 152 | - $path = Larapi::getModule($module)->getAttributes()->getPath() . "/$class.php"; |
|
| 152 | + $path = Larapi::getModule($module)->getAttributes()->getPath()."/$class.php"; |
|
| 153 | 153 | $stub = "attribute.stub"; |
| 154 | 154 | $namespace = "Modules\User\Attributes"; |
| 155 | 155 | |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | $queued = false; |
| 173 | 173 | $this->getModuleGenerator($module)->createListener($class, $eventClass, $queued); |
| 174 | 174 | |
| 175 | - $path = Larapi::getModule($module)->getListeners()->getPath() . '/SendWelcomeMail.php'; |
|
| 175 | + $path = Larapi::getModule($module)->getListeners()->getPath().'/SendWelcomeMail.php'; |
|
| 176 | 176 | $stub = "listener.stub"; |
| 177 | 177 | $namespace = "Modules\User\Listeners"; |
| 178 | 178 | $eventNamespace = "Modules\User\Events\UserRegisteredEvent"; |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | $queued = true; |
| 200 | 200 | $this->getModuleGenerator($module)->createListener($class, $eventClass, $queued); |
| 201 | 201 | |
| 202 | - $path = Larapi::getModule($module)->getListeners()->getPath() . '/SendWelcomeMail.php'; |
|
| 202 | + $path = Larapi::getModule($module)->getListeners()->getPath().'/SendWelcomeMail.php'; |
|
| 203 | 203 | $stub = "listener-queued.stub"; |
| 204 | 204 | $namespace = "Modules\User\Listeners"; |
| 205 | 205 | $eventNamespace = "Modules\User\Events\UserRegisteredEvent"; |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | |
| 227 | 227 | $this->getModuleGenerator($module)->createJob($class, $synchronous); |
| 228 | 228 | |
| 229 | - $path = Larapi::getModule($module)->getJobs()->getPath() . "/$class.php"; |
|
| 229 | + $path = Larapi::getModule($module)->getJobs()->getPath()."/$class.php"; |
|
| 230 | 230 | $stub = "job-queued.stub"; |
| 231 | 231 | $namespace = "Modules\User\Jobs"; |
| 232 | 232 | |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | |
| 251 | 251 | $this->getModuleGenerator($module)->createJob($class, $synchronous); |
| 252 | 252 | |
| 253 | - $path = Larapi::getModule($module)->getJobs()->getPath() . "/$class.php"; |
|
| 253 | + $path = Larapi::getModule($module)->getJobs()->getPath()."/$class.php"; |
|
| 254 | 254 | $stub = "job.stub"; |
| 255 | 255 | $namespace = "Modules\User\Jobs"; |
| 256 | 256 | |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | |
| 275 | 275 | $this->getModuleGenerator($module)->createCommand($class, $consoleCommand); |
| 276 | 276 | |
| 277 | - $path = Larapi::getModule($module)->getCommands()->getPath() . "/$class.php"; |
|
| 277 | + $path = Larapi::getModule($module)->getCommands()->getPath()."/$class.php"; |
|
| 278 | 278 | $stub = "command.stub"; |
| 279 | 279 | $namespace = "Modules\User\Console"; |
| 280 | 280 | |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | |
| 299 | 299 | $this->getModuleGenerator($module)->createMiddleware($class); |
| 300 | 300 | |
| 301 | - $path = Larapi::getModule($module)->getMiddleWare()->getPath() . "/$class.php"; |
|
| 301 | + $path = Larapi::getModule($module)->getMiddleWare()->getPath()."/$class.php"; |
|
| 302 | 302 | $stub = "middleware.stub"; |
| 303 | 303 | $namespace = "Modules\User\Http\Middleware"; |
| 304 | 304 | |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | |
| 321 | 321 | $this->getModuleGenerator($module)->createServiceProvider($class); |
| 322 | 322 | |
| 323 | - $path = Larapi::getModule($module)->getServiceProviders()->getPath() . "/$class.php"; |
|
| 323 | + $path = Larapi::getModule($module)->getServiceProviders()->getPath()."/$class.php"; |
|
| 324 | 324 | $stub = "provider.stub"; |
| 325 | 325 | $namespace = "Modules\User\Providers"; |
| 326 | 326 | |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | |
| 343 | 343 | $this->getModuleGenerator($module)->createService($class); |
| 344 | 344 | |
| 345 | - $path = Larapi::getModule($module)->getServices()->getPath() . "/$class.php"; |
|
| 345 | + $path = Larapi::getModule($module)->getServices()->getPath()."/$class.php"; |
|
| 346 | 346 | $stub = "service.stub"; |
| 347 | 347 | $namespace = "Modules\User\Services"; |
| 348 | 348 | |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | |
| 365 | 365 | $this->getModuleGenerator($module)->createNotification($class); |
| 366 | 366 | |
| 367 | - $path = Larapi::getModule($module)->getNotifications()->getPath() . "/$class.php"; |
|
| 367 | + $path = Larapi::getModule($module)->getNotifications()->getPath()."/$class.php"; |
|
| 368 | 368 | $stub = "notification.stub"; |
| 369 | 369 | $namespace = "Modules\User\Notifications"; |
| 370 | 370 | |
@@ -383,13 +383,13 @@ discard block |
||
| 383 | 383 | { |
| 384 | 384 | $module = "User"; |
| 385 | 385 | $modelName = "Address"; |
| 386 | - $class = $module . $modelName; |
|
| 386 | + $class = $module.$modelName; |
|
| 387 | 387 | $needsMigration = true; |
| 388 | 388 | $isMongoModel = false; |
| 389 | 389 | |
| 390 | 390 | $this->getModuleGenerator($module)->createModel($class, $isMongoModel, $needsMigration); |
| 391 | 391 | |
| 392 | - $path = Larapi::getModule($module)->getModels()->getPath() . "/$module$modelName.php"; |
|
| 392 | + $path = Larapi::getModule($module)->getModels()->getPath()."/$module$modelName.php"; |
|
| 393 | 393 | $stub = "model.stub"; |
| 394 | 394 | $namespace = "Modules\User\Entities"; |
| 395 | 395 | |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | |
| 424 | 424 | $this->getModuleGenerator($module)->createPolicy($class); |
| 425 | 425 | |
| 426 | - $path = Larapi::getModule($module)->getPolicies()->getPath() . "/$class.php"; |
|
| 426 | + $path = Larapi::getModule($module)->getPolicies()->getPath()."/$class.php"; |
|
| 427 | 427 | $stub = "policy.stub"; |
| 428 | 428 | $namespace = "Modules\User\Policies"; |
| 429 | 429 | |
@@ -446,7 +446,7 @@ discard block |
||
| 446 | 446 | |
| 447 | 447 | $this->getModuleGenerator($module)->createTransformer($class, $model); |
| 448 | 448 | |
| 449 | - $path = Larapi::getModule($module)->getTransformers()->getPath() . "/$class.php"; |
|
| 449 | + $path = Larapi::getModule($module)->getTransformers()->getPath()."/$class.php"; |
|
| 450 | 450 | $stub = "transformer.stub"; |
| 451 | 451 | $namespace = "Modules\User\Transformers"; |
| 452 | 452 | $modelNamespace = "Modules\User\Entities\User"; |
@@ -471,7 +471,7 @@ discard block |
||
| 471 | 471 | |
| 472 | 472 | $this->getModuleGenerator($module)->createTest($class, 'unit'); |
| 473 | 473 | |
| 474 | - $path = Larapi::getModule($module)->getTests()->getPath() . "/$class.php"; |
|
| 474 | + $path = Larapi::getModule($module)->getTests()->getPath()."/$class.php"; |
|
| 475 | 475 | $stub = "unit-test.stub"; |
| 476 | 476 | $namespace = "Modules\User\Tests"; |
| 477 | 477 | $type = "unit"; |
@@ -495,7 +495,7 @@ discard block |
||
| 495 | 495 | |
| 496 | 496 | $this->getModuleGenerator($module)->createRequest($class); |
| 497 | 497 | |
| 498 | - $path = Larapi::getModule($module)->getRequests()->getPath() . "/$class.php"; |
|
| 498 | + $path = Larapi::getModule($module)->getRequests()->getPath()."/$class.php"; |
|
| 499 | 499 | $stub = "request.stub"; |
| 500 | 500 | $namespace = "Modules\User\Http\Requests"; |
| 501 | 501 | |
@@ -517,7 +517,7 @@ discard block |
||
| 517 | 517 | |
| 518 | 518 | $this->getModuleGenerator($module)->createRule($fileName); |
| 519 | 519 | |
| 520 | - $path = Larapi::getModule($module)->getRules()->getPath() . "/$fileName.php"; |
|
| 520 | + $path = Larapi::getModule($module)->getRules()->getPath()."/$fileName.php"; |
|
| 521 | 521 | $stub = "rule.stub"; |
| 522 | 522 | $class = "BlalkaRule"; |
| 523 | 523 | $namespace = "Modules\User\Rules"; |
@@ -540,7 +540,7 @@ discard block |
||
| 540 | 540 | |
| 541 | 541 | $this->getModuleGenerator($module)->createSeeder($class); |
| 542 | 542 | |
| 543 | - $path = Larapi::getModule($module)->getSeeders()->getPath() . "/$class.php"; |
|
| 543 | + $path = Larapi::getModule($module)->getSeeders()->getPath()."/$class.php"; |
|
| 544 | 544 | $stub = "seeder.stub"; |
| 545 | 545 | $namespace = "Modules\User\Database\Seeders"; |
| 546 | 546 | |
@@ -562,7 +562,7 @@ discard block |
||
| 562 | 562 | |
| 563 | 563 | $this->getModuleGenerator($module)->createPermission($class); |
| 564 | 564 | |
| 565 | - $path = Larapi::getModule($module)->getPermissions()->getPath() . "/$class.php"; |
|
| 565 | + $path = Larapi::getModule($module)->getPermissions()->getPath()."/$class.php"; |
|
| 566 | 566 | $stub = "permission.stub"; |
| 567 | 567 | $namespace = "Modules\User\Permissions"; |
| 568 | 568 | |
@@ -580,11 +580,11 @@ discard block |
||
| 580 | 580 | public function testCreateRoute() |
| 581 | 581 | { |
| 582 | 582 | $moduleName = "Demo"; |
| 583 | - $routename = strtolower(Str::plural($moduleName)) . '.v1'; |
|
| 583 | + $routename = strtolower(Str::plural($moduleName)).'.v1'; |
|
| 584 | 584 | |
| 585 | 585 | $this->getModuleGenerator($moduleName)->createRoute(); |
| 586 | 586 | |
| 587 | - $expectedFileName = Larapi::getModule($moduleName)->getRoutes()->getPath() . "/$routename.php"; |
|
| 587 | + $expectedFileName = Larapi::getModule($moduleName)->getRoutes()->getPath()."/$routename.php"; |
|
| 588 | 588 | $expectedStubName = "route.stub"; |
| 589 | 589 | $expectedVersion = "v1"; |
| 590 | 590 | |
@@ -603,7 +603,7 @@ discard block |
||
| 603 | 603 | |
| 604 | 604 | $this->getModuleGenerator($moduleName)->createComposer(); |
| 605 | 605 | |
| 606 | - $expectedFileName = Larapi::getModule($moduleName)->getPath() . "/composer.json"; |
|
| 606 | + $expectedFileName = Larapi::getModule($moduleName)->getPath()."/composer.json"; |
|
| 607 | 607 | $expectedStubName = "composer.stub"; |
| 608 | 608 | $authorName = 'arthur devious'; |
| 609 | 609 | $authorMail = '[email protected]'; |
@@ -67,14 +67,14 @@ discard block |
||
| 67 | 67 | public function setVersion($version) |
| 68 | 68 | { |
| 69 | 69 | $semverRegex = '/^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Z-.]+))?(?:\+([0-9A-Z-.]+)?)?$/i'; |
| 70 | - if (! preg_match($semverRegex, $version, $matches)) { |
|
| 70 | + if (!preg_match($semverRegex, $version, $matches)) { |
|
| 71 | 71 | throw new \Exception('Invalid Semantic Version string provided'); |
| 72 | 72 | } |
| 73 | - $this->major = (int) $matches[1]; |
|
| 74 | - $this->minor = (int) $matches[2]; |
|
| 75 | - $this->patch = (int) $matches[3]; |
|
| 76 | - $this->preRelease = @$matches[4] ?: null; |
|
| 77 | - $this->build = @$matches[5] ?: null; |
|
| 73 | + $this->major = (int) $matches[ 1 ]; |
|
| 74 | + $this->minor = (int) $matches[ 2 ]; |
|
| 75 | + $this->patch = (int) $matches[ 3 ]; |
|
| 76 | + $this->preRelease = @$matches[ 4 ] ?: null; |
|
| 77 | + $this->build = @$matches[ 5 ] ?: null; |
|
| 78 | 78 | return $this; |
| 79 | 79 | } |
| 80 | 80 | /** |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | */ |
| 286 | 286 | public function prefix($prefix = 'v') |
| 287 | 287 | { |
| 288 | - return $prefix . $this->toString(); |
|
| 288 | + return $prefix.$this->toString(); |
|
| 289 | 289 | } |
| 290 | 290 | /** |
| 291 | 291 | * Get the current version value as a string. |
@@ -294,9 +294,9 @@ discard block |
||
| 294 | 294 | */ |
| 295 | 295 | private function toString() |
| 296 | 296 | { |
| 297 | - $version = implode('.', [$this->major, $this->minor, $this->patch]); |
|
| 298 | - $version .= isset($this->preRelease) ? '-' . $this->preRelease : null; |
|
| 299 | - $version .= isset($this->build) ? '+' . $this->build : null; |
|
| 297 | + $version = implode('.', [ $this->major, $this->minor, $this->patch ]); |
|
| 298 | + $version .= isset($this->preRelease) ? '-'.$this->preRelease : null; |
|
| 299 | + $version .= isset($this->build) ? '+'.$this->build : null; |
|
| 300 | 300 | return $version; |
| 301 | 301 | } |
| 302 | 302 | } |