Skip to content

Commit

Permalink
Merge pull request #20 from adriansuter/patch-native
Browse files Browse the repository at this point in the history
Fix use const and use function for php natives
  • Loading branch information
l0gicgate committed May 10, 2020
2 parents 66bd231 + 149eeb0 commit 2cbd4cc
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Config/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
use function getenv;
use function is_string;

use const DIRECTORY_SEPARATOR;

class Config
{
public const SLIM_CONSOLE_BOOTSTRAP_DIR = 'SLIM_CONSOLE_BOOTSTRAP_DIR';
Expand Down
2 changes: 2 additions & 0 deletions src/Config/ConfigResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
use function is_readable;
use function is_string;

use const DIRECTORY_SEPARATOR;

class ConfigResolver
{
public const CONFIG_FILENAME = 'slim-console.config';
Expand Down
2 changes: 2 additions & 0 deletions src/Config/Parser/JSONConfigParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
use function json_last_error;
use function json_last_error_msg;

use const JSON_ERROR_NONE;

class JSONConfigParser implements ConfigParserInterface
{
/**
Expand Down
2 changes: 2 additions & 0 deletions tests/Config/ConfigResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
use function file_get_contents;
use function json_decode;

use const DIRECTORY_SEPARATOR;

class ConfigResolverTest extends TestCase
{
public function supportedFormatsProvider(): array
Expand Down
2 changes: 2 additions & 0 deletions tests/Config/Parser/JSONConfigParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
use function file_get_contents;
use function json_decode;

use const DIRECTORY_SEPARATOR;

class JSONConfigParserTest extends TestCase
{
public function invalidConfigurationProvider(): array
Expand Down
2 changes: 2 additions & 0 deletions tests/Config/Parser/PHPConfigParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
use Slim\Console\Exception\CannotParseConfigException;
use Slim\Tests\Console\TestCase;

use const DIRECTORY_SEPARATOR;

class PHPConfigParserTest extends TestCase
{
public function testParse(): void
Expand Down
4 changes: 4 additions & 0 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
use PHPUnit\Framework\TestCase as PHPUnitTestCase;
use Slim\Console\Config\Config;

use function putenv;

use const DIRECTORY_SEPARATOR;

abstract class TestCase extends PHPUnitTestCase
{
public function setUp(): void
Expand Down

0 comments on commit 2cbd4cc

Please sign in to comment.