@@ -86,33 +86,6 @@ public function sharedGet($path)
86
86
return $ contents ;
87
87
}
88
88
89
- /**
90
- * Get the contents of a file, one line at a time.
91
- *
92
- * @param string $path
93
- * @return \Illuminate\Support\LazyCollection
94
- *
95
- * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
96
- */
97
- public function lines ($ path )
98
- {
99
- if (! $ this ->isFile ($ path )) {
100
- throw new FileNotFoundException (
101
- "File does not exist at path {$ path }. "
102
- );
103
- }
104
-
105
- return LazyCollection::make (function () use ($ path ) {
106
- $ file = new SplFileObject ($ path );
107
-
108
- $ file ->setFlags (SplFileObject::DROP_NEW_LINE );
109
-
110
- while (! $ file ->eof ()) {
111
- yield $ file ->fgets ();
112
- }
113
- });
114
- }
115
-
116
89
/**
117
90
* Get the returned value of a file.
118
91
*
@@ -161,6 +134,33 @@ public function requireOnce($path, array $data = [])
161
134
throw new FileNotFoundException ("File does not exist at path {$ path }. " );
162
135
}
163
136
137
+ /**
138
+ * Get the contents of a file one line at a time.
139
+ *
140
+ * @param string $path
141
+ * @return \Illuminate\Support\LazyCollection
142
+ *
143
+ * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
144
+ */
145
+ public function lines ($ path )
146
+ {
147
+ if (! $ this ->isFile ($ path )) {
148
+ throw new FileNotFoundException (
149
+ "File does not exist at path {$ path }. "
150
+ );
151
+ }
152
+
153
+ return LazyCollection::make (function () use ($ path ) {
154
+ $ file = new SplFileObject ($ path );
155
+
156
+ $ file ->setFlags (SplFileObject::DROP_NEW_LINE );
157
+
158
+ while (! $ file ->eof ()) {
159
+ yield $ file ->fgets ();
160
+ }
161
+ });
162
+ }
163
+
164
164
/**
165
165
* Get the MD5 hash of the file at the given path.
166
166
*
0 commit comments