devdrawer/tutorial

This is a sample composer package tutorial.

Installs: 15

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

Type:project

pkg:composer/devdrawer/tutorial

1.0.0 2023-03-09 18:30 UTC

This package is auto-updated.

Last update: 2026-01-10 00:43:09 UTC


README

Learn how to create your own composer project to quickly reuse or release your code. In this tutorial, we will go over creating a composer project, creating a GitHub repo for it, and publishing it to Packagist.

License

OSL - Open Software Licence 3.0

Sample Code

Add the following code to your php file and you should see the ClassName output of "Hello World".

<?php

require_once 'vendor/autoload.php';

new \DevDrawer\Tutorial\ClassName();

To run your tests, make sure you have phpunit installed or run composer install. I have added a composer phpunit to this project so you can test it with only these files.

composer require phpunit/phpunit
php vendor/phpunit/phpunit/phpunit tests/ClassNameTest.php