PHP code example of saberyjs / annotation

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

    

saberyjs / annotation example snippets


class  Student{
    /**
     * @type post
     * @https true
     * **/
    public function  getName(){
        return '';
    }
}

$doc=\saberyjs\annotation\Annotation::getAnnotation();

namespace  saberyjs\annotation;

interface  Parser {
    /**
     * @param  $doc string
     * @return  array|null
     * **/
    public function parse($doc);
}

$doc=\saberyjs\annotation\Annotation::getAnnotation(Student::class);
$parser=new \saberyjs\annotation\StandardAnnotationParser();
$parts=\saberyjs\annotation\Annotation::parseAnnotation($doc,$parser);

/**
     * @type post
     * @https true
     * **/

$ret=[[
    'name'=>'type',
    'value'=>'post'
    ],[
       'name'=>'https',
       'value'=>'true'
    ]
];