定制 joelwalls/picoyplaca 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

joelwalls/picoyplaca

Composer 安装命令:

composer require joelwalls/picoyplaca

包简介

This simple package predicts if a given license place can be on the road at a certain date and time based on Quito restrictions.

README 文档

README

Latest Version Software License Build Status Total Downloads

This small package offers a simple class to predict if a certain license plate could be on the road based on the timing restrictions of Quitos's transit regulations. Framework agnostic.

Install

Via Composer

$ composer require joelwalls/picoyplaca

Usage

Simple usage of the class

require_once "vendor/autoload.php";

$predictor = new JoelWalls\PicoYPlaca\Predictor($license_plate, $date, $time);

if ($predictor->canDrive()) {
    echo "Car can be on the road";
} else {
    echo "Car cannnot be on the road";
}

The package supports a DateTime instance as second parameter.

require_once "vendor/autoload.php";

use JoelWalls\PicoYPlaca\Predictor;

$predictor = new Predictor($license_plate, new \DateTime);

if ($predictor->canDrive()) {
    echo "Car can be on the road";
} else {
    echo "Car cannnot be on the road";
}

If needed, you could also especify the timezone of the Predictor object in case the server works with a different TimeZone.

require_once "vendor/autoload.php";

use JoelWalls\PicoYPlaca\Predictor;

$predictor = new Predictor($license_plate, new \DateTime);
$predictor->setTimeZone('America/Guayaquil');

if ($predictor->canDrive()) {
    echo "Car can be on the road";
} else {
    echo "Car cannnot be on the road";
}

Note: The setTimeZone() method is recommended to use when the Predictor is initialized when a DateTime object as current time.

Testing

$ phpunit

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固