Using git repositories as composer libraries

Composer allows you to use git repositories as composer libraries.  Just add your a reference to your git repository in the repositories section of your composer.json file:

"repositories": [
  {
    "type": "vcs",
    "url": "https://gitlab.com/bmosher/testpkg"
  }
],

Then require your library:

$ composer require bmosher/testpkg

This will result in your library being available:

<?php

require "vendor/autoload.php";

use bmosher\testpkg\Test;

$test = new Test();
$test->hello();
$ php test.php
Hello World