Less strict type; closes #2681
This commit is contained in:
parent
d22456d9ca
commit
f9ea96f45d
2 changed files with 3 additions and 5 deletions
|
@ -4,7 +4,6 @@ namespace Pterodactyl\Transformers\Api\Application;
|
||||||
|
|
||||||
use Cake\Chronos\Chronos;
|
use Cake\Chronos\Chronos;
|
||||||
use Pterodactyl\Models\Database;
|
use Pterodactyl\Models\Database;
|
||||||
use League\Fractal\Resource\Item;
|
|
||||||
use Pterodactyl\Models\DatabaseHost;
|
use Pterodactyl\Models\DatabaseHost;
|
||||||
use Pterodactyl\Services\Acl\Api\AdminAcl;
|
use Pterodactyl\Services\Acl\Api\AdminAcl;
|
||||||
use Illuminate\Contracts\Encryption\Encrypter;
|
use Illuminate\Contracts\Encryption\Encrypter;
|
||||||
|
@ -72,7 +71,7 @@ class ServerDatabaseTransformer extends BaseTransformer
|
||||||
* @param \Pterodactyl\Models\Database $model
|
* @param \Pterodactyl\Models\Database $model
|
||||||
* @return \League\Fractal\Resource\Item
|
* @return \League\Fractal\Resource\Item
|
||||||
*/
|
*/
|
||||||
public function includePassword(Database $model): Item
|
public function includePassword(Database $model)
|
||||||
{
|
{
|
||||||
return $this->item($model, function (Database $model) {
|
return $this->item($model, function (Database $model) {
|
||||||
return [
|
return [
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
namespace Pterodactyl\Transformers\Api\Client;
|
namespace Pterodactyl\Transformers\Api\Client;
|
||||||
|
|
||||||
use Pterodactyl\Models\Database;
|
use Pterodactyl\Models\Database;
|
||||||
use League\Fractal\Resource\Item;
|
|
||||||
use Pterodactyl\Models\Permission;
|
use Pterodactyl\Models\Permission;
|
||||||
use Illuminate\Contracts\Encryption\Encrypter;
|
use Illuminate\Contracts\Encryption\Encrypter;
|
||||||
use Pterodactyl\Contracts\Extensions\HashidsInterface;
|
use Pterodactyl\Contracts\Extensions\HashidsInterface;
|
||||||
|
@ -69,9 +68,9 @@ class DatabaseTransformer extends BaseClientTransformer
|
||||||
* @param \Pterodactyl\Models\Database $database
|
* @param \Pterodactyl\Models\Database $database
|
||||||
* @return \League\Fractal\Resource\Item|\League\Fractal\Resource\NullResource
|
* @return \League\Fractal\Resource\Item|\League\Fractal\Resource\NullResource
|
||||||
*/
|
*/
|
||||||
public function includePassword(Database $database): Item
|
public function includePassword(Database $database)
|
||||||
{
|
{
|
||||||
if (!$this->getUser()->can(Permission::ACTION_DATABASE_VIEW_PASSWORD, $database->server)) {
|
if (! $this->getUser()->can(Permission::ACTION_DATABASE_VIEW_PASSWORD, $database->server)) {
|
||||||
return $this->null();
|
return $this->null();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue