PHP code example of zero-to-prod / docblock-annotator
1. Go to this page and download the library: Download zero-to-prod/docblock-annotator 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/ */
zero-to-prod / docblock-annotator example snippets
use Zerotoprod\DocblockAnnotator\DocblockAnnotator;
use Zerotoprod\DocblockAnnotator\Statement;
use Zerotoprod\DocblockAnnotator\Modifier;
use PhpParser\ParserFactory;
$DocblockAnnotator = new DocblockAnnotator(
modifiers: [Modifier::public],
statements: [Statement::ClassMethod], // can also handle raw string: class_method
success: fn(string $file, string $value) => echo "Updated: $file",
failure: fn(Throwable $e) => echo $e->getMessage(),
(new ParserFactory)->createForHostVersion()
);