PHP code example of phphleb / draft

1. Go to this page and download the library: Download phphleb/draft 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/ */

    

phphleb / draft example snippets


return [
'AClass' => [
        'TestDraftClass' => [
            'ActionName' => 'new \DateTime',
            'Value' => '\'now\'',
            'ReturnType' => '\DateTimeInterface',
            'Description' => 'Demo A class'
        ]
    ],
'BClass' => [
        'TestDraftClass' => [
            'ActionName' => 'implode',
            'Value' => '[100,500]',
            'ReturnType' => 'string',
            'Description' => 'Demo B class'
        ]
    ],
];


/* *//**<-@Description*/
class TestDraftClass/**<-@ClassName*/
{
  private const VALUE = null/**<-@Value*/;
  public function get(): void/**<-@ReturnType*/
  {
     return /**<-@ActionName*/(self::VALUE);
  }
}


/* Demo A class */
class AClass
{
  private const VALUE = 'now';
  public function get(): \DateTimeInterface
  {
     return new \DateTime(self::VALUE);
  }
}


/* Demo B class */
class BClass
{
  private const VALUE = [100,500];
  public function get(): string
  {
     return implode(self::VALUE);
  }
}
bash
$ php console phphleb/draft --add
bash
$ php console drafts/generating-task --update-all /app/Optional/tests/services.php
$ composer dump-autoload