Skip to content

Commit 30f5d08

Browse files
The enabledTransactions method has been renamed to hasTransactions
1 parent 54ed586 commit 30f5d08

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

docs/how-to-use/running.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ return new class extends Operation
220220
// some code
221221
}
222222

223-
public function enabledTransactions(): bool
223+
public function hasTransactions(): bool
224224
{
225225
return true;
226226
}

docs/prologue/upgrade-guide/6.x.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
## Minor-Impact Changes
1313

1414
- [Changed directory location](#changed-directory-location)
15-
- [Removed database transaction properties](#removed-database-transaction-properties)
15+
- [Database transactions](#database-transactions)
1616
- [Removed `$async` property](#removed-async-property)
1717

1818
## Low-Impact Changes
@@ -142,14 +142,16 @@ class Names
142142

143143
File storage directory changed to `operations` from `actions`.
144144

145-
## Removed database transaction properties
145+
## Database transactions
146146

147147
The following properties have been removed:
148148

149149
- `$transactions`
150150
- `$transactionAttempts`
151151

152-
Instead, you can use the previously available `enabledTransactions` and `transactionAttempts` methods.
152+
Instead, you can use the `hasTransactions` and `transactionAttempts` methods.
153+
154+
The `enabledTransactions` method has been renamed to `hasTransactions`.
153155

154156
## Removed `$async` property
155157

src/Processors/Upgrade.php

+8
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ protected function move(string $from, string $to): void
4848

4949
$content = $this->replaceNamespace($content);
5050
$content = $this->replaceClassName($content);
51+
$content = $this->replaceMethod($content);
5152
$content = $this->replaceDeclareStrictType($content);
5253
$content = $this->replaceWithInvoke($content);
5354

@@ -94,6 +95,13 @@ protected function replaceClassName(string $content): string
9495
->toString();
9596
}
9697

98+
protected function replaceMethod(string $content): string
99+
{
100+
return Str::of($content)
101+
->replace('enabledTransactions', 'hasTransactions')
102+
->toString();
103+
}
104+
97105
protected function replaceDeclareStrictType(string $content): string
98106
{
99107
return Str::of($content)

0 commit comments

Comments
 (0)