Use more standardized phpcs
This commit is contained in:
parent
a043071e3c
commit
c449ca5155
493 changed files with 1116 additions and 3903 deletions
|
@ -23,9 +23,6 @@ class DatabaseRepository extends EloquentRepository implements DatabaseRepositor
|
|||
|
||||
/**
|
||||
* DatabaseRepository constructor.
|
||||
*
|
||||
* @param \Illuminate\Foundation\Application $application
|
||||
* @param \Illuminate\Database\DatabaseManager $database
|
||||
*/
|
||||
public function __construct(Application $application, DatabaseManager $database)
|
||||
{
|
||||
|
@ -47,7 +44,6 @@ class DatabaseRepository extends EloquentRepository implements DatabaseRepositor
|
|||
/**
|
||||
* Set the connection name to execute statements against.
|
||||
*
|
||||
* @param string $connection
|
||||
* @return $this
|
||||
*/
|
||||
public function setConnection(string $connection)
|
||||
|
@ -59,8 +55,6 @@ class DatabaseRepository extends EloquentRepository implements DatabaseRepositor
|
|||
|
||||
/**
|
||||
* Return the connection to execute statements against.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getConnection(): string
|
||||
{
|
||||
|
@ -69,9 +63,6 @@ class DatabaseRepository extends EloquentRepository implements DatabaseRepositor
|
|||
|
||||
/**
|
||||
* Return all of the databases belonging to a server.
|
||||
*
|
||||
* @param int $server
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
public function getDatabasesForServer(int $server): Collection
|
||||
{
|
||||
|
@ -80,10 +71,6 @@ class DatabaseRepository extends EloquentRepository implements DatabaseRepositor
|
|||
|
||||
/**
|
||||
* Return all of the databases for a given host with the server relationship loaded.
|
||||
*
|
||||
* @param int $host
|
||||
* @param int $count
|
||||
* @return \Illuminate\Contracts\Pagination\LengthAwarePaginator
|
||||
*/
|
||||
public function getDatabasesForHost(int $host, int $count = 25): LengthAwarePaginator
|
||||
{
|
||||
|
@ -94,9 +81,6 @@ class DatabaseRepository extends EloquentRepository implements DatabaseRepositor
|
|||
|
||||
/**
|
||||
* Create a new database on a given connection.
|
||||
*
|
||||
* @param string $database
|
||||
* @return bool
|
||||
*/
|
||||
public function createDatabase(string $database): bool
|
||||
{
|
||||
|
@ -106,15 +90,11 @@ class DatabaseRepository extends EloquentRepository implements DatabaseRepositor
|
|||
/**
|
||||
* Create a new database user on a given connection.
|
||||
*
|
||||
* @param string $username
|
||||
* @param string $remote
|
||||
* @param string $password
|
||||
* @param $max_connections
|
||||
* @return bool
|
||||
*/
|
||||
public function createUser(string $username, string $remote, string $password, $max_connections): bool
|
||||
{
|
||||
if (! $max_connections) {
|
||||
if (!$max_connections) {
|
||||
return $this->run(sprintf('CREATE USER `%s`@`%s` IDENTIFIED BY \'%s\'', $username, $remote, $password));
|
||||
} else {
|
||||
return $this->run(sprintf('CREATE USER `%s`@`%s` IDENTIFIED BY \'%s\' WITH MAX_USER_CONNECTIONS %s', $username, $remote, $password, $max_connections));
|
||||
|
@ -123,11 +103,6 @@ class DatabaseRepository extends EloquentRepository implements DatabaseRepositor
|
|||
|
||||
/**
|
||||
* Give a specific user access to a given database.
|
||||
*
|
||||
* @param string $database
|
||||
* @param string $username
|
||||
* @param string $remote
|
||||
* @return bool
|
||||
*/
|
||||
public function assignUserToDatabase(string $database, string $username, string $remote): bool
|
||||
{
|
||||
|
@ -141,8 +116,6 @@ class DatabaseRepository extends EloquentRepository implements DatabaseRepositor
|
|||
|
||||
/**
|
||||
* Flush the privileges for a given connection.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function flush(): bool
|
||||
{
|
||||
|
@ -151,9 +124,6 @@ class DatabaseRepository extends EloquentRepository implements DatabaseRepositor
|
|||
|
||||
/**
|
||||
* Drop a given database on a specific connection.
|
||||
*
|
||||
* @param string $database
|
||||
* @return bool
|
||||
*/
|
||||
public function dropDatabase(string $database): bool
|
||||
{
|
||||
|
@ -163,8 +133,6 @@ class DatabaseRepository extends EloquentRepository implements DatabaseRepositor
|
|||
/**
|
||||
* Drop a given user on a specific connection.
|
||||
*
|
||||
* @param string $username
|
||||
* @param string $remote
|
||||
* @return mixed
|
||||
*/
|
||||
public function dropUser(string $username, string $remote): bool
|
||||
|
@ -174,9 +142,6 @@ class DatabaseRepository extends EloquentRepository implements DatabaseRepositor
|
|||
|
||||
/**
|
||||
* Run the provided statement against the database on a given connection.
|
||||
*
|
||||
* @param string $statement
|
||||
* @return bool
|
||||
*/
|
||||
private function run(string $statement): bool
|
||||
{
|
||||
|
|
Reference in a new issue