Skip to content

Commit 775c7bb

Browse files
committed
[DB] minor fixes
1 parent 4f176cc commit 775c7bb

6 files changed

Lines changed: 16 additions & 16 deletions

File tree

app/Models/User.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ public function scopeActiveOnly( Builder $query ): Builder
247247
*
248248
* @return Builder
249249
*/
250-
public function scopeByPrivs( Builder $query, int $priv = null ): Builder
250+
public function scopeByPrivs( Builder $query, ?int $priv = null ): Builder
251251
{
252252
return $query->select( 'user.*' )->leftJoin( 'customer_to_users AS c2u', 'c2u.user_id', 'user.id' )
253253
->when( $priv, function( Builder $q, $priv ){

app/Services/Grapher/Graph.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,7 @@ public function getParamsAsArray(): array
10301030
*
10311031
* @return string|null The verified / sanitised / default value
10321032
*/
1033-
public static function processParameterPeriod( string $value = null, string $default = null, $withExtended = false ): string|null
1033+
public static function processParameterPeriod( ?string $value = null, ?string $default = null, $withExtended = false ): string|null
10341034
{
10351035
if( $withExtended && !isset( self::PERIODS_EXTENDED[ $value ] ) ) {
10361036
$value = $default ?? self::PERIOD_DEFAULT;
@@ -1051,7 +1051,7 @@ public static function processParameterPeriod( string $value = null, string $def
10511051
*
10521052
* @return string|null The verified / sanitised / default value
10531053
*/
1054-
public static function processParameterProtocol( string $value = null ): string|null
1054+
public static function processParameterProtocol( ?string $value = null ): string|null
10551055
{
10561056
if( !isset( self::PROTOCOLS[ $value ] ) ) {
10571057
$value = self::PROTOCOL_DEFAULT;
@@ -1068,7 +1068,7 @@ public static function processParameterProtocol( string $value = null ): string|
10681068
* @param string|null $value The user input value
10691069
* @return string|null The verified / sanitised / default value
10701070
*/
1071-
public static function processParameterRealProtocol( string $value = null ): string|null
1071+
public static function processParameterRealProtocol( ?string $value = null ): string|null
10721072
{
10731073
if( !isset( self::PROTOCOLS_REAL[ $value ] ) ) {
10741074
$value = self::PROTOCOL_IPV4;
@@ -1087,7 +1087,7 @@ public static function processParameterRealProtocol( string $value = null ): str
10871087
*
10881088
* @return string|null The verified / sanitised / default value
10891089
*/
1090-
public static function processParameterCategory( string $value = null, bool $bits_pkts_only = false ): string|null
1090+
public static function processParameterCategory( ?string $value = null, bool $bits_pkts_only = false ): string|null
10911091
{
10921092
if( ( $bits_pkts_only && !isset( self::CATEGORIES_BITS_PKTS[$value] ) ) || ( !$bits_pkts_only && !isset( self::CATEGORIES[ $value ] ) ) ) {
10931093
$value = self::CATEGORY_DEFAULT;
@@ -1105,7 +1105,7 @@ public static function processParameterCategory( string $value = null, bool $bit
11051105
*
11061106
* @return string|null The verified / sanitised / default value
11071107
*/
1108-
public static function processParameterType( string $value = null ): string|null
1108+
public static function processParameterType( ?string $value = null ): string|null
11091109
{
11101110
if( !isset( self::TYPES[ $value ] ) ) {
11111111
$value = self::TYPE_DEFAULT;

app/Support/helpers.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,11 @@ function rrd_graph( $a, $b ) { return []; }
147147
* on 21 Apr 2024 as that repo has switched to read-only and was
148148
* marked as no longer supported. MIT licensed.
149149
*
150-
* @param string $value
151-
* @param bool $inline
150+
* @param ?string $value
151+
* @param ?bool $inline
152152
* @return Parsedown|string
153153
*/
154-
function parsedown(?string $value = null, bool $inline = null)
154+
function parsedown(?string $value = null, ?bool $inline = null): Parsedown|string
155155
{
156156
/**
157157
* @var Parsedown $parser

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
"pestphp/pest-plugin": true
130130
},
131131
"platform": {
132-
"php": "8.3.0"
132+
"php": "8.3.11"
133133
}
134134
},
135135
"minimum-stability": "dev",

composer.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

database/migrations/2020_09_18_095136_delete_ixp_table.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ public function up()
4040

4141
$infrastructure_fks = array_column(
4242
Schema::getConnection()->select('SELECT CONSTRAINT_NAME FROM information_schema.KEY_COLUMN_USAGE '
43-
. 'WHERE TABLE_SCHEMA = "ixp" AND TABLE_NAME = "infrastructure" AND '
44-
. 'REFERENCED_TABLE_SCHEMA = "ixp" AND REFERENCED_TABLE_NAME = "ixp"'
43+
. 'WHERE TABLE_SCHEMA = "' . config('database.connections.mysql.database') . '" AND TABLE_NAME = "infrastructure" AND '
44+
. 'REFERENCED_TABLE_SCHEMA = "' . config('database.connections.mysql.database') . '" AND REFERENCED_TABLE_NAME = "ixp"'
4545
), 'CONSTRAINT_NAME'
4646
);
4747

@@ -54,8 +54,8 @@ public function up()
5454

5555
$traffic_daily_fks = array_column(
5656
Schema::getConnection()->select('SELECT CONSTRAINT_NAME FROM information_schema.KEY_COLUMN_USAGE '
57-
. 'WHERE TABLE_SCHEMA = "ixp" AND TABLE_NAME = "traffic_daily" AND '
58-
. 'REFERENCED_TABLE_SCHEMA = "ixp" AND REFERENCED_TABLE_NAME = "ixp"'
57+
. 'WHERE TABLE_SCHEMA = "' . config('database.connections.mysql.database') . '" AND TABLE_NAME = "traffic_daily" AND '
58+
. 'REFERENCED_TABLE_SCHEMA = "' . config('database.connections.mysql.database') . '" AND REFERENCED_TABLE_NAME = "ixp"'
5959
), 'CONSTRAINT_NAME'
6060
);
6161

0 commit comments

Comments
 (0)