Skip to content

Commit a50c7b2

Browse files
tiagofgithub-actions[bot]
authored andcommitted
Fix styling
1 parent c9509ae commit a50c7b2

File tree

5 files changed

+18
-18
lines changed

5 files changed

+18
-18
lines changed

src/Traits/HasWorkflows.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ public function isInFinalStatus(): bool
226226
protected function createModelStatus(Workflow $workflow, WorkflowStatus $status): WorkflowModelStatus
227227
{
228228
$wmsClass = config('workflow.workflow_model_status_class');
229-
$modelStatus = new $wmsClass();
229+
$modelStatus = new $wmsClass;
230230
$modelStatus->model()->associate($this);
231231
$modelStatus->user()->associate(Auth::user());
232232
$modelStatus->workflow()->associate($workflow);

tests/Feature/MultipleWorkflowTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
});
3131

3232
test('it supports multiple models', function () {
33-
($modelA = new WorkflowableModel())->setDefaultWorkflowName($this->workflowA->name)->save();
34-
($modelB = new WorkflowableModel())->setDefaultWorkflowName($this->workflowB->name)->save();
33+
($modelA = new WorkflowableModel)->setDefaultWorkflowName($this->workflowA->name)->save();
34+
($modelB = new WorkflowableModel)->setDefaultWorkflowName($this->workflowB->name)->save();
3535

3636
expect($modelA->modelStatus->workflow)->id->toBe($this->workflowA->id);
3737
expect($modelB->modelStatus->workflow)->id->toEqual($this->workflowB->id);
@@ -57,7 +57,7 @@
5757
});
5858

5959
test('a model can have multiple workflows', function () {
60-
($modelA = new WorkflowableModel())->setDefaultWorkflowName($this->workflowA->name)->save();
60+
($modelA = new WorkflowableModel)->setDefaultWorkflowName($this->workflowA->name)->save();
6161
$modelA->transition($this->entryA_to_A1);
6262

6363
expect($modelA->usingWorkflow($this->workflowB)->getCurrentWorkflow())

tests/Feature/WorkflowTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,20 @@
3333
});
3434

3535
test('it creates the first status for a newly created model', function () {
36-
(new WorkflowableModel())->save();
36+
(new WorkflowableModel)->save();
3737
expect(WorkflowModelStatus::count())->toBe(0);
3838

39-
($model = new WorkflowableModel())->setDefaultWorkflowName($this->workflow->name)->save();
39+
($model = new WorkflowableModel)->setDefaultWorkflowName($this->workflow->name)->save();
4040
expect(WorkflowModelStatus::first())
4141
->count()->toBe(1)
4242
->model->id->toBe($model->id);
4343
});
4444

4545
test('it gets the status(es) of a model', function () {
46-
($modelA = new WorkflowableModel())->save();
46+
($modelA = new WorkflowableModel)->save();
4747
expect($modelA->modelStatuses)->toHaveCount(0);
4848

49-
($modelB = new WorkflowableModel())->setDefaultWorkflowName($this->workflow->name)->save();
49+
($modelB = new WorkflowableModel)->setDefaultWorkflowName($this->workflow->name)->save();
5050
$status = $modelB->getDefaultWorkflow()->entryTransitions->first()->toStatus;
5151

5252
expect($modelB->modelStatus->status)->toEqual($modelB->getStatus())->toEqual($status)
@@ -55,7 +55,7 @@
5555
});
5656

5757
test('it can transition a model', function () {
58-
($model = new WorkflowableModel())->setDefaultWorkflowName($this->workflow->name)->save();
58+
($model = new WorkflowableModel)->setDefaultWorkflowName($this->workflow->name)->save();
5959
$transitions = $model->possibleTransitions();
6060

6161
expect($transitions)->toHaveCount(1);
@@ -67,22 +67,22 @@
6767
});
6868

6969
test('it fails transition if not valid', function () {
70-
($model = new WorkflowableModel())->setDefaultWorkflowName($this->workflow->name)->save();
70+
($model = new WorkflowableModel)->setDefaultWorkflowName($this->workflow->name)->save();
7171
$transitions = $model->possibleTransitions();
7272

7373
expect(fn () => $model->transitionTo($transitions->first()->fromStatus))
7474
->toThrow(InvalidTransitionException::class);
7575
});
7676

7777
test('it can filter model with specific status', function () {
78-
(new WorkflowableModel())->setDefaultWorkflowName($this->workflow->name)->save();
78+
(new WorkflowableModel)->setDefaultWorkflowName($this->workflow->name)->save();
7979

8080
expect(WorkflowableModel::inStatus($this->entry->toStatus, $this->workflow)->get())->toHaveCount(1)
8181
->and(WorkflowableModel::inStatus($this->mid1->toStatus->id, $this->workflow)->get())->toHaveCount(0);
8282
});
8383

8484
test('it checks if a transition is allowed', function () {
85-
($model = new WorkflowableModel())->setDefaultWorkflowName($this->workflow->name)->save();
85+
($model = new WorkflowableModel)->setDefaultWorkflowName($this->workflow->name)->save();
8686

8787
expect($model->isAllowed($this->mid1))->toBeTrue()
8888
->and($model->isAllowed($this->entry->toStatus))->toBeFalse();
@@ -93,7 +93,7 @@
9393
});
9494

9595
test('it has toString', function () {
96-
($model = new WorkflowableModel())->setDefaultWorkflowName($this->workflow->name)->save();
96+
($model = new WorkflowableModel)->setDefaultWorkflowName($this->workflow->name)->save();
9797

9898
expect($model->getCurrentWorkflow()?->__toString())->toBe($model->getCurrentWorkflow()->name);
9999
expect($model->possibleTransitions()->first()->__toString())->toContain($model->getCurrentWorkflow()?->__toString());

tests/Feature/WorkflowsPermissionsTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
});
2424

2525
test('it can transition if no permissions are defined', function () {
26-
($model = new WorkflowableModel())->setDefaultWorkflowName($this->workflow->name)->save();
26+
($model = new WorkflowableModel)->setDefaultWorkflowName($this->workflow->name)->save();
2727
/** @var \Squarebit\Workflows\Models\WorkflowTransition $transition */
2828
$transition = $model->possibleTransitions()->first();
2929

@@ -32,7 +32,7 @@
3232
});
3333

3434
test('it cannot transition if user is missing necessary permissions', function () {
35-
($model = new WorkflowableModel())->setDefaultWorkflowName($this->workflow->name)->save();
35+
($model = new WorkflowableModel)->setDefaultWorkflowName($this->workflow->name)->save();
3636
/** @var \Squarebit\Workflows\Models\WorkflowTransition $transition */
3737
$transition = $model->possibleTransitions()->first();
3838

@@ -42,7 +42,7 @@
4242
});
4343

4444
test('it can transition when user has necessary permission', function () {
45-
($model = new WorkflowableModel())->setDefaultWorkflowName($this->workflow->name)->save();
45+
($model = new WorkflowableModel)->setDefaultWorkflowName($this->workflow->name)->save();
4646
/** @var \Squarebit\Workflows\Models\WorkflowTransition $transition */
4747
$transition = $model->possibleTransitions()->first();
4848

tests/Support/2000_01_01_000000_create_permission_tables.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

3-
use Illuminate\Support\Facades\Schema;
4-
use Illuminate\Database\Schema\Blueprint;
53
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
66
use Spatie\Permission\PermissionRegistrar;
77

88
class CreatePermissionTables extends Migration

0 commit comments

Comments
 (0)