Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Apr 30, 2019
1 parent 00f1776 commit 4560d28
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 221 deletions.
5 changes: 2 additions & 3 deletions src/Illuminate/Database/DatabaseManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,8 @@ protected function configuration($name)
throw new InvalidArgumentException("Database [{$name}] not configured.");
}

$urlParser = new UrlParser;

return $urlParser->parseDatabaseConfigWithUrl($config);
return (new ConfigurationUrlParser)
->parseConfiguration($config);
}

/**
Expand Down
212 changes: 0 additions & 212 deletions src/Illuminate/Database/UrlParser.php

This file was deleted.

12 changes: 6 additions & 6 deletions tests/Database/DatabaseUrlParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Illuminate\Tests\Database;

use PHPUnit\Framework\TestCase;
use Illuminate\Database\UrlParser;
use Illuminate\Database\ConfigurationUrlParser;

class DatabaseUrlParserTest extends TestCase
{
Expand All @@ -12,7 +12,7 @@ class DatabaseUrlParserTest extends TestCase
*/
public function testDatabaseUrlsAreParsed($config, $expectedOutput)
{
$this->assertEquals($expectedOutput, (new UrlParser)->parseDatabaseConfigWithUrl($config));
$this->assertEquals($expectedOutput, (new ConfigurationUrlParser)->parseConfiguration($config));
}

public function testDriversAliases()
Expand All @@ -23,9 +23,9 @@ public function testDriversAliases()
'postgres' => 'pgsql',
'postgresql' => 'pgsql',
'sqlite3' => 'sqlite',
], UrlParser::getDriverAliases());
], ConfigurationUrlParser::getDriverAliases());

UrlParser::addDriverAlias('some-particular-alias', 'mysql');
ConfigurationUrlParser::addDriverAlias('some-particular-alias', 'mysql');

$this->assertEquals([
'mssql' => 'sqlsrv',
Expand All @@ -34,11 +34,11 @@ public function testDriversAliases()
'postgresql' => 'pgsql',
'sqlite3' => 'sqlite',
'some-particular-alias' => 'mysql',
], UrlParser::getDriverAliases());
], ConfigurationUrlParser::getDriverAliases());

$this->assertEquals([
'driver' => 'mysql',
], (new UrlParser)->parseDatabaseConfigWithUrl('some-particular-alias://null'));
], (new ConfigurationUrlParser)->parseConfiguration('some-particular-alias://null'));
}

public function databaseUrls()
Expand Down

0 comments on commit 4560d28

Please sign in to comment.