Skip to content

girorme/composer-autoload-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Composer autoload - PSR4

Blog Post

autoload-php-utilizando-composer

Usage:

$ composer dump-autoload
$ php index.php

Final index code:

<?php

require_once __DIR__ . '/vendor/autoload.php';

use App\Battle;
use App\Char\{Ryu, Ken};
use App\Attributes\{Hadouken, Shoryuken};

$hadouken = new Hadouken();
$ryu = new Ryu($hadouken);

$shoryuken = new Shoryuken();
$ken = new Ken($shoryuken);

$battle = new Battle('Street Fighter!');
$battle->addChar($ryu);
$battle->addChar($ken);
$battle->start();

About

Example project used in the blog

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages