Skip to content

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