承接 hands-on-ekino-php/your-client 相关项目开发

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

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

hands-on-ekino-php/your-client

最新稳定版本:v1

Composer 安装命令:

composer require hands-on-ekino-php/your-client

包简介

test

README 文档

README

A PHP client library for interacting with the JSONPlaceholder API, with easy Symfony integration.

Features

  • Simple and clean API client for JSONPlaceholder
  • Easy integration with Symfony applications
  • Customizable HTTP client configuration
  • Optional clock emoji header for fun

Installation

Install the library via composer:

composer require hands-on-ekino-php/your-client

Usage

Basic usage with Symfony

  1. Register the bundle in your config/bundles.php:
return [
    // ...other bundles
    HandsOnEkinoPhp\YourClient\Bridge\Symfony\HandsOnEkinoPhpBundle::class => ['all' => true],
];
  1. Configure the client in your config/packages/hands_on.yaml:
hands_on_ekino_php:
    client:
        clock_header: true  # Set to false to disable the clock emoji header
        name: todos_client  # The name of your HTTP client service
  1. Configure your HTTP client in config/packages/framework.yaml:
framework:
    http_client:
        scoped_clients:
            todos_client:
                base_uri: 'https://jsonplaceholder.typicode.com'
  1. Use the client in your actions or services:
<?php

namespace App\Action;

use HandsOnEkinoPhp\YourClient\Client\TodosClient;
use Symfony\Component\HttpFoundation\JsonResponse;

class MyAction
{
    public function __invoke(TodosClient $todosClient): JsonResponse
    {
        // The client is automatically injected thanks to Symfony's autowiring
        return $todosClient->getTodos();
    }
}

Development

Running tests

vendor/bin/phpunit

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This library is open-sourced software licensed under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-04-04