@@ -22,14 +22,14 @@ abstract class Operation
2222 /**
2323 * Determines which environment to run on.
2424 *
25- * @deprecated Will be removed in 7.x version. Use `withinEnvironment ` method instead.
25+ * @deprecated Will be removed in 7.x version. Use `shouldEnvironment ` method instead.
2626 */
2727 protected array |string |null $ environment = null ;
2828
2929 /**
3030 * Determines in which environment it should not run.
3131 *
32- * @deprecated Will be removed in 7.x version. Use `exceptEnvironment ` method instead.
32+ * @deprecated Will be removed in 7.x version. Use `shouldEnvironment ` method instead.
3333 */
3434 protected array |string |null $ exceptEnvironment = null ;
3535
@@ -103,30 +103,30 @@ public function transactionAttempts(): int
103103 /**
104104 * Determines which environment to run on.
105105 *
106- * @deprecated Will be removed in 7.x version. Use `withinEnvironment ` method instead.
106+ * @deprecated Will be removed in 7.x version. Use `shouldEnvironment ` method instead.
107107 */
108108 public function onEnvironment (): array
109109 {
110110 return Arr::wrap ($ this ->environment );
111111 }
112112
113- public function withinEnvironment (): bool
114- {
115- $ env = $ this ->onEnvironment ();
116-
117- return empty ($ env ) || in_array (app ()->environment (), $ env , true );
118- }
119-
120113 /**
121114 * Determines in which environment it should not run.
122115 *
123- * @deprecated Since with version 7.0 will return `bool` .
116+ * @deprecated Will be removed in 7.x version. Use `shouldEnvironment` method instead .
124117 */
125118 public function exceptEnvironment (): array
126119 {
127120 return Arr::wrap ($ this ->exceptEnvironment );
128121 }
129122
123+ public function shouldBeEnvironment (): bool
124+ {
125+ $ env = $ this ->onEnvironment ();
126+
127+ return empty ($ env ) || in_array (app ()->environment (), $ env , true );
128+ }
129+
130130 /**
131131 * Determines whether the given operation can be called conditionally.
132132 *
0 commit comments