Skip to content

Commit

Permalink
Rename namespace to match repo
Browse files Browse the repository at this point in the history
  • Loading branch information
bennothommo committed Aug 1, 2022
1 parent aa97a98 commit b1e1a07
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 27 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ composer require winter/laravel-config-writer

### PHP array files

You can modify Laravel-style PHP configuration files - PHP files that return a single array - by using the `Winter\LaravelConfig\ArrayFile` class. Use the `open` method to open an existing file for modification, or to create a new config file.
You can modify Laravel-style PHP configuration files - PHP files that return a single array - by using the `Winter\LaravelConfigWriter\ArrayFile` class. Use the `open` method to open an existing file for modification, or to create a new config file.

```php
use Winter\LaravelConfig\ArrayFile;
use Winter\LaravelConfigWriter\ArrayFile;

$config = ArrayFile::open(base_path('config/app.php'));
```
Expand Down Expand Up @@ -110,10 +110,10 @@ $config->sort(ArrayFile::SORT_DESC);

### Environment files

This utility library also allows manipulation of environment files, typically found as `.env` files in a project. The `Winter\LaravelConfig\EnvFile::open()` method allows you to open or create an environment file for modification.
This utility library also allows manipulation of environment files, typically found as `.env` files in a project. The `Winter\LaravelConfigWriter\EnvFile::open()` method allows you to open or create an environment file for modification.

```php
use Winter\LaravelConfig\EnvFile;
use Winter\LaravelConfigWriter\EnvFile;

$config = EnvFile::open(base_path('.env'));
```
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
},
"autoload": {
"psr-4": {
"Winter\\LaravelConfig\\": "src/"
"Winter\\LaravelConfigWriter\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Winter\\LaravelConfig\\Tests\\": "tests/"
"Winter\\LaravelConfigWriter\\Tests\\": "tests/"
}
}
}
12 changes: 6 additions & 6 deletions src/ArrayFile.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Winter\LaravelConfig;
namespace Winter\LaravelConfigWriter;

use PhpParser\Error;
use PhpParser\Lexer;
Expand All @@ -14,11 +14,11 @@
use PhpParser\Node\Scalar\LNumber;
use PhpParser\Node\Stmt;
use PhpParser\ParserFactory;
use Winter\LaravelConfig\Contracts\DataFileInterface;
use Winter\LaravelConfig\Exceptions\ConfigWriterException;
use Winter\LaravelConfig\Parser\PHPConstant;
use Winter\LaravelConfig\Parser\PHPFunction;
use Winter\LaravelConfig\Printer\ArrayPrinter;
use Winter\LaravelConfigWriter\Contracts\DataFileInterface;
use Winter\LaravelConfigWriter\Exceptions\ConfigWriterException;
use Winter\LaravelConfigWriter\Parser\PHPConstant;
use Winter\LaravelConfigWriter\Parser\PHPFunction;
use Winter\LaravelConfigWriter\Printer\ArrayPrinter;

class ArrayFile implements DataFileInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Contracts/DataFileInterface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Winter\LaravelConfig\Contracts;
namespace Winter\LaravelConfigWriter\Contracts;

interface DataFileInterface
{
Expand Down
4 changes: 2 additions & 2 deletions src/EnvFile.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace Winter\LaravelConfig;
namespace Winter\LaravelConfigWriter;

use Winter\LaravelConfig\Contracts\DataFileInterface;
use Winter\LaravelConfigWriter\Contracts\DataFileInterface;

/**
* Class EnvFile
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptions/ConfigWriterException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Winter\LaravelConfig\Exceptions;
namespace Winter\LaravelConfigWriter\Exceptions;

class ConfigWriterException extends \Exception
{
Expand Down
2 changes: 1 addition & 1 deletion src/Parser/PHPConstant.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Winter\LaravelConfig\Parser;
namespace Winter\LaravelConfigWriter\Parser;

/**
* Used with ArrayFile to inject a constant into a PHP array file
Expand Down
2 changes: 1 addition & 1 deletion src/Parser/PHPFunction.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Winter\LaravelConfig\Parser;
namespace Winter\LaravelConfigWriter\Parser;

/**
* Used with ArrayFile to inject a function call into a PHP array file
Expand Down
2 changes: 1 addition & 1 deletion src/Printer/ArrayPrinter.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Winter\LaravelConfig\Printer;
namespace Winter\LaravelConfigWriter\Printer;

use PhpParser\Lexer;
use PhpParser\Node;
Expand Down
12 changes: 6 additions & 6 deletions tests/ArrayFileTest.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace Winter\LaravelConfig\Tests;
namespace Winter\LaravelConfigWriter\Tests;

use PHPUnit\Framework\TestCase;
use Winter\LaravelConfig\ArrayFile;
use Winter\LaravelConfigWriter\ArrayFile;

class ArrayFileTest extends TestCase
{
Expand Down Expand Up @@ -441,7 +441,7 @@ public function testWriteIllegalOffset()
$file = __DIR__ . '/fixtures/array/empty.php';
$arrayFile = ArrayFile::open($file);

$this->expectException(\Winter\LaravelConfig\Exceptions\ConfigWriterException::class);
$this->expectException(\Winter\LaravelConfigWriter\Exceptions\ConfigWriterException::class);

$arrayFile->set([
'w.i.n.t.e.r' => 'Winter CMS',
Expand Down Expand Up @@ -536,7 +536,7 @@ public function testWriteConstCall()
]);

$arrayFile->set([
'curl_return' => new \Winter\LaravelConfig\Parser\PHPConstant('CURLOPT_RETURNTRANSFER')
'curl_return' => new \Winter\LaravelConfigWriter\Parser\PHPConstant('CURLOPT_RETURNTRANSFER')
]);

$expected = <<<PHP
Expand Down Expand Up @@ -607,7 +607,7 @@ public function testWriteFunctionCall()
]);

$arrayFile->set([
'key2' => new \Winter\LaravelConfig\Parser\PHPFunction('nl2br', ['KEY_B', false])
'key2' => new \Winter\LaravelConfigWriter\Parser\PHPFunction('nl2br', ['KEY_B', false])
]);

$expected = <<<PHP
Expand All @@ -633,7 +633,7 @@ public function testWriteFunctionCallOverwrite()
]);

$arrayFile->set([
'key' => new \Winter\LaravelConfig\Parser\PHPFunction('nl2br', ['KEY_B', false])
'key' => new \Winter\LaravelConfigWriter\Parser\PHPFunction('nl2br', ['KEY_B', false])
]);

$expected = <<<PHP
Expand Down
4 changes: 2 additions & 2 deletions tests/EnvFileTest.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace Winter\LaravelConfig\Tests;
namespace Winter\LaravelConfigWriter\Tests;

use PHPUnit\Framework\TestCase;
use Winter\LaravelConfig\EnvFile;
use Winter\LaravelConfigWriter\EnvFile;

class EnvFileTest extends TestCase
{
Expand Down

0 comments on commit b1e1a07

Please sign in to comment.