# 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-wp-world_prefixed (opens new window)

# The New Composer.json of the Prefixed WordPress Plugin

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-wp",
    "description": "Hello Prefixed World plugin for WordPress. A plugin 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 conflicts will be found if other plugins were installed using the Carbon, Doctrine, Illuminate or Symfony namespaces.

# The Prefixed Plugin

The project file hello.php has been processed and the prefix PPP added to the Carbon dependency call:

// The modified version of the Hello Dolly plugin shows a formatted date before the lyrics
$now = \PPP\Carbon\Carbon::now();
$formattedDate = $now->toDateTimeString();

# 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 WordPress" */


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 WordPress" */

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 WordPress" */

 * 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 FIG Standards and Polyfills

The libraries defined by the FIG standards and polyfills are excluded from processing by the prefixer.

namespace Psr\Container;

 * Describes the interface of a container that exposes methods to read its entries.
interface ContainerInterface
// 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 WordPress" */


namespace PPP\voku\helper;

 * @psalm-immutable
final class ASCII

# Conclusion

In this guide, we presented a simple WordPress plugin Hello Prefixed World plugin for WordPress.

The plugin is based on the Hello Dolly (opens new window) plugin. 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 Dolly lyrics.

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 function plugin, ready to be distributed and installed.