-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for parameters and multiple jobs
- Loading branch information
1 parent
8fd338c
commit 3cae73c
Showing
2 changed files
with
53 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Blumilk\BLT\Helpers; | ||
|
||
class ArrayHelper | ||
{ | ||
public static function toArray(string|array $input, string $separator = " "): array | ||
{ | ||
if (is_array($input)) { | ||
return $input; | ||
} | ||
|
||
return explode($separator, $input); | ||
} | ||
|
||
public static function toString(string|array $input, $separator = " "): string | ||
{ | ||
if (is_string($input)) { | ||
return $input; | ||
} | ||
|
||
return implode($separator, $input); | ||
} | ||
} |