Skip to content

Latest commit

 

History

History
106 lines (64 loc) · 2.18 KB

README.md

File metadata and controls

106 lines (64 loc) · 2.18 KB

Package pphp

This package is for those who like beautiful, orderly and easily program code!

API

Class patterns:

  • @php => <?php
  • @class => class
  • @extends => extends
  • @implements => implements
  • @var[+/-/.] => [public/private/protected] variable
  • @vars[+/-/.] => [public/private/protected] static variable
  • @def[+/-/.] => [public/private/protected] function
  • @defs[+/-/.] => [public/private/protected] static function

Construction patterns:

  • @foreach => foreach
  • @if => if
  • @end => close construction

Example:

Source in:

@php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\DB;
use App\Classes\Contracts\ReplacerInterface;

@class TestController

  @extends MainController
  @implements ReplacerInterface

  use Request;

  @vars. $staticVar = 'TEST';

  @def+ __construct()

    parent::__construct();

  @end

  @defs+ testFunction($params)

    return true;

  @end

@end

Source out:

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\DB;
use App\Classes\Contracts\ReplacerInterface;

class TestController

  extends MainController
  implements ReplacerInterface{

  use Request;

  protected static $staticVar = 'TEST';

  public function __construct(){

    parent::__construct();

  }

  public static function testFunction($params){

    return true;

  }

}