Composer autoload Class not found in

Viewed 19

I tried to use the autoload, but for some reason it is not working.

<?php

include __DIR__ . '/styles.php';
include_once 'vendor/autoload.php';

use antonio\ClassTest;

$message = new ClassTest();
$message->message();

When I use (the code bellow) instead autoload

include_once 'Teste/teste.php';

It works well

ClassTest is like this

namespace antonio;

class ClassTest {
    public function message(){
        echo "It's a message!";
    }
}

composer.json

{
    "autoload": {
        "psr-4": {
            "antonio\\": "Teste/"
        }
    }
}
0 Answers
Related