Symfony 5 and customer github package

I am learning how to create my first composer package.
To achieve that, I created the following public repository on my GH: https://github.com/Alphabetus/alpha-logger.

I managed to successfully install my package on a project but when i try to call the class from the package i get the following error:
Output Error

The package code is public as mentioned, am i assigning the namespace wrong?
On the test project I have the following:

  • composer.json:
[...]
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/Alphabetus/alpha-logger"
        }
    ],
[...]
"require": {
    [...]
    "alphabetus/alpha-logger": "dev-master"
}

The composer update command goes OK and i can see my own package on vendor/alphabetus/AlphaLogger

On my controller Im trying to call my logger class like this:

  • PageController.php
use AlphaLoggerLogger as Logger;
[...]

public function index(... ...)
{
    $l = new Logger();
    $l->test();
}

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *