PHP Classes

How to Use a PHP VSCode Extension to Help Creating Documentation Blocks in DoBu Format Using the Package VSC Dobu Helper: Create DoBu documentation blocks in Visual Studio

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2026-05-07 (1 month ago) RSS 2.0 feedNot yet rated by the usersTotal: Not yet counted Not yet ranked
Version License PHP version Categories
vsc-dobu-helper 0.0.4Custom (specified...5PHP 5, Tools, Code Generation
Description 

Author

This package can help to create DoBu documentation blocks in Visual Studio Code.

It provides an extension to the Visual Studio Code IDE to help create documentation blocks in the code of several languages.

Currently it supports languages like PHP, JavaScript, CSS, and C++.

Picture of Christos Drogidis
  Performance   Level  
Name: Christos Drogidis <contact>
Classes: 41 packages by
Country: Greece Greece
Innovation award
Innovation award
Nominee: 24x

Winner: 5x

Instructions

Example

<?php
/*
dobu {
    file:id(`FILE-ID`),name(`example2`) {
        ascoos {
            logo {`
                  __ _ ___ ___ ___ ___ ___ ___ ___
                 / _` |/ / / __/ _ \ / _ \ / / / _ \ / /
                | (_| |\ \| (_| (_) | (_) |\ \ | (_) |\ \
                 \__,_|/__/ \___\___/ \___/ /__/ \___/ /__/
            `},
            name {`ASCOOS OS`},
            version {`1.0.0`},
            category {`Web OS`},
            subcategory {`Web5 / WebAI`},
            description {`A Web 5.0 and Web AI Kernel for decentralized web and IoT applications`},
            creator {`Drogidis Christos`},
            website {`https://www.ascoos.com`},
            issues {`https://support.ascoos.com`},
            support {`support@ascoos.com`},
            license {`[Commercial] http://docs.ascoos.com/lics/ascoos/AGL.html`},
            copyright {`Copyright (c) 2007 - 2026, AlexSoft Software.`},
        },
        project {
            package:langs {
                en {`Core utilities and foundational components for ASCOOS OS extensions.`},
                el {`?????? ????????? ???????? ??? ????????? ????????? ??? ?????????? ??? ASCOOS OS.`}
            },
            subpackage:langs {
                en {`Example implementations demonstrating DoBu metadata usage.`},
                el {`???????????? ??????????? ??? ???????????? ?? ????? ????????????? DoBu.`}
            },
            category:langs {
                en {`Object-oriented architecture`},
                el {`?????????????????? ?????????????`}
            },
            subcategory:langs {
                en {`Class structure, metadata, and documentation patterns`},
                el {`???? ???????, ???????????? ??? ??????? ???????????`}
            },
            source {`example2.php`},
            intro:langs {
                en {`This file demonstrates how DoBu metadata can be applied to a simple ASCOOS OS class.`},
                el {`???? ?? ?????? ??????????? ??? ???????????? ?? ???????????? DoBu ?? ??? ???? ????? ??? ASCOOS OS.`}
            },
            summary:langs {
                en {`Defines a minimal example class with full DoBu metadata for documentation and tooling.`},
                el {`?????? ??? ???????? ????? ????????????? ?? ????? ???????????? DoBu ??? ?????????? ??? ????????.`}
            },
            description:langs {
                en {`This example provides a reference implementation of DoBu metadata for files, classes, and methods. It is intended as a template for developers creating ASCOOS OS components with deterministic documentation structures.`},
                el {`???? ?? ?????????? ??????? ??? ?????????? ????????? ????????????? DoBu ??? ??????, ??????? ??? ????????. ??????????? ?? ??????? ??? ??????????????? ??? ??????????? ????????? ??? ASCOOS OS ?? ???????????????? ????? ???????????.`}
            },
            fileNo {`FILE-ID`},
            version {`1.0.0`},
            build {`1`},
            created {`2026-05-07 17:10:59`},
            updated {`2026-05-07 17:10:59`},
            author {`AUTHOR NAME`},
            authorSite {`https://www.example.com`},
            support {`support@example.com`},
            license {`Freeware`},
            since {`1.0.0`},
            sincePHP {`8.4.0`}
        }
    }
}
*/
declare(strict_types=1);
namespace
ASCOOS\OS\Extras\NAMESPACE;
defined("ALEXSOFT_RUN_CMS") or die("Prohibition of Access.");
defined("ASCOOS_OS_RUN") or die("Prohibition of Access.");

use
ASCOOS\OS\Kernel\Core\TObject;

/*
dobu {
    class:id(`tmyclass`),name(`TMyClass`),extends(`TObject`)namespace(`ASCOOS\OS\Extras\NAMESPACE`),hierarchy(`TObject, TMyClass`),version(`1.0.0`),build(`1`),created(`2026-05-07 17:14:54`),updated(`2026-05-07 17:14:54`),since(`1.0.0`),sincePHP(`8.4.0`),license(`Freeware`),difficulty(`1`) {
        category:langs {
            en {`Core example class`},
            el {`???????? ????? ?????????????`}
        },
        intro:langs {
            en {`A minimal demonstration class used to showcase DoBu metadata capabilities.`},
            el {`??? ???????? ????? ????????? ??? ??????????? ??? ??????????? ??? ????????????? DoBu.`}
        },
        summary:langs {
            en {`Provides a simple object with constructor and singleton-style instance retrieval.`},
            el {`??????? ??? ???? ??????????? ?? constructor ??? ???????? ????????? ????? singleton.`}
        },
        desc:langs {
            en {`This class serves as a reference implementation for developers who want to understand how DoBu metadata is applied to ASCOOS OS classes. It includes examples of constructors, instance management, and bilingual documentation fields.`},
            el {`???? ? ????? ?????????? ?? ?????????? ????????? ??? ??????????????? ??? ?????? ?? ??????????? ??? ???????????? ?? ???????????? DoBu ?? ??????? ??? ASCOOS OS. ???????????? ???????????? constructor, ??????????? ????????? ??? ????????? ?????? ???????????.`}
        },
        properties:active(`table:{name,access,type,default,langs}`) {
            property:id(`properties`),name(`$properties`),access(`protected`),type(`array`)default(`[]`) {
                langs {
                    en {`An associative array of properties to initialize the class with.`},
                    el {`???? ????????????? ??????? ????????? ??? ??? ???????????? ??? ??????.`}
                },
                keys:active(`dl`) {
                    key:name(`version`),value(`10000`),langs {
                        en {`Class Version`},
                        el {`?????? ??????`}
                    },
                },
            },
        },
        methods:active(`idx,toc`) {
            method:id(`construct`),name(`__construct`),syntax(`__construct(array properties = [])`),return(`void`),langs {
                en {`Initializes the class with an array of optional properties.`},
                el {`??????????? ??? ????? ?? ???? ?????? ??? ???????????? ?????????.`}
            },
            method:id(`getinstance`),name(`getInstance`),syntax(`&getInstance(array properties = []): TMyClass`),return(`TMyClass&`),langs {
                en {`We see if the object is already loaded, otherwise we create a new load of the object`},
                el {`???????? ??? ??????? ??? ????????? ?? ??????????? ?????? ???????????? ??? ??? ??????? ??? ????????????`}
            }
        },
        examples:type(`inline`) {
            example:type(`pre,code`),pl(`php`),langs {
                all {`$object = new TMyClass(['key' => 'value']);`}
            }
        }
    }
}
*/
#[\AllowDynamicProperties]
class TMyClass extends TObject
{

   
/*
    dobu {
        method:classid(`tmyclass`),id(`construct`),name(`__construct`),syntax(`__construct(array $properties = [])`),return(`void`),version(`1.0.0`),build(`1`),created(`2026-05-07 17:16:35`),updated(`2026-05-07 17:16:35`),since(`1.0.0`),sincePHP(`8.4.0`),license(`Freeware`),difficulty(`1`) {
            category:langs {
                en {`Object initialization`},
                el {`???????????? ????????????`}
            },
            intro:langs {
                en {`Initializes the object and forwards properties to the parent constructor.`},
                el {`??????????? ?? ??????????? ??? ??????? ??? ????????? ???? constructor ??? ??????? ??????.`}
            },
            summary:langs {
                en {`Initializes the class with an array of optional properties.`},
                el {`??????????? ??? ????? ?? ???? ?????? ??? ???????????? ?????????.`}
            },
            desc:langs {
                en {`This constructor accepts an array of properties and delegates initialization to TObject. It demonstrates how DoBu metadata documents method behavior and return types.`},
                el {`? constructor ??????? ???? ?????? ????????? ??? ???????? ??? ???????????? ???? TObject. ??????????? ??? ?? ???????????? DoBu ???????????? ?? ??????????? ??? ???? ?????? ?????????? ???? ???????.`}
            },
            params:active(`table:{name,type,langs,default}`) {
                param:id(`$properties`),name(`$properties`),type(`array`),default(`[]`),langs {
                    en {`An associative array of properties to initialize the class with.`},
                    el {`???? ????????????? ??????? ????????? ??? ??? ???????????? ??? ??????.`}
                }
            },
            examples:type(`link`) {
                link(`Example Link`),langs {
                    en {`Description of the example link in English`,
                    el {`????????? ??? ????????? ????????????? ??? ????????`}
                },
                example:type(`pre,code`),pl(`php`),langs {
                    all {`$object = new TMyClass(['key' => 'value']);`}
                }
            },
            return:type(`void`),langs {
                en {`It doesn't return anything.`},
                el {`??? ?????????? ??????.`}
            },
            throws:types(`none`),langs {
                en {`It does not implement any exceptions.`},
                el {`??? ???????? ????? ????????.`}
            }
        }
    }
    */
   
public function __construct(array $properties = [])
    {
       
parent::__construct($properties);
    }

   
   
/*
    dobu {
        method:classid(`tmyclass`),id(`getinstance`),name(`getInstance`),syntax(`&getInstance(array $properties = []): TMyClass`),return(`TMyClass&`),version(`1.0.0`),build(`1`),created(`2026-05-07 17:21:14`),updated(`2026-05-07 17:21:14`),since(`1.0.0`),sincePHP(`8.4.0`),license(`Freeware`),difficulty(`1`) {
            category:langs {
                en {`Singleton instance retrieval`},
                el {`???????? ????????? ?????????`}
            },
            intro:langs {
                en {`Returns a reference to the single instance of the class.`},
                el {`?????????? ??????? ??? ???????? ???????? ??? ??????.`}
            },
            summary:langs {
                en {`We see if the object is already loaded, otherwise we create a new load of the object`},
                el {`???????? ??? ??????? ??? ????????? ?? ??????????? ?????? ???????????? ??? ??? ??????? ??? ????????????`}
            },
            desc:langs {
                en {`Implements a simple singleton pattern using a static variable. If the instance does not exist, it is created with the provided properties.`},
                el {`???????? ??? ???? ?????? singleton ??????????????? ??? static ?????????. ?? ? ???????? ??? ???????, ????????????? ?? ??? ??????????? ?????????.`}
            },
            params:active(`table:{name,type,langs,default}`) {
                param:id(`$properties`),name(`$properties`),type(`array`),default(`[]`),langs {
                    en {`Parameter description in English`},
                    el {`????????? ?????????? ??? ????????`}
                }
            },
            examples:type(`link`) {
                link(`Example Link`),langs {
                    en {`Description of the example link in English`,
                    el {`????????? ??? ????????? ????????????? ??? ????????`}
                },
                example:type(`pre,code`),langs {
                    all {`$instance = TMyClass::getInstance(['initialized' => true]);`}
                }
            },
            return:type(`TMyClass&`),langs {
                en {`Reference to the singleton instance.`},
                el {`??????? ??? ???????? ???????? ??? ??????.`}
            },
            throws:types(`none`),langs {
                en {`It does not implement any exceptions.`},
                el {`??? ???????? ????? ????????.`}
            }
        }
    }
    */
   
public function &getInstance(array $properties = []): TMyClass
   
{
        static
$instance;
        if (!
is_object($instance)) $instance = new TMyClass($properties);
        return
$instance;
    }
}
?>


Details

DoBu Logo

Ascoos DoBu Helper

Official VS Code Snippet Extension for DoBu ? Documentation Builder for Ascoos OS

VS Code Version License: AGL GitHub Downloads (all assets, all releases) GitHub Release GitHub Release Date GitHub repo size

Ascoos DoBu Helper is the official snippet package for DoBu inside Visual Studio Code.

It allows you to quickly and correctly create DoBu documentation blocks in PHP, CSS, JavaScript, C++ and other languages.

What is DoBu?

DoBu (DOcumentation BUilder) is a Documentation DSL specifically designed for the Ascoos OS ecosystem.

It is a semantic documentation layer that lives inside simple docblocks and supports multilingual metadata, mathematical formulas, behavioral descriptions, export to multiple formats, and much more.

Read the official DoBu README for more details.

Key Features

  • Over 40 ready-made snippets for DoBu syntax
  • Support for PHP ? CSS ? JavaScript ? C++ ? Plaintext
  • Full File Skeleton with Ascoos OS branding
  • Ready templates for classes, methods, properties, constants, parameters, formulas, etc.
  • Multilingual blocks (`en` / `el`)
  • Automatic filling of dates, filenames, namespaces, etc.

Installation

The extension is currently distributed only as a VSIX file.

Download & Install

  1. Go to the Releases page
  2. Download the latest `ascoos-dobu-helper-x.x.x.vsix` (or newer)
  3. Open Visual Studio Code
  4. Go to the Extensions view (`Ctrl+Shift+X`)
  5. Click on the ... in the top right ? Install from VSIX...
  6. Select the downloaded `.vsix` file

> Tip: After the first release, you can also install it directly from the VS Code Marketplace (coming soon).

How to Use

Simply type one of the following prefixes and press Tab:

Basic & Useful Snippets

| Prefix | Description | |-------------------------------------|--------------------------------------------------------| | @dobu-file-skeleton | Full DoBu File Skeleton | | php-dobu-file-skeleton | Full PHP file with DoBu header (recommended) | | @dobu-class-skeleton | Class skeleton with methods | | @dobu-class-method | Single method inside a class | | @dobu-docblock-skeleton | Basic DoBu dockblock | | @dobu-skeleton-ascoos | Ascoos OS block | | @dobu-skeleton-project | Project block | | @dobu-skeleton-license | License selection | | @dobu-skeleton-author | Author information |

Multilingual & Descriptive Snippets

  • `@dobu-intro` ? Introduction
  • `@dobu-summary` ? Summary
  • `@dobu-desc` ? Detailed description
  • `@dobu-category` / `@dobu-subcategory`
  • `@dobu-params-method-skeleton` ? Method parameters
  • `@dobu-return-method` ? Return value
  • `@dobu-throws` ? Exceptions
  • `@dobu-formula` ? Mathematical formula (LaTeX / MathML)

Tip: Type @dobu to see all available snippets at once.

Examples

Example: License Selection

When using snippets that contain a license field, a ready dropdown appears with all available Ascoos OS licenses:

License Selection

Example: Full PHP File Skeleton

By typing php-dobu-file-skeleton and pressing Tab, a complete file skeleton is automatically inserted:

Namespace class type selection

<?php
/*
dobu {
    file:id(`FILE-ID`),name(`${TM_FILENAME_BASE}`) {
        ascoos { ... },
        project { ... }
    }
}
*/
declare(strict_types=1);
namespace ASCOOS\OS\...;
defined("ALEXSOFT_RUN_CMS") or die("Prohibition of Access.");
...
?>

Namespace class type selection

Example: Adding a Method to a Class

method:id(`myMethod`),name(`myMethod`),syntax(`myMethod(string $param)`),return(`bool`),langs {
    en {`Description in English`},
    el {`????????? ??? ????????`}
},

Links

Author

Christos Drogidis Ascoos OS Team

License

This extension is distributed under the AGL (Ascoos General License).

See details here: http://docs.ascoos.com/lics/ascoos/AGL.html


  Files folder image Files (13)  
File Role Description
Files folder imageimages (1 file)
Files folder imagesnippets (1 file)
Accessible without login Plain text file CHANGELOG.md Data Auxiliary data
Accessible without login Plain text file CITATION-EL.cff Data Auxiliary data
Accessible without login Plain text file CITATION.cff Data Auxiliary data
Accessible without login Plain text file example.php Example Class source
Accessible without login Plain text file example2.php Example Class source
Accessible without login Plain text file LICENSE-EL.md Lic. License text
Accessible without login Plain text file LICENSE.md Lic. License text
Accessible without login Plain text file package-lock.json Data Auxiliary data
Accessible without login Plain text file package.json Data Auxiliary data
Accessible without login Plain text file README-EL.md Doc. Documentation
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files (13)  /  images  
File Role Description
  Accessible without login Image file icon.png Icon Icon image

  Files folder image Files (13)  /  snippets  
File Role Description
  Plain text file dobu.json Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads  
 100%
Total:0
This week:0