Skip to content

php-enspired/project-todo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

PHPModules Todo β€” PHP Modules Demo

Demonstrates PHP's module feature through a todo list domain.

Features Covered

Feature How It's Shown
module { } block Todo.php β€” claims all members
Inline const MAX_ITEMS_PER_LIST
Forward declarations (claims) 6 claims + nested module claim
public class TaskList, Task, ListRepository, Renderable, ListError
internal trait HasTimestamps β€” usable only inside the module
internal(set) property Task::$completed β€” readable, writeable only inside module
internal method TaskList::reorderTasks()
Nested module Todo::Storage β€” groups ListMapper, TaskMapper
extends across boundary Outside PriorityTask extends Todo::Task
implements across boundary Outside JsonExport implements Todo::Renderable

File Structure

project-todo/
β”œβ”€β”€ README.md
β”œβ”€β”€ composer.json
β”œβ”€β”€ entry.php
└── src/
    β”œβ”€β”€ Todo.php
    └── Todo/
        β”œβ”€β”€ TaskList.php
        β”œβ”€β”€ Task.php
        β”œβ”€β”€ ListRepository.php
        β”œβ”€β”€ Renderable.php
        β”œβ”€β”€ ListError.php
        β”œβ”€β”€ HasTimestamps.php
        └── Storage/
            β”œβ”€β”€ ListMapper.php
            └── TaskMapper.php

About

demo project for php-modules

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages