承接 pete001/frost-php-sdk 相关项目开发

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

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

pete001/frost-php-sdk

Composer 安装命令:

composer require pete001/frost-php-sdk

包简介

PHP SDK for the Poet Frost API

README 文档

README

Scrutinizer Code Quality Code Coverage Build Status StyleCI

You think blockchain is cool? Check √

You're a techie publisher who wants to stamp and protect their work? Check √

You think Po.et is the most awesome platform to do this on? Check √

You ignore the haters, and pursue your love for sweet fresh PHP 7? Check √

Well alright then, sounds like you're in the right place!

Background

You already passed the check test, so all you need are the official docs.

Installing

composer require pete001/frost-php-sdk

Configuration

Dont check in dat private key yo, use the dot env!

Sign up and fetch your API key from here.

Add it to the .env in the project root.

Usage

Because i like xmas, i made a simple factory to save time:

$api = (new FrostFactory)->api();

So far there are 3 juicy methods:

Create Work

$work = $api->createWork([
    'name' => 'I am a pickle',
    'datePublished' => '2018-02-15T20:12:01+00:00',
    'dateCreated' => '2018-02-14T19:50:21+00:00',
    'author' => 'Pickle Rick',
    'tags' => 'pickle rick morty unimpressed',
    'content' => 'Rick tells Morty to come to the garage, and Morty discovers that Rick has turned himself into a pickle but is unimpressed.'
]);

print_r($work);

Array
(
    [workId] => 46b6144b7fc6825caa3cf4b83149226f8d3f7bc0b20e6780c5d80423d1a5b86a
)

Get Work

$work = $api->getWorkById('46b6144b7fc6825caa3cf4b83149226f8d3f7bc0b20e6780c5d80423d1a5b86a');

print_r($work);

Array
(
    [name] => I am a pickle
    [datePublished] => 2018-02-15T20:12:01+00:00
    [dateCreated] => 2018-02-14T19:50:21+00:00
    [author] => Pickle Rick
    [tags] => pickle rick morty unimpressed
    [content] => Rick tells Morty to come to the garage, and Morty discovers that Rick has turned himself into a pickle but is unimpressed.
)

Get All Works

$work = $api->getWorks();

print_r($work);

Array
(
    [0] => Array
        (
            [name] => I am a pickle
            [datePublished] => 2018-02-15T20:12:01+00:00
            [dateCreated] => 2018-02-14T19:50:21+00:00
            [author] => Pickle Rick
            [tags] => pickle rick morty unimpressed
            [content] => Rick tells Morty to come to the garage, and Morty discovers that Rick has turned himself into a pickle but is unimpressed.
        )

    [1] => Array
        (
            [name] => I am still a pickle
            [datePublished] => 2018-02-15T21:12:01+00:00
            [dateCreated] => 2018-02-14T20:50:21+00:00
            [author] => Pickle Rick
            [tags] => pickle rick morty unimpressed repetitive
            [content] => Rick tells Morty once again, to come to the garage, and Morty discovers that Rick is still a pickle. He remains unimpressed.
        )

)

Tests

Project has 100% test coverage, but due to my hipster nature, the CI is run over at Gitlab. So you'll just have to take my word for it.

To run the test suites, simply execute:

vendor/bin/phpunit

If you wanna get fancy and check code coverage:

vendor/bin/phpunit --coverage-html tests/coverage

If you're as OCD as i am, you might wanna run some static analysis:

vendor/bin/phpmetrics --report-html="tests/static" .

Contributing

All contributions are welcome! Just fire up a PR and pinky swear the code passes the tests, has new tests written to maintain 100% coverage and make sure its PSR-2 compliant:

vendor/bin/php-cs-fixer fix --verbose

License

As tempting as it is to troll the world by centralising the distribution of an app for the decentralised world... This is free, free for all!

MIT License

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-02-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固