Skip to content

Commit

Permalink
Merge pull request #267 from Laravel-Lang/14.x
Browse files Browse the repository at this point in the history
Store numeric keys as string
  • Loading branch information
Andrey Helldar authored Jun 30, 2022
2 parents 70f9699 + 92c820f commit ef02958
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
11 changes: 9 additions & 2 deletions src/Services/Filesystem/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
* file that was distributed with this source code.
*
* @author Andrey Helldar <[email protected]>
*
* @copyright 2022 Andrey Helldar
*
* @license MIT
*
* @see https://github.com/Laravel-Lang/publisher
Expand All @@ -30,10 +32,15 @@ abstract class Base implements Filesystem
use Has;

public function __construct(
protected Pretty $pretty = new Pretty(),
protected Pretty $pretty = new Pretty(),
protected Formatter $formatter = new Formatter(),
protected Config $config = new Config()
protected Config $config = new Config()
) {
$this->formatter->setKeyAsString();

if ($this->config->hasAlign()) {
$this->formatter->setEqualsAlign();
}
}

public function load(string $path): array
Expand Down
6 changes: 2 additions & 4 deletions src/Services/Filesystem/Php.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
* file that was distributed with this source code.
*
* @author Andrey Helldar <[email protected]>
*
* @copyright 2022 Andrey Helldar
*
* @license MIT
*
* @see https://github.com/Laravel-Lang/publisher
Expand Down Expand Up @@ -54,10 +56,6 @@ public function store(string $path, $content): string

protected function format(array $items): string
{
if ($this->config->hasAlign()) {
$this->formatter->setEqualsAlign();
}

return $this->formatter->raw($items);
}

Expand Down

0 comments on commit ef02958

Please sign in to comment.