You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<?php
namespace App\Traits;
use Vinkla\Hashids\Facades\Hashids;
/**
* Trait to decode id value
*/
trait CodeDecodeId
{
private string|int $id;
/**
* Set property id to use in methods inside class
*/
public function setId(string|int $id): void
{
if (env('USE_HASH', true)) {
$this->id = (int) Hashids::connection('main')->decodeHex($id);
} else {
$this->id = (int) $id;
}
}
}
I am using the following code for an integer ID to hash conversion. When validating the error Parameter type tip: CodeDecodeId.php:12: Non-parsable php code: syntax error or wrong phpdocs., I have already looked for several solutions to get around this error, but nothing I have done so far has resolved , this occurs in other classes also whether with a simple or compound parameter.
At the moment I have this validation disabled to be able to follow the project, but it would be very interesting to be able to check the typing.
This happens with ParameterTypeHint, PropertyTypeHint.
Laravel: 10.1.0
PHP: 8.2.12
The text was updated successfully, but these errors were encountered:
I am using the following code for an integer ID to hash conversion. When validating the error
Parameter type tip: CodeDecodeId.php:12: Non-parsable php code: syntax error or wrong phpdocs.
, I have already looked for several solutions to get around this error, but nothing I have done so far has resolved , this occurs in other classes also whether with a simple or compound parameter.At the moment I have this validation disabled to be able to follow the project, but it would be very interesting to be able to check the typing.
This happens with ParameterTypeHint, PropertyTypeHint.
Laravel: 10.1.0
PHP: 8.2.12
The text was updated successfully, but these errors were encountered: