Skip to content

Commit f470841

Browse files
committed
Remove deprecated methods
1 parent 308e22d commit f470841

File tree

2 files changed

+0
-219
lines changed

2 files changed

+0
-219
lines changed

src/Utility/Convert.php

Lines changed: 0 additions & 192 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@
44

55
use Lkrms\Concept\Utility;
66
use Lkrms\Contract\IDateFormatter;
7-
use Lkrms\Http\Uri;
87
use Lkrms\Support\Catalog\RegularExpression as Regex;
98
use Lkrms\Support\DateFormatter;
109
use DateInterval;
1110
use DateTimeImmutable;
1211
use DateTimeInterface;
13-
use DateTimeZone;
1412
use LogicException;
1513
use Stringable;
1614

@@ -95,17 +93,6 @@ public static function toInt($value): ?int
9593
return (int) $value;
9694
}
9795

98-
/**
99-
* @param mixed[] $array
100-
* @return array<int|float|string|bool|null>
101-
* @deprecated Use {@see Arr::toScalars()} instead
102-
* @codeCoverageIgnore
103-
*/
104-
public static function toScalarArray(array $array): array
105-
{
106-
return Arr::toScalars($array);
107-
}
108-
10996
/**
11097
* Expand tabs to spaces
11198
*/
@@ -183,47 +170,6 @@ public static function expandLeadingTabs(
183170
return $expanded;
184171
}
185172

186-
/**
187-
* @param string|int $key
188-
* @param mixed[] $array
189-
* @deprecated Use {@see Arr::toScalars()} instead
190-
* @codeCoverageIgnore
191-
*/
192-
public static function arrayKeyToOffset($key, array $array): int
193-
{
194-
return Arr::keyOffset($array, $key);
195-
}
196-
197-
/**
198-
* @template TKey of array-key
199-
* @template TValue
200-
*
201-
* @param array<TKey,TValue> $array
202-
* @param TKey $key
203-
* @param array<TKey,TValue> $replacement
204-
* @return array<TKey,TValue> The removed portion of the array.
205-
* @deprecated Use {@see Arr::spliceByKey()} instead
206-
* @codeCoverageIgnore
207-
*/
208-
public static function arraySpliceAtKey(array &$array, $key, ?int $length = null, array $replacement = []): array
209-
{
210-
$array = Arr::spliceByKey($array, $key, $length, $replacement, $replaced);
211-
return $replaced;
212-
}
213-
214-
/**
215-
* @param string|int $key
216-
* @param string|int $newKey
217-
* @param mixed[] $array
218-
* @return mixed[]
219-
* @deprecated Use {@see Arr::rename()} instead
220-
* @codeCoverageIgnore
221-
*/
222-
public static function renameArrayKey($key, $newKey, array $array): array
223-
{
224-
return Arr::rename($array, $key, $newKey);
225-
}
226-
227173
/**
228174
* Convert an interval to the equivalent number of seconds
229175
*
@@ -242,16 +188,6 @@ public static function intervalToSeconds($value): int
242188
return $now->getTimestamp() - $then->getTimestamp();
243189
}
244190

245-
/**
246-
* @param DateTimeZone|string $value
247-
* @deprecated Use {@see Date::timezone()} instead
248-
* @codeCoverageIgnore
249-
*/
250-
public static function toTimezone($value): DateTimeZone
251-
{
252-
return Date::timezone($value);
253-
}
254-
255191
/**
256192
* Get the first value that is not null
257193
*
@@ -269,19 +205,6 @@ public static function coalesce(...$values)
269205
return null;
270206
}
271207

272-
/**
273-
* @template TKey of array-key
274-
* @template TValue
275-
* @param iterable<TKey,TValue> $iterable
276-
* @return array<TKey,TValue>
277-
* @deprecated Use {@see Get::array()} instead
278-
* @codeCoverageIgnore
279-
*/
280-
public static function iterableToArray(iterable $iterable, bool $preserveKeys = false): array
281-
{
282-
return Get::array($iterable, $preserveKeys);
283-
}
284-
285208
/**
286209
* Remove the directory and up to the given number of extensions from a path
287210
*
@@ -301,75 +224,6 @@ public static function pathToBasename(string $path, int $extLimit = 0): string
301224
return $path;
302225
}
303226

304-
/**
305-
* @deprecated Use {@see File::resolve()} instead
306-
* @codeCoverageIgnore
307-
*/
308-
public static function resolvePath(string $path): string
309-
{
310-
return File::resolve($path);
311-
}
312-
313-
/**
314-
* @deprecated Use {@see Uri::resolveReference()} instead
315-
* @codeCoverageIgnore
316-
*/
317-
public static function resolveRelativeUrl(string $embeddedUrl, string $baseUrl): string
318-
{
319-
return Uri::resolveReference($embeddedUrl, $baseUrl);
320-
}
321-
322-
/**
323-
* @return array{scheme?:string,host?:string,port?:int,user?:string,pass?:string,path?:string,query?:string,fragment?:string}
324-
* @deprecated Use {@see Uri::parse()} instead
325-
* @codeCoverageIgnore
326-
*/
327-
public static function parseUrl(string $url): array
328-
{
329-
return Uri::parse($url);
330-
}
331-
332-
/**
333-
* @param array{scheme?:string,host?:string,port?:int,user?:string,pass?:string,path?:string,query?:string,fragment?:string} $url
334-
* @deprecated Use {@see Uri::unparse()} instead
335-
* @codeCoverageIgnore
336-
*/
337-
public static function unparseUrl(array $url): string
338-
{
339-
return Uri::unparse($url);
340-
}
341-
342-
/**
343-
* @deprecated Use {@see Get::basename()} instead
344-
* @codeCoverageIgnore
345-
*/
346-
public static function classToBasename(string $class, string ...$suffix): string
347-
{
348-
return Get::basename($class, ...$suffix);
349-
}
350-
351-
/**
352-
* @deprecated Use {@see Get::namespace()} instead
353-
* @codeCoverageIgnore
354-
*/
355-
public static function classToNamespace(string $class): string
356-
{
357-
return Get::namespace($class);
358-
}
359-
360-
/**
361-
* @template T of mixed[]|object
362-
* @param array<T> $list
363-
* @param int|string $key
364-
* @return array<T>
365-
* @deprecated Use {@see Arr::toMap()} instead
366-
* @codeCoverageIgnore
367-
*/
368-
public static function listToMap(array $list, $key): array
369-
{
370-
return Arr::toMap($list, $key);
371-
}
372-
373227
/**
374228
* Replace the end of a multi-byte string with an ellipsis ("...") if its
375229
* length exceeds a limit
@@ -762,52 +616,6 @@ public static function toCmdArg(string $arg): string
762616
return $arg;
763617
}
764618

765-
/**
766-
* @deprecated Use {@see Str::toSnakeCase()} instead
767-
* @codeCoverageIgnore
768-
*/
769-
public static function toSnakeCase(string $text, ?string $preserve = null): string
770-
{
771-
return Str::toSnakeCase($text, $preserve);
772-
}
773-
774-
/**
775-
* @deprecated Use {@see Str::toKebabCase()} instead
776-
* @codeCoverageIgnore
777-
*/
778-
public static function toKebabCase(string $text, ?string $preserve = null): string
779-
{
780-
return Str::toKebabCase($text, $preserve);
781-
}
782-
783-
/**
784-
* @deprecated Use {@see Str::toPascalCase()} instead
785-
* @codeCoverageIgnore
786-
*/
787-
public static function toPascalCase(string $text, ?string $preserve = null): string
788-
{
789-
return Str::toPascalCase($text, $preserve);
790-
}
791-
792-
/**
793-
* @deprecated Use {@see Str::toCamelCase()} instead
794-
* @codeCoverageIgnore
795-
*/
796-
public static function toCamelCase(string $text, ?string $preserve = null): string
797-
{
798-
return Str::toCamelCase($text, $preserve);
799-
}
800-
801-
/**
802-
* @param (callable(string): string)|null $callback
803-
* @deprecated Use {@see Str::toWords()} instead
804-
* @codeCoverageIgnore
805-
*/
806-
public static function splitWords(string $text, ?string $preserve, string $delimiter, ?callable $callback = null): string
807-
{
808-
return Str::toWords($text, $delimiter, $preserve, $callback);
809-
}
810-
811619
/**
812620
* Clean up a string for comparison with other strings
813621
*

src/Utility/Test.php

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -91,33 +91,6 @@ public static function isBetween($value, $min, $max): bool
9191
return $value >= $min && $value <= $max;
9292
}
9393

94-
/**
95-
* @deprecated Use {@see File::isPharUri()} instead
96-
* @codeCoverageIgnore
97-
*/
98-
public static function isPharUrl(string $path): bool
99-
{
100-
return File::isPharUri($path);
101-
}
102-
103-
/**
104-
* @deprecated Use {@see File::isAbsolute()} instead
105-
* @codeCoverageIgnore
106-
*/
107-
public static function isAbsolutePath(string $path): bool
108-
{
109-
return File::isAbsolute($path);
110-
}
111-
112-
/**
113-
* @deprecated Use {@see File::same()} instead
114-
* @codeCoverageIgnore
115-
*/
116-
public static function areSameFile(string $path1, string $path2): bool
117-
{
118-
return File::same($path1, $path2);
119-
}
120-
12194
/**
12295
* True if a directory exists and is writable, or doesn't exist but
12396
* can be created

0 commit comments

Comments
 (0)