arm-cm/task-memory

Manage a task list in memory

Installs: 1

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/arm-cm/task-memory

v1.0.0 2025-07-18 17:26 UTC

This package is auto-updated.

Last update: 2025-09-21 21:16:55 UTC


README

Banner

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.