Skip to content

Latest commit

 

History

History
33 lines (25 loc) · 602 Bytes

README.md

File metadata and controls

33 lines (25 loc) · 602 Bytes

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();