We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 049afc4 commit de94532Copy full SHA for de94532
05 - Refactoring/15 - Move Static Member.php
@@ -0,0 +1,25 @@
1
+<?php
2
+/**
3
+ * Move Static Member
4
+ *
5
+ * Move static fields and methods to another type.
6
7
+ * F6 (Windows/Linux/Mac OS X)
8
+ */
9
+
10
+namespace Refactoring15\JetBrains;
11
12
+// 1. Move the static method "split" from the class Utils to a more specialized StringUtils.
13
+class Utils {
14
+ public static function split($subject, $delimiter)
15
+ {
16
+ return explode($delimiter, $subject);
17
+ }
18
+}
19
20
+class StringUtils {
21
22
23
+// 2. Note that calls to Utils::split() have updated to StringUtils::split()
24
+$myArray = Utils::split('This is a test', ' ');
25
+$myCsvRecord = Utils::split('Maarten;JetBrains', ';');
0 commit comments