We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Overwrite class in vendor

I would like to fix some issues that i have with the Phalcon\Config class and add that to the Incubator. The problem i have is that i cant find a simple way to overwrite the class.

As far i know i cannot just use the same namespace Phalcon and create a class Config because class Config extends Config ...

// composer.json
// ... 
"autoload": {
    "psr-4": {
        "Phalcon\\": "src/"
    }
},
// ...

// src/Config.php
namespace Phalcon;

class Config extends \Phalcon\Config
{
}

... well class should not extend it self :D

So i think this gona be a "second" Config class in namespace Phalcon\Config? Or is there another chance to get this working?

It's not phalcon issue, you can't extend same class with same class in any language. Just put it to other namespace like for example namespace Cotton