# Review the Prefixed PHP Project

The results of the prefixing process of the project can be found in this repository: https://github.com/PHP-Prefixer/hello-joomla-world_prefixed (opens new window)

# The New Composer.json of the Prefixed Joomla module

The PHP-Prefixed process has produced a new composer.json schema and contains the original files, and files that are re-organized according to the applied PPP prefix.

    "name": "php-prefixer/hello-prefixed-world-for-joomla",
    "description": "Hello Prefixed World module for Joomla. A module to showcase the PHP-Prefixer service. Install any library freely. PHP-Prefixer will manage your namespaces.",
    "autoload": {
        "classmap": [
        "files": [

The files of the dependencies are stored in the vendor_prefixed folder. composer.json declares them in the classmap and files attributes to generate the autoloader.

No conflict will be found, if there were others modules installed using the Carbon, Doctrine, Illuminate or Symfony namespaces.

# The Prefixed Module

The project file src\Helper.php has been processed, and the prefix PPP added to the Carbon dependency call:

// The modified version of the Hello World module shows a formatted date before the message
use PPP\Carbon\Carbon;

class Helper
     * Retrieves the hello message
     * @param   array  $params An object containing the module parameters
     * @access public
    public static function getHello($params)
        $now = Carbon::now();
        $formattedDate = $now->toDateTimeString();

        return $formattedDate.' / Hello, World!';

# The Prefixed Dependencies

The original libraries installed in the vendor folder have been prefixed and updated. These are a few examples:

# The Prefixed Doctrine Inflector

<?php /* This file has been prefixed by <PHP-Prefixer> for "Hello Prefixed World for Joomla" */


namespace PPP\Doctrine\Inflector;

use RuntimeException;
use function chr;
use function function_exists;
use function lcfirst;
use function mb_strtolower;
use function ord;
use function preg_match;
use function preg_replace;
use function sprintf;
use function str_replace;
use function strlen;
use function strtolower;
use function strtr;
use function trim;
use function ucwords;

class Inflector

# The Prefixed Laravel Support Helpers

/* This file has been prefixed by <PHP-Prefixer> for "Hello Prefixed World for Joomla" */

use PPP\Illuminate\Contracts\Support\DeferringDisplayableValue;
use PPP\Illuminate\Contracts\Support\Htmlable;
use PPP\Illuminate\Support\Arr;
use PPP\Illuminate\Support\Env;
use PPP\Illuminate\Support\HigherOrderTapProxy;
use PPP\Illuminate\Support\Optional;

if (! function_exists('PPP_append_config')) {
     * Assign high numeric IDs to a config item to force appending.
     * @param  array  $array
     * @return array
    function PPP_append_config(array $array)
        $start = 9999;

        foreach ($array as $key => $value) {
            if (is_numeric($key)) {

                $array[$start] = Arr::pull($array, $key);

        return $array;
if (! function_exists('PPP_env')) {
     * Gets the value of an environment variable.
     * @param  string  $key
     * @param  mixed  $default
     * @return mixed
    function PPP_env($key, $default = null)
        return Env::get($key, $default);

# The Prefixed Carbon Library

/* This file has been prefixed by <PHP-Prefixer> for "Hello Prefixed World for Joomla" */

 * This file is part of the Carbon package.
namespace PPP\Carbon;

use PPP\Carbon\Traits\Date;
use DateTime;
use DateTimeInterface;
use DateTimeZone;

 * A simple API extension for DateTime.
class Carbon extends DateTime implements CarbonInterface
    use Date;

     * Returns true if the current class/instance is mutable.
     * @return bool
    public static function isMutable()
        return true;

# The Polyfills

The Polyfills libraries are excluded from processing by the prefixer.

// vendor_prefixed/symfony/polyfill-php80/Resources/stubs/Stringable.php
interface Stringable
     * @return string
    public function __toString();

# The Prefixed Portable ASCII

<?php /* This file has been prefixed by <PHP-Prefixer> for "Hello Prefixed World for Joomla" */


namespace PPP\voku\helper;

 * @psalm-immutable
final class ASCII

# Conclusion

In this guide, we presented a simple Joomla module Hello Prefixed World module for Joomla.

The module is based on the Hello World (opens new window) module. To integrate a Composer dependency, we install the Laravel illuminate/support (opens new window) library and use it to show a formatted date before the Hello World message.

In the guide, we introduced the original project, the prefixed project, and the different prefixing cases. These have been successfully processed to produce a complete functional module, ready to be distributed and installed.