tomyue / say-hello
This is a test composer
Installs: 20
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
pkg:composer/tomyue/say-hello
Requires
- php: ^5.3.3 || ^7.0
This package is auto-updated.
Last update: 2025-12-14 15:34:30 UTC
README
This is a test composer
Installation
Require this package with composer. It is recommended to only require the package.
composer require tomyue/say-hello
Usage
use Say\Hello; $hello = new Hello(); echo $hello->say("Hello World\n");
Initialize package
composer init
This will run you through a bunch of questions: name, description, license, etc.
Write some code
Start coding by creating the file src/Hello.php.
<?php namespace Say; class Hello { public function say($toSay = 'Nothing given') { return $toSay; } }
Edit composer.json
{
"name": "tomyue/say-hello",
"type": "library",
"description": "This is a test composer",
"license": "MIT",
"authors": [
{
"name": "tomyue",
"email": "yue.kun.ting@gmail.com"
}
],
"minimum-stability": "dev",
"autoload": {
"psr-4": {
"Say\\": "src/"
}
},
"require": {
"php": "^5.3.3 || ^7.0"
}
}
validate your composer.json
composer validate
Add .gitignore
vendor
composer.lock
Install dependencies
composer install
Testing
Create a tests/test.php to it with the following contents.
<?php require_once __DIR__.'/../vendor/autoload.php'; use Say\Hello; $hello = new Hello(); echo $hello->say("Hello World\n");
Run test.php
php tests/test.php