PHPackages                             pesu/php-makecomment - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. pesu/php-makecomment

ActiveLibrary

pesu/php-makecomment
====================

Build up php comment from a indata text line.

v1.0(10y ago)017-PHPPHP &gt;=5.3.0

Since Nov 22Pushed 10y ago1 watchersCompare

[ Source](https://github.com/pesu12/php-makecomment)[ Packagist](https://packagist.org/packages/pesu/php-makecomment)[ Docs](http://dbwebb.se/)[ RSS](/packages/pesu-php-makecomment/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

PHP MakePhpComment Module
=========================

[](#php-makephpcomment-module)

PHP MakePhpComment Nov 2015

by Per Sundberg
---------------

[](#by-per-sundberg)

Introduction
------------

[](#introduction)

This is a module that uses the framework Anax-MVC Content CTextFilter to format a textstring to a php-comment.

Requirement
-----------

[](#requirement)

This library package requires PHP 5.3 or later.

Usage
-----

[](#usage)

Install the ANAX-MVC from github on address: git clone

Install the module php-makecomment to folder ANAX-MVC\\3pp.

The php-makecomment is meant to be used with class autoloading. Therefore the Anax-MVC\\app\\config\\autoloader.php needs to be updated with: -&gt;addNameSpace('pesu', ANAX\_INSTALL\_PATH . '3pp/php-makecomment/pesu')

The file Anax-MVC\\src\\Content\\CTextFilter.php needs to add after row 'shortcode' =&gt; 'shortCode', with 'phpcomment' =&gt; 'phpcomment',

The file Anax-MVC\\src\\Content\\CTextFilter.php needs to have function added.
/\*\*

- Format text according to comment.
-
- @param string $text the text that should be formatted.
-
- @return string as the formatted html-text. \*/ public function phpcomment($text) { return \\pesu\\MakePhpComment::makephpcomment($text); }

Add following to the ANAX-MVC/webroot/hello\_view.php after $app-&gt;views-&gt;add('welcome/hello\_world'); $app-&gt;router-&gt;add('', function() use ($app) {

```
$content = $app->textFilter->doFilter('Function: Test php comment\n\n@param
 string $text xxxx\n\n@return string text xxxx','shortcode, phpcomment');

$app->views->add('welcome/page', [
    'content' => $content,
]);

```

}); $app-&gt;router-&gt;handle();

To the view file Anax-MVC\\app\\view\\welcome add a file page.tpl.php with content:

Bugs
----

[](#bugs)

To file bug reports please send email to: [sundberg\_p@yahoo.com](mailto:sundberg_p@yahoo.com)

Development and Testing
-----------------------

[](#development-and-testing)

This module has been developed at Blekinge Tekniska Högskola at Karlskrona Sweden and is a part of course DV14886 PHP MVC.

I tested the function with different strings in the hello\_view.php Test 1 with empty string $content = $app-&gt;textFilter-&gt;doFilter('','shortcode, phpcomment'); Result: /\*\* \* \*/

Test 2 with one line string (no \\n) $content = $app-&gt;textFilter-&gt;doFilter('Function: Test php comment','shortcode, phpcomment'); Result: /\*\*

- Function: Test php comment \*/

Test 3 with two line string (one \\n) $content = $app-&gt;textFilter-&gt;doFilter('Function: Test php comment\\n','shortcode, phpcomment'); Result: /\*\*

- Function: Test php comment \*/

Test 4 with three line string (two \\n) $content = $app-&gt;textFilter-&gt;doFilter('Function: Test php comment\\n\\n','shortcode, phpcomment'); Result: /\*\*

- Function: Test php comment
-

\*/

Test 5 with five line strings (four \\n)
$content = $app-&gt;textFilter-&gt;doFilter('Function: Test php comment\\n\\n@param string $text xxxx\\n\\n@return string text xxxx','shortcode, phpcomment');

/\*\*

- Function: Test php comment
-
- @param string $text xxxx
-
- @return string text xxxx \*/

Version History
---------------

[](#version-history)

PHP Markdown Module 1.0.0 (22 Nov 2015)

Copyright and License
---------------------

[](#copyright-and-license)

PHP MakePhpComment Module Copyright (c) 2015 Per Sundberg

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3821d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7dccf8bb59e83d4c8720b331e49ea574a225f3529cf78146292a883eb7dab900?d=identicon)[pesu12](/maintainers/pesu12)

---

Tags

commentcreation

### Embed Badge

![Health badge](/badges/pesu-php-makecomment/health.svg)

```
[![Health](https://phpackages.com/badges/pesu-php-makecomment/health.svg)](https://phpackages.com/packages/pesu-php-makecomment)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
