src/Player.php
public static function create(array $data): Player
    {
        $player = new Player();
        parent::fill($data, $player);
        if (is_array($player->clan)) {
            $player->clan = Clan::create($player->clan);
        }
        if (is_array($player->league)) {
            $player->league = League::create($player->league);
        }
        return $player;
    }
public static function create(array $data): Player
    {
        $player = new Player();
        parent::fill($data, $player);
        if (is_array($player->clan)) {
            $player->clan = Clan::create($player->clan);
        }
        if (is_array($player->league)) {
            $player->league = League::create($player->league);
        }
        return $player;
    }
public static function create ( array $ data ) : Player { $ player = new Player ( ) ; parent :: fill ( $ data , $ player ) ; if ( is_array ( $ player -> clan ) ) { $ player -> clan = Clan :: create ( $ player -> clan ) ; } if ( is_array ( $ player -> league ) ) { $ player -> league = League :: create ( $ player -> league ) ; } return $ player ; }
Creates a player object with the given data
@param array $data an associative array to fill up the members of the
player class
@return Player a player object with the data given as it's members
Creates a player object with the given data