This file contains hidden or 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
| public static function setNested(array &$array, string $delimitedKey, $value, $delimiter = '.') | |
| { | |
| $parts = explode($delimiter, $delimitedKey); | |
| $first = array_shift($parts); | |
| if (empty($parts)) { | |
| $array[$first] = $value; | |
| return; | |
| } | |
| $array = $array + [$first => []]; |
This file contains hidden or 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
| #!/usr/bin/php | |
| <?php | |
| function stop($message) | |
| { | |
| fputs(STDOUT, "{$message}\nUsage: jsonf file [newfile]\n"); | |
| exit(0); | |
| } | |
| if (!isset($argv[1])) { |
This file contains hidden or 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
| #!/usr/bin/php | |
| <?php | |
| function stop($message) | |
| { | |
| fputs(STDOUT, "{$message}\nUsage: git-ignore pattern\n"); | |
| exit(0); | |
| } | |
| function format(array $input) : array |
This file contains hidden or 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
| /** | |
| * Static utility class for working with the PHP array primitive type. | |
| */ | |
| abstract class Arrays | |
| { | |
| /** | |
| * Unsets and returns the value at index $key in the given array. | |
| * | |
| * Example: | |
| * <br /> |
This file contains hidden or 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
| final class Loop | |
| { | |
| /** | |
| * @var object | |
| */ | |
| private $counter; | |
| /** | |
| * @var bool | |
| */ |
This file contains hidden or 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
| <?php | |
| abstract class Minutes | |
| { | |
| const ONE_MINUTE = 1; | |
| const HOUR_IN_MINUTES = self::ONE_MINUTE * 60; | |
| const DAY_IN_MINUTES = self::HOUR_IN_MINUTES * 24; | |
| const WEEK_IN_MINUTES = self::DAY_IN_MINUTES * 7; | |
| const MONTH_IN_MINUTES = self::DAY_IN_MINUTES * 30; |
This file contains hidden or 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
| <?php | |
| abstract class Seconds | |
| { | |
| const ONE_SECOND = 1; | |
| const MINUTE_IN_SECONDS = self::ONE_SECOND * 60; | |
| const HOUR_IN_SECONDS = self::MINUTE_IN_SECONDS * 60; | |
| const DAY_IN_SECONDS = self::HOUR_IN_SECONDS * 24; | |
| const WEEK_IN_SECONDS = self::DAY_IN_SECONDS * 7; |
This file contains hidden or 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
| <?php | |
| namespace SubjectivePHP\Linq; | |
| use ArrayIterator; | |
| use CallbackFilterIterator; | |
| use Countable; | |
| use Exception; | |
| use Traversable; | |
| use IteratorAggregate; |
This file contains hidden or 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
| <?php | |
| use SplFileObject; | |
| final class HeaderStrategy | |
| { | |
| /** | |
| * @var callable | |
| */ | |
| private $getHeadersCallable; |
This file contains hidden or 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
| $input = [ | |
| [ | |
| 'id' => 1, | |
| 'code' => 'foo', | |
| 'extra' => 'abc', | |
| ], | |
| [ | |
| 'id' => 2, | |
| 'code' => 'bar', | |
| ], |
NewerOlder