mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Use phpstan-deprecation-rules instead (#13582)
* Replace deprecated functions * Use phpstan-deprecation-rules instead
This commit is contained in:
@@ -75,7 +75,7 @@ class FilePermissionsException extends \Exception implements UpgradeableExceptio
|
|||||||
$content = str_replace('!!!!CONTENT!!!!', '<p>' . implode('</p><p>', $commands) . '</p>', $template);
|
$content = str_replace('!!!!CONTENT!!!!', '<p>' . implode('</p><p>', $commands) . '</p>', $template);
|
||||||
$content = str_replace('!!!!LOG_FILE!!!!', $log_file, $content);
|
$content = str_replace('!!!!LOG_FILE!!!!', $log_file, $content);
|
||||||
|
|
||||||
return SymfonyResponse::create($content);
|
return new SymfonyResponse($content);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -66,9 +66,9 @@
|
|||||||
"nunomaduro/collision": "^5.0",
|
"nunomaduro/collision": "^5.0",
|
||||||
"nunomaduro/larastan": "^1.0",
|
"nunomaduro/larastan": "^1.0",
|
||||||
"php-parallel-lint/php-parallel-lint": "^1.1",
|
"php-parallel-lint/php-parallel-lint": "^1.1",
|
||||||
|
"phpstan/phpstan-deprecation-rules": "^1.0",
|
||||||
"phpstan/phpstan-mockery": "^1.0",
|
"phpstan/phpstan-mockery": "^1.0",
|
||||||
"phpunit/phpunit": "^9.3.3",
|
"phpunit/phpunit": "^9.3.3",
|
||||||
"spaze/phpstan-disallowed-calls": "^2.0",
|
|
||||||
"staudenmeir/dusk-updater": "^1.1"
|
"staudenmeir/dusk-updater": "^1.1"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
|
109
composer.lock
generated
109
composer.lock
generated
@@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "643563ebf8b7fae69a556ac42e20bbf8",
|
"content-hash": "15408329c31958767d7e83c43760020d",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "amenadiel/jpgraph",
|
"name": "amenadiel/jpgraph",
|
||||||
@@ -10367,6 +10367,56 @@
|
|||||||
],
|
],
|
||||||
"time": "2021-11-02T10:25:31+00:00"
|
"time": "2021-11-02T10:25:31+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "phpstan/phpstan-deprecation-rules",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/phpstan/phpstan-deprecation-rules.git",
|
||||||
|
"reference": "e5ccafb0dd8d835dd65d8d7a1a0d2b1b75414682"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/e5ccafb0dd8d835dd65d8d7a1a0d2b1b75414682",
|
||||||
|
"reference": "e5ccafb0dd8d835dd65d8d7a1a0d2b1b75414682",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": "^7.1 || ^8.0",
|
||||||
|
"phpstan/phpstan": "^1.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"php-parallel-lint/php-parallel-lint": "^1.2",
|
||||||
|
"phpstan/phpstan-phpunit": "^1.0",
|
||||||
|
"phpunit/phpunit": "^9.5"
|
||||||
|
},
|
||||||
|
"type": "phpstan-extension",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "1.0-dev"
|
||||||
|
},
|
||||||
|
"phpstan": {
|
||||||
|
"includes": [
|
||||||
|
"rules.neon"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"PHPStan\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"description": "PHPStan rules for detecting usage of deprecated classes, methods, properties, constants and traits.",
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/phpstan/phpstan-deprecation-rules/issues",
|
||||||
|
"source": "https://github.com/phpstan/phpstan-deprecation-rules/tree/1.0.0"
|
||||||
|
},
|
||||||
|
"time": "2021-09-23T11:02:21+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "phpstan/phpstan-mockery",
|
"name": "phpstan/phpstan-mockery",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
@@ -12015,63 +12065,6 @@
|
|||||||
},
|
},
|
||||||
"time": "2021-08-19T21:01:38+00:00"
|
"time": "2021-08-19T21:01:38+00:00"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "spaze/phpstan-disallowed-calls",
|
|
||||||
"version": "v2.0.0",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/spaze/phpstan-disallowed-calls.git",
|
|
||||||
"reference": "ff9fa0a0202badc83894168442ca8d323d408d61"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/spaze/phpstan-disallowed-calls/zipball/ff9fa0a0202badc83894168442ca8d323d408d61",
|
|
||||||
"reference": "ff9fa0a0202badc83894168442ca8d323d408d61",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": "^7.1 || ^8.0",
|
|
||||||
"phpstan/phpstan": "^1.0"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"nette/neon": "^3.2",
|
|
||||||
"nikic/php-parser": "^4.13",
|
|
||||||
"php-parallel-lint/php-console-highlighter": "^0.5.0",
|
|
||||||
"php-parallel-lint/php-parallel-lint": "^1.2",
|
|
||||||
"phpunit/phpunit": "^7.0 || ^9.4.2",
|
|
||||||
"spaze/coding-standard": "^0.0"
|
|
||||||
},
|
|
||||||
"type": "phpstan-extension",
|
|
||||||
"extra": {
|
|
||||||
"phpstan": {
|
|
||||||
"includes": [
|
|
||||||
"extension.neon"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"Spaze\\PHPStan\\Rules\\Disallowed\\": "src"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Michal Špaček",
|
|
||||||
"email": "mail@michalspacek.cz",
|
|
||||||
"homepage": "https://www.michalspacek.cz"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Disallowed method and function calls plug-in for PHPStan",
|
|
||||||
"support": {
|
|
||||||
"issues": "https://github.com/spaze/phpstan-disallowed-calls/issues",
|
|
||||||
"source": "https://github.com/spaze/phpstan-disallowed-calls/tree/v2.0.0"
|
|
||||||
},
|
|
||||||
"time": "2021-11-01T07:25:01+00:00"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "staudenmeir/dusk-updater",
|
"name": "staudenmeir/dusk-updater",
|
||||||
"version": "v1.2.2",
|
"version": "v1.2.2",
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* dbFacile - A Database API that should have existed from the start
|
* dbFacile - A Database API that should have existed from the start
|
||||||
* Version 0.4.3
|
* Version 0.4.3
|
||||||
*
|
*
|
||||||
@@ -15,6 +15,9 @@
|
|||||||
* 1. Connect to MySQL as you normally would ... this code uses an existing connection
|
* 1. Connect to MySQL as you normally would ... this code uses an existing connection
|
||||||
* 2. Use dbFacile as you normally would, without the object context
|
* 2. Use dbFacile as you normally would, without the object context
|
||||||
* 3. Oh, and dbFetchAll() is now dbFetchRows()
|
* 3. Oh, and dbFetchAll() is now dbFetchRows()
|
||||||
|
*
|
||||||
|
* @deprecated Please use Eloquent instead; https://laravel.com/docs/eloquent
|
||||||
|
* @see https://laravel.com/docs/eloquent
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Illuminate\Database\QueryException;
|
use Illuminate\Database\QueryException;
|
||||||
@@ -22,6 +25,10 @@ use LibreNMS\DB\Eloquent;
|
|||||||
use LibreNMS\Exceptions\DatabaseConnectException;
|
use LibreNMS\Exceptions\DatabaseConnectException;
|
||||||
use LibreNMS\Util\Laravel;
|
use LibreNMS\Util\Laravel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated Please use Eloquent instead; https://laravel.com/docs/eloquent
|
||||||
|
* @see https://laravel.com/docs/eloquent
|
||||||
|
*/
|
||||||
function dbIsConnected()
|
function dbIsConnected()
|
||||||
{
|
{
|
||||||
return Eloquent::isConnected();
|
return Eloquent::isConnected();
|
||||||
@@ -40,6 +47,9 @@ function dbIsConnected()
|
|||||||
* @return \Illuminate\Database\Connection
|
* @return \Illuminate\Database\Connection
|
||||||
*
|
*
|
||||||
* @throws DatabaseConnectException
|
* @throws DatabaseConnectException
|
||||||
|
*
|
||||||
|
* @deprecated Please use Eloquent instead; https://laravel.com/docs/eloquent
|
||||||
|
* @see https://laravel.com/docs/eloquent
|
||||||
*/
|
*/
|
||||||
function dbConnect($db_host = null, $db_user = '', $db_pass = '', $db_name = '', $db_port = null, $db_socket = null)
|
function dbConnect($db_host = null, $db_user = '', $db_pass = '', $db_name = '', $db_port = null, $db_socket = null)
|
||||||
{
|
{
|
||||||
@@ -85,6 +95,9 @@ function dbConnect($db_host = null, $db_user = '', $db_pass = '', $db_name = '',
|
|||||||
* @param string $sql
|
* @param string $sql
|
||||||
* @param array $parameters
|
* @param array $parameters
|
||||||
* @return bool if query was successful or not
|
* @return bool if query was successful or not
|
||||||
|
*
|
||||||
|
* @deprecated Please use Eloquent instead; https://laravel.com/docs/eloquent#building-queries
|
||||||
|
* @see https://laravel.com/docs/eloquent#building-queries
|
||||||
*/
|
*/
|
||||||
function dbQuery($sql, $parameters = [])
|
function dbQuery($sql, $parameters = [])
|
||||||
{
|
{
|
||||||
@@ -106,6 +119,9 @@ function dbQuery($sql, $parameters = [])
|
|||||||
* @param array $data
|
* @param array $data
|
||||||
* @param string $table
|
* @param string $table
|
||||||
* @return null|int
|
* @return null|int
|
||||||
|
*
|
||||||
|
* @deprecated Please use Eloquent instead; https://laravel.com/docs/eloquent#inserting-and-updating-models
|
||||||
|
* @see https://laravel.com/docs/eloquent#inserting-and-updating-models
|
||||||
*/
|
*/
|
||||||
function dbInsert($data, $table)
|
function dbInsert($data, $table)
|
||||||
{
|
{
|
||||||
@@ -132,6 +148,9 @@ function dbInsert($data, $table)
|
|||||||
* @param array $data
|
* @param array $data
|
||||||
* @param string $table
|
* @param string $table
|
||||||
* @return bool
|
* @return bool
|
||||||
|
*
|
||||||
|
* @deprecated Please use Eloquent instead; https://laravel.com/docs/eloquent#inserting-and-updating-models
|
||||||
|
* @see https://laravel.com/docs/eloquent#inserting-and-updating-models
|
||||||
*/
|
*/
|
||||||
function dbBulkInsert($data, $table)
|
function dbBulkInsert($data, $table)
|
||||||
{
|
{
|
||||||
@@ -173,6 +192,9 @@ function dbBulkInsert($data, $table)
|
|||||||
* @param string $where
|
* @param string $where
|
||||||
* @param array $parameters
|
* @param array $parameters
|
||||||
* @return bool|int
|
* @return bool|int
|
||||||
|
*
|
||||||
|
* @deprecated Please use Eloquent instead; https://laravel.com/docs/eloquent#inserting-and-updating-models
|
||||||
|
* @see https://laravel.com/docs/eloquent#inserting-and-updating-models
|
||||||
*/
|
*/
|
||||||
function dbUpdate($data, $table, $where = null, $parameters = [])
|
function dbUpdate($data, $table, $where = null, $parameters = [])
|
||||||
{
|
{
|
||||||
@@ -211,6 +233,10 @@ function dbUpdate($data, $table, $where = null, $parameters = [])
|
|||||||
return false;
|
return false;
|
||||||
}//end dbUpdate()
|
}//end dbUpdate()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated Please use Eloquent instead; https://laravel.com/docs/eloquent#deleting-models
|
||||||
|
* @see https://laravel.com/docs/eloquent#deleting-models
|
||||||
|
*/
|
||||||
function dbDelete($table, $where = null, $parameters = [])
|
function dbDelete($table, $where = null, $parameters = [])
|
||||||
{
|
{
|
||||||
$sql = 'DELETE FROM `' . $table . '`';
|
$sql = 'DELETE FROM `' . $table . '`';
|
||||||
@@ -234,6 +260,9 @@ function dbDelete($table, $where = null, $parameters = [])
|
|||||||
* @param string $target_table The table to delete entries from
|
* @param string $target_table The table to delete entries from
|
||||||
* @param array $parents an array of parent tables to check.
|
* @param array $parents an array of parent tables to check.
|
||||||
* @return bool|int
|
* @return bool|int
|
||||||
|
*
|
||||||
|
* @deprecated Please use Eloquent instead; https://laravel.com/docs/eloquent#deleting-models
|
||||||
|
* @see https://laravel.com/docs/eloquent#deleting-models
|
||||||
*/
|
*/
|
||||||
function dbDeleteOrphans($target_table, $parents)
|
function dbDeleteOrphans($target_table, $parents)
|
||||||
{
|
{
|
||||||
@@ -273,11 +302,13 @@ function dbDeleteOrphans($target_table, $parents)
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Fetches all of the rows (associatively) from the last performed query.
|
* Fetches all of the rows (associatively) from the last performed query.
|
||||||
* Most other retrieval functions build off this
|
* Most other retrieval functions build off this
|
||||||
* */
|
*
|
||||||
|
* @deprecated Please use Eloquent instead; https://laravel.com/docs/eloquent
|
||||||
|
* @see https://laravel.com/docs/eloquent
|
||||||
|
*/
|
||||||
function dbFetchRows($sql, $parameters = [])
|
function dbFetchRows($sql, $parameters = [])
|
||||||
{
|
{
|
||||||
global $PDO_FETCH_ASSOC;
|
global $PDO_FETCH_ASSOC;
|
||||||
@@ -296,11 +327,13 @@ function dbFetchRows($sql, $parameters = [])
|
|||||||
return [];
|
return [];
|
||||||
}//end dbFetchRows()
|
}//end dbFetchRows()
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* This is intended to be the method used for large result sets.
|
* This is intended to be the method used for large result sets.
|
||||||
* It is intended to return an iterator, and act upon buffered data.
|
* It is intended to return an iterator, and act upon buffered data.
|
||||||
* */
|
*
|
||||||
|
* @deprecated Please use Eloquent instead; https://laravel.com/docs/eloquent
|
||||||
|
* @see https://laravel.com/docs/eloquent
|
||||||
|
*/
|
||||||
function dbFetch($sql, $parameters = [])
|
function dbFetch($sql, $parameters = [])
|
||||||
{
|
{
|
||||||
return dbFetchRows($sql, $parameters);
|
return dbFetchRows($sql, $parameters);
|
||||||
@@ -316,11 +349,13 @@ function dbFetch($sql, $parameters = [])
|
|||||||
*/
|
*/
|
||||||
}//end dbFetch()
|
}//end dbFetch()
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Like fetch(), accepts any number of arguments
|
* Like fetch(), accepts any number of arguments
|
||||||
* The first argument is an sprintf-ready query stringTypes
|
* The first argument is an sprintf-ready query stringTypes
|
||||||
* */
|
*
|
||||||
|
* @deprecated Please use Eloquent instead; https://laravel.com/docs/eloquent
|
||||||
|
* @see https://laravel.com/docs/eloquent
|
||||||
|
*/
|
||||||
function dbFetchRow($sql = null, $parameters = [])
|
function dbFetchRow($sql = null, $parameters = [])
|
||||||
{
|
{
|
||||||
global $PDO_FETCH_ASSOC;
|
global $PDO_FETCH_ASSOC;
|
||||||
@@ -339,10 +374,12 @@ function dbFetchRow($sql = null, $parameters = [])
|
|||||||
return [];
|
return [];
|
||||||
}//end dbFetchRow()
|
}//end dbFetchRow()
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Fetches the first call from the first row returned by the query
|
* Fetches the first call from the first row returned by the query
|
||||||
* */
|
*
|
||||||
|
* @deprecated Please use Eloquent instead; https://laravel.com/docs/eloquent
|
||||||
|
* @see https://laravel.com/docs/eloquent
|
||||||
|
*/
|
||||||
function dbFetchCell($sql, $parameters = [])
|
function dbFetchCell($sql, $parameters = [])
|
||||||
{
|
{
|
||||||
global $PDO_FETCH_ASSOC;
|
global $PDO_FETCH_ASSOC;
|
||||||
@@ -363,11 +400,13 @@ function dbFetchCell($sql, $parameters = [])
|
|||||||
return null;
|
return null;
|
||||||
}//end dbFetchCell()
|
}//end dbFetchCell()
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* This method is quite different from fetchCell(), actually
|
* This method is quite different from fetchCell(), actually
|
||||||
* It fetches one cell from each row and places all the values in 1 array
|
* It fetches one cell from each row and places all the values in 1 array
|
||||||
* */
|
*
|
||||||
|
* @deprecated Please use Eloquent instead; https://laravel.com/docs/eloquent
|
||||||
|
* @see https://laravel.com/docs/eloquent
|
||||||
|
*/
|
||||||
function dbFetchColumn($sql, $parameters = [])
|
function dbFetchColumn($sql, $parameters = [])
|
||||||
{
|
{
|
||||||
global $PDO_FETCH_ASSOC;
|
global $PDO_FETCH_ASSOC;
|
||||||
@@ -391,12 +430,14 @@ function dbFetchColumn($sql, $parameters = [])
|
|||||||
return [];
|
return [];
|
||||||
}//end dbFetchColumn()
|
}//end dbFetchColumn()
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Should be passed a query that fetches two fields
|
* Should be passed a query that fetches two fields
|
||||||
* The first will become the array key
|
* The first will become the array key
|
||||||
* The second the key's value
|
* The second the key's value
|
||||||
|
*
|
||||||
|
* @deprecated Please use Eloquent instead; https://laravel.com/docs/eloquent
|
||||||
|
* @see https://laravel.com/docs/eloquent
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function dbFetchKeyValue($sql, $parameters = [])
|
function dbFetchKeyValue($sql, $parameters = [])
|
||||||
{
|
{
|
||||||
$data = [];
|
$data = [];
|
||||||
@@ -421,6 +462,9 @@ function dbFetchKeyValue($sql, $parameters = [])
|
|||||||
*
|
*
|
||||||
* @param array $data
|
* @param array $data
|
||||||
* @return array
|
* @return array
|
||||||
|
*
|
||||||
|
* @deprecated Please use Eloquent instead; https://laravel.com/docs/eloquent
|
||||||
|
* @see https://laravel.com/docs/eloquent
|
||||||
*/
|
*/
|
||||||
function dbArrayToRaw($data)
|
function dbArrayToRaw($data)
|
||||||
{
|
{
|
||||||
@@ -433,6 +477,10 @@ function dbArrayToRaw($data)
|
|||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated Please use Eloquent instead; https://laravel.com/docs/eloquent
|
||||||
|
* @see https://laravel.com/docs/eloquent
|
||||||
|
*/
|
||||||
function dbHandleException(QueryException $exception)
|
function dbHandleException(QueryException $exception)
|
||||||
{
|
{
|
||||||
$message = $exception->getMessage();
|
$message = $exception->getMessage();
|
||||||
@@ -467,6 +515,9 @@ function dbHandleException(QueryException $exception)
|
|||||||
*
|
*
|
||||||
* @param array $values
|
* @param array $values
|
||||||
* @return array
|
* @return array
|
||||||
|
*
|
||||||
|
* @deprecated Please use Eloquent instead; https://laravel.com/docs/eloquent
|
||||||
|
* @see https://laravel.com/docs/eloquent
|
||||||
*/
|
*/
|
||||||
function dbPlaceHolders(&$values)
|
function dbPlaceHolders(&$values)
|
||||||
{
|
{
|
||||||
@@ -486,16 +537,28 @@ function dbPlaceHolders(&$values)
|
|||||||
return $data;
|
return $data;
|
||||||
}//end dbPlaceHolders()
|
}//end dbPlaceHolders()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated Please use Eloquent instead; https://laravel.com/docs/eloquent
|
||||||
|
* @see https://laravel.com/docs/eloquent
|
||||||
|
*/
|
||||||
function dbBeginTransaction()
|
function dbBeginTransaction()
|
||||||
{
|
{
|
||||||
Eloquent::DB()->beginTransaction();
|
Eloquent::DB()->beginTransaction();
|
||||||
}//end dbBeginTransaction()
|
}//end dbBeginTransaction()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated Please use Eloquent instead; https://laravel.com/docs/eloquent
|
||||||
|
* @see https://laravel.com/docs/eloquent
|
||||||
|
*/
|
||||||
function dbCommitTransaction()
|
function dbCommitTransaction()
|
||||||
{
|
{
|
||||||
Eloquent::DB()->commit();
|
Eloquent::DB()->commit();
|
||||||
}//end dbCommitTransaction()
|
}//end dbCommitTransaction()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated Please use Eloquent instead; https://laravel.com/docs/eloquent
|
||||||
|
* @see https://laravel.com/docs/eloquent
|
||||||
|
*/
|
||||||
function dbRollbackTransaction()
|
function dbRollbackTransaction()
|
||||||
{
|
{
|
||||||
Eloquent::DB()->rollBack();
|
Eloquent::DB()->rollBack();
|
||||||
@@ -507,6 +570,9 @@ function dbRollbackTransaction()
|
|||||||
*
|
*
|
||||||
* @param $count
|
* @param $count
|
||||||
* @return string placholder list
|
* @return string placholder list
|
||||||
|
*
|
||||||
|
* @deprecated Please use Eloquent instead; https://laravel.com/docs/eloquent
|
||||||
|
* @see https://laravel.com/docs/eloquent
|
||||||
*/
|
*/
|
||||||
function dbGenPlaceholders($count)
|
function dbGenPlaceholders($count)
|
||||||
{
|
{
|
||||||
@@ -522,6 +588,9 @@ function dbGenPlaceholders($count)
|
|||||||
* @param string $list_column related column names
|
* @param string $list_column related column names
|
||||||
* @param array $list list of related ids
|
* @param array $list list of related ids
|
||||||
* @return array [$inserted, $deleted]
|
* @return array [$inserted, $deleted]
|
||||||
|
*
|
||||||
|
* @deprecated Please use Eloquent instead; https://laravel.com/docs/eloquent
|
||||||
|
* @see https://laravel.com/docs/eloquent
|
||||||
*/
|
*/
|
||||||
function dbSyncRelationship($table, $target_column = null, $target = null, $list_column = null, $list = null)
|
function dbSyncRelationship($table, $target_column = null, $target = null, $list_column = null, $list = null)
|
||||||
{
|
{
|
||||||
@@ -552,6 +621,9 @@ function dbSyncRelationship($table, $target_column = null, $target = null, $list
|
|||||||
* @param string $table
|
* @param string $table
|
||||||
* @param array $relationships array of relationship pairs with columns as keys and ids as values
|
* @param array $relationships array of relationship pairs with columns as keys and ids as values
|
||||||
* @return array [$inserted, $deleted]
|
* @return array [$inserted, $deleted]
|
||||||
|
*
|
||||||
|
* @deprecated Please use Eloquent instead; https://laravel.com/docs/eloquent
|
||||||
|
* @see https://laravel.com/docs/eloquent
|
||||||
*/
|
*/
|
||||||
function dbSyncRelationships($table, $relationships = [])
|
function dbSyncRelationships($table, $relationships = [])
|
||||||
{
|
{
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,9 @@
|
|||||||
includes:
|
includes:
|
||||||
|
- vendor/phpstan/phpstan-deprecation-rules/rules.neon
|
||||||
- phpstan-baseline-deprecated.neon
|
- phpstan-baseline-deprecated.neon
|
||||||
- vendor/spaze/phpstan-disallowed-calls/extension.neon
|
|
||||||
|
|
||||||
parameters:
|
parameters:
|
||||||
|
phpVersion: 70300
|
||||||
|
|
||||||
customRulesetUsed: true
|
customRulesetUsed: true
|
||||||
reportUnmatchedIgnoredErrors: false
|
reportUnmatchedIgnoredErrors: false
|
||||||
@@ -25,8 +26,3 @@ parameters:
|
|||||||
- routes
|
- routes
|
||||||
- sql-schema
|
- sql-schema
|
||||||
- tests
|
- tests
|
||||||
|
|
||||||
disallowedFunctionCalls:
|
|
||||||
-
|
|
||||||
function: 'db*()'
|
|
||||||
message: 'use Eloquent instead; https://laravel.com/docs/8.x/eloquent'
|
|
||||||
|
@@ -114,7 +114,7 @@ class SchemaTest extends TestCase
|
|||||||
// use a Mock so we don't have to rely on the schema being stable.
|
// use a Mock so we don't have to rely on the schema being stable.
|
||||||
|
|
||||||
$schema = $this->getMockBuilder(Schema::class)
|
$schema = $this->getMockBuilder(Schema::class)
|
||||||
->setMethods(['getSchema'])
|
->onlyMethods(['getSchema'])
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
$schema->method('getSchema')->willReturn($this->mock_schema);
|
$schema->method('getSchema')->willReturn($this->mock_schema);
|
||||||
|
Reference in New Issue
Block a user