PHP code example of dkplus / formica

1. Go to this page and download the library: Download dkplus/formica library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

dkplus / formica example snippets


namespace Acme;

class Issue
{
    // …
    
    public static function bug(string $id, string $title, string $text): self
    {
        // …    
    }
    
    // …
}

namespace Acme;

use Dkplus\Formica\Builder;

/**
 * @method IssueBuilder withTitle(string $title)
 * @method IssueBuilder withText(string $text)
 */
class IssueBuilder extends Builder
{
    public static function aBug()
    {
        return new self([
            '74738ff5-5367-5958-9aee-98fffdcd1876',
            'title' => 'It does not work',
            'text' => 'A long error text',
        ], 'bug');
    }
}

$issue = IssueBuilder::aBug()->withTitle('Another title')->build();