arm-cm/task-memory
最新稳定版本:v1.0.0
Composer 安装命令:
composer require arm-cm/task-memory
包简介
Manage a task list in memory
README 文档
README
This package allows manage task in memory.
Installation
You can install the package via composer:
composer require armcm/task-memory
Usage
Install the package in your project:
mkdir demo-task-app cd demo-task-app composer init # Follow prompts composer require arm-cm/task-memory
Create file index php
demo-task-app/
├── vendor/
├── composer.json
└── index.php
Index.php
<?php require 'vendor/autoload.php'; use ArmCm\TaskMemory\Task; use ArmCm\TaskMemory\TaskCollection; $task = new Task('Write demo', 'Create a usage example'); $collection = new TaskCollection(); $collection->add($task); print_r($collection->toArray()); echo $collection->toJson();
Run script
php index.php
API Reference
Methods that can be used in Task class
use ArmCm\TaskMemory\Task; $task = new Task('Title', 'Description'); $task->done(); $task->starting(); $task->currentStatus() $task->update('New title', 'New description'); $task->update('New title');
Methods that can be used in TaskCollection class
use ArmCm\TaskMemory\TaskCollection; $collection = new TaskCollection(); $collection->add(Task|array $tasks) — Adds one or more Task objects to the collection $collection->all(): array — Returns all tasks as an array of Task objects $collection->count(): int — Returns the total number of tasks in the collection $collection->findBy(string $attribute, string|int $value): array — Returns all tasks that match the given parameters $collection->toArray(): array — Converts the task collection to an associative array $collection->toJson(): string — Converts the task collection to a JSON string
Testing
composer test
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-07-18