KoniKode · Software built with intention

KNOWLEDGE BASE

Documentation

DOCUMENTATION
CURRENT APPLICATIONClean Framework
DocumentationClean Framework

Clean Framework · DOCUMENTATION

Source: BrowseReadingList.php

Source: BrowseReadingList.php

Bounded candidate reference — 2026-10-20: 0.2.0-rc.1 is committed locally through 84f415b3098af5653577b2c65eea31fca21df79c, unpublished and not production-approved; stable PHP >=8.5.11 <8.6.0 is required. This is documentation, not adoption: this knowledge base retains its installed 0.1.0-rc.1 dependency and PHP 8.2.11 local profile. Dated PHP 8.2 evidence is historical; earlier dirty-source reports retain their original test provenance, not retroactive clean-commit proof. Candidate examples are illustrative: API signatures were reviewed, but candidate code was not executed by this editorial update. See current checkpoint, open criteria and adoption boundary.

Origin: examples/reading-list/app/Services/BrowseReadingList.php

<?php

declare(strict_types=1);

namespace Portability\ReadingList\Services;

use Portability\ReadingList\Domain\ReadingItem;
use Portability\ReadingList\Repositories\ReadingListRepository;

/** Application use case that keeps controllers independent of persistence. */
final class BrowseReadingList
{
    /** Inject the application-owned repository contract. */
    public function __construct(private ReadingListRepository $repository)
    {
    }

    /** @return list<array{slug:string,title:string,author:string}> Return list presentation data. */
    public function all(): array
    {
        return array_map(
            static fn (ReadingItem $item): array => $item->toArray(),
            $this->repository->all()
        );
    }

    /** @return array{slug:string,title:string,author:string}|null Return one presentation record. */
    public function find(string $slug): ?array
    {
        return $this->repository->findBySlug($slug)?->toArray();
    }
}

Editorial provenance

Source: examples/reading-list/app/Services/BrowseReadingList.php. Source SHA-256: 668219a475dca763fb200e501572aab689a154bc0867c1cb91a28f46a484daf3.

Framework candidate reference; editorial checkpoint 2026-10-20. See candidate status and adoption boundary.

EXPLORE FURTHER

Drag a divider or use Left and Right Arrow keys to resize. Hold Shift for larger steps. Enter hides or restores the sidebar; Home and End select its minimum or maximum width. Double-click resets the width.

Install KoniKode