承接 jketelaar/php-fut-api 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jketelaar/php-fut-api

Composer 安装命令:

composer require jketelaar/php-fut-api

包简介

Allows you to interact with the FUT using PHP

README 文档

README

Build Status Build Status

The perfect PHP FUT API

This is a perfect FUT AP...
No wait, let's first answer a question.

Are you an EA employee?
Y: This is nothing, just leave...
N: Great! Welcome to the perfect PHP FUT API 😏

How to install?

Install this project using Composer; composer require jketelaar/php-fut-api.

Then start using the API using something like:

<?php
require_once('vendor/autoload.php');

define('DATA_DIR', __DIR__ . '/data/');

$api = new \JKetelaar\fut\api\API('your@email.me', 'password', 'secret', 'totp_callback', 'platform');

// You can also disable the SSL verify peer, when you're having issues with your environment. Simply pass true as the latest parameter
// $api = new \JKetelaar\fut\api\API('your@email.me', 'password', 'secret', 'totp_callback', 'platform', true); 

if($api->login() === true) {
    echo('We\'re logged in!' . "\n");

    $handler = $api->getHandler();
    foreach($handler->getTradepile() as $trade) {
        // Interact with $trade here
    }
}

function totp_callback() {
    $totp = new \OTPHP\TOTP('FIFA', 'SECRET');

    return $totp->now();
}

FAQ

How do the enum(eration)s work?

As you might have seen, we're using an implemententation of php-enum, so we could provide enumerations within classes and type hinting.
An example of this is the class ChemistryStyle.

With a few constants, you can access the variables, but also use them for type hinting.
Let's say you have:

class ChemistryStyle extends Enum  {
    const BASIC = 250;
    const SNIPER = 251;
}

Now we can get the values of the constants, by doing: ChemistryStyle::BASIC.

But in a more advanced level, we can also use these for type hinting, using parenthesises.
Say we have the function:

function findByChemistryStyle(ChemistryStyle $style){
    echo('Searching for players with style ID' . $style);
}

As you can see, we have a parameter, which only allows ChemistryStyle.
We can call this function using the constant and adding an opening-and-closing parenthesis:

findByChemistryStyle(ChemistryStyle::SNIPER())

Credits

统计信息

  • 总下载量: 92
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 18
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 18
  • Watchers: 10
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2016-10-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固