PHPackages                             conquerorsoft/my\_first\_library - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. conquerorsoft/my\_first\_library

ActiveLibrary

conquerorsoft/my\_first\_library
================================

This is my very first library created with composer init

v1.0.0(8y ago)18121MITPHPPHP ~5.6 || ~7.0

Since Nov 4Pushed 8y ago1 watchersCompare

[ Source](https://github.com/ConquerorSoft/my_first_library)[ Packagist](https://packagist.org/packages/conquerorsoft/my_first_library)[ Docs](http://www.conquerorsoft.com/my_first_library)[ RSS](/packages/conquerorsoft-my-first-library/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (16)Used By (1)

My First Library
================

[](#my-first-library)

[![Build Status](https://camo.githubusercontent.com/6fc82236a263ac571c8227c3208f98335508248bc392cbe89fc02c4e5e87ae9d/68747470733a2f2f7472617669732d63692e6f72672f436f6e717565726f72536f66742f6d795f66697273745f6c6962726172792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/ConquerorSoft/my_first_library) [![Software License](https://camo.githubusercontent.com/f251623e510f5909f16ae3f4e6e548dac11340b9fde1a99be26b015b39272c00/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c6174)](LICENSE.md) [![Coverage Status](https://camo.githubusercontent.com/53d51eb9921a7046818221bb89be4398d11d9f19c74bfc6b5cd67da009ca2f3a/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f636f6e717565726f72736f66742f6d795f66697273745f6c6962726172792e7376673f7374796c653d666c6174)](https://scrutinizer-ci.com/g/conquerorsoft/my_first_library/code-structure) [![Quality Score](https://camo.githubusercontent.com/88e400402d5232ff2709e137ac83e6994f1e6214ded86f2e2df565ea7ad8912b/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f636f6e717565726f72736f66742f6d795f66697273745f6c6962726172792e7376673f7374796c653d666c6174)](https://scrutinizer-ci.com/g/conquerorsoft/my_first_library) [![Latest Version on Packagist](https://camo.githubusercontent.com/98945ac2f850e4c3b440d379249c9a9b78870691da7082bb7cb3d3e9dd1072e7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f6e717565726f72736f66742f6d795f66697273745f6c6962726172792e7376673f7374796c653d666c6174)](https://packagist.org/packages/conquerorsoft/my_first_library)

This is my very first library I created at php\[world\]. I learned that I have to create a README file to provide a description of my library so it can be used by other projects or persons.

### The steps to create "my first library"

[](#the-steps-to-create-my-first-library)

1- create the my\_first\_library directory

```
cd ~ && mkdir -p phplibrary/my_first_library && cd phplibrary/my_first_library

```

2- create a README.md file

```
vim README.md

```

3- initialize a git repository

```
git init

```

4- Do the first commit

```
git add .
git commit -m "First commit of my library"

```

5- Assign a version to your library

```
git tag -a v0.1.0 -m "version 0.1.0"

```

6- Create a repository in github or bitbucket 7- Connect your repository with github (or bitbucket)

```
git remote add origin https://github.com/ConquerorSoft/my_first_library.git
git push -u origin master
git push origin v0.1.0

```

8- run composer init

```
composer init

```

9- enter all the information asked by composer init

```
Package name (/) [gabriel/my_first_library]: conquerorsoft/my_first_library
Description []: This is my very first library created with composer init
Author [Christian Varela , n to skip]: Christian Varela
Minimum Stability []: stable
Package Type (e.g. library, project, metapackage, composer-plugin) []: library
License []: MIT

Define your dependencies.

Would you like to define your dependencies (require) interactively [yes]? no
Would you like to define your dev dependencies (require-dev) interactively [yes]?
Search for a package: phpunit

Found 15 packages matching phpunit

   [0] phpunit/phpunit
   [1] mockery/mockery
   [2] phpunit/phpunit-mock-objects
   [3] phpunit/php-timer
   [4] phpunit/php-code-coverage
   [5] phpunit/phpunit-selenium
   [6] brianium/paratest
   [7] phpunit/php-token-stream
   [8] phpunit/php-text-template
   [9] phpunit/php-file-iterator
  [10] mybuilder/phpunit-accelerator
  [11] johnkary/phpunit-speedtrap
  [12] symfony/phpunit-bridge
  [13] nette/tester
  [14] gecko-packages/gecko-php-unit

Enter package # to add, or the complete package name if it is not listed: 0
Enter the version constraint to require (or leave blank to use the latest version): ^5.7
Using version ^5.7 for phpunit/phpunit
Search for a package:

{
    "name": "conquerorsoft/my_first_library",
    "description": "This is my very first library created with composer init",
    "type": "library",
    "require-dev": {
        "phpunit/phpunit": "^5.7"
    },
    "license": "MIT",
    "authors": [
        {
            "name": "Christian Varela",
            "email": "cvarela@conquerorsoft.com"
        }
    ],
    "minimum-stability": "stable",
    "require": {}
}

Do you confirm generation [yes]?
Would you like the vendor directory added to your .gitignore [yes]?

```

10- composer.json file is created, commit to git

```
git add .
git commit -m "Composer init"
git tag -a v0.1.1 -m "version 0.1.1"
git push -u origin master
git push origin v0.1.1

```

11- Run composer install

```
composer install

```

12- Add composer.lock to .gitignore

```
echo "composer.lock" >> .gitignore

```

13- create a Changelog file ( this format is recommended: [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) )

```
vim CHANGELOG.md

```

14- commit to git

```
git add .
git commit -m "Changelog file added"
git tag -a v0.1.2 -m "version 0.1.2"
git push -u origin master
git push origin v0.1.2

```

15- Create structure for starting the development

```
mkdir src && mkdir tests

```

16- Edit the composer.json file to be this way now:

```
{
    "name": "conquerorsoft/my_first_library",
    "description": "This is my very first library created with composer init",
    "keywords": [
        "conquerorsoft",
        "my_first_library",
        "tutorial",
        "phpworld 2017",
        "workshop"
    ],
    "homepage": "http://www.conquerorsoft.com/my_first_library",
    "type": "library",
    "require-dev": {
        "phpunit/phpunit": "^5.7",
        "squizlabs/php_codesniffer": "3.*"
    },
    "license": "MIT",
    "authors": [
        {
            "name": "Christian Varela",
            "email": "cvarela@conquerorsoft.com",
            "homepage": "http://www.conquerorsoft.com/ChristianVarela",
            "role": "Developer"
        }
    ],
    "minimum-stability": "stable",
    "require": {
        "php": "~5.6 || ~7.0"
    },
    "autoload": {
        "psr-4": {
            "conquerorsoft\\my_first_library\\": "src"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "conquerorsoft\\my_first_library\\": "tests"
        }
    },
    "scripts": {
        "test": "phpunit",
        "check-style": "phpcs -p --standard=PSR2 --runtime-set ignore_errors_on_exit 1 --runtime-set ignore_warnings_on_exit 1 src tests",
        "fix-style": "phpcbf -p --standard=PSR2 --runtime-set ignore_errors_on_exit 1 --runtime-set ignore_warnings_on_exit 1 src tests"
    }
}

```

17- Create file phpunit.xml

```
vim phpunit.xml

```

18- add build to .gitignore

```
echo build >> .gitignore

```

19- run composer update

```
composer update

```

20- commit to git

```
git add .
git commit -m "Preparation for development"
git tag -a v0.1.3 -m "version 0.1.3"
git push -u origin master
git push origin v0.1.3

```

21- Add a LICENSE.md file (for this example we chose MIT)

```
vim LICENSE.md

```

22- Create tests/FirstClassTest.php

```
vim tests/FirstClassTest.php

```

23- Create src/FirstClass.php

```
vim src/FirstClass.php

```

24- commit to git

```
git add .
git commit -m "Encode and decode string functionality"
git tag -a v0.1.4 -m "version 0.1.4"
git push -u origin master
git push origin v0.1.4

```

25- docblock everything including classes, files and functions

```
/**
 * This is a summary example
 *
 * This is a description
 *
 * @example this is tag
 */

```

26- commit to git

```
git add .
git commit -m "Docblocks added everywhere"
git tag -a v0.1.5 -m "version 0.1.5"
git push -u origin master
git push origin v0.1.5

```

27- add repository to Travis and create travis configuration file

```
vim .travis.yml

```

28- commit to git

```
git add .
git commit -m "Travis CI integration"
git tag -a v0.1.6 -m "version 0.1.6"
git push -u origin master
git push origin v0.1.6

```

29- change composer.json to change phpunit to version ^5.7

```
vim composer.json

```

30- commit to git

```
git add .
git commit -m "Phpunit version changed to support php version 5.6"
git tag -a v0.1.7 -m "version 0.1.7"
git push -u origin master
git push origin v0.1.7

```

31- Get travis badge and put it in README file

```
vim README.md

```

32- Put license badge in README file 33- commit to git

```
git add .
git commit -m "Travis CI and License badges in README"
git tag -a v0.1.8 -m "version 0.1.8"
git push -u origin master
git push origin v0.1.8

```

34- Create scrutinizer-ci account and link with github 35- Create .scrutinizer.yml file

```
vim .scrutinizer.yml

```

36- Get scrutinizer badges in README file

```
vim README.md

```

37- commit to git

```
git add .
git commit -m "Scrutinizer CI and badges in README"
git tag -a v0.1.9 -m "version 0.1.9"
git push -u origin master
git push origin v0.1.9

```

38- Remove type hinting that is not compatible with php 5.6

```
vim FirstClass.php

```

39- commit to git

```
git add .
git commit -m "Fixes to uncompatible type hinting"
git tag -a v0.1.10 -m "version 0.1.10"
git push -u origin master
git push origin v0.1.10

```

40- apply patch from scrutinizer 41- commit to git

```
git add .
git commit -m "Spacing patch from scrutinizer applied"
git tag -a v0.1.11 -m "version 0.1.11"
git push -u origin master
git push origin v0.1.11

```

42- Create Contributing files

```
vim CONTRIBUTING.md
vim CODE_OF_CONDUCT.md

```

43- Add more sections to README file

- Install
- Usage
- Change log
- Testing
- Contributing
- Security
- Credits
- License

44- commit to git

```
git add .
git commit -m "Improvements to README"
git tag -a v0.1.12 -m "version 0.1.12"
git push -u origin master
git push origin v0.1.12

```

45- Add .gitattributes file to ignore some files or folders when --prefer-dist is used

```
vim .gitattributes

```

46- commit to git

```
git add .
git commit -m ".gitattributes file created"
git tag -a v0.1.13 -m "version 0.1.13"
git push -u origin master
git push origin v0.1.13

```

47- create an account in packagist.org and submit your library using your github repository 48- Make your package in packagist to be autoupdated on push

- Go to your GitHub repository
- Click the "Settings" button
- Click "Integrations &amp; services"
- Add a "Packagist" service, and configure it with your API token, plus your Packagist username
- Check the "Active" box and submit the form

49- Add last version in packagist badge to README.md file

```
vim README.md

```

50- commit to git

```
git add .
git commit -m "Instructions to use packagist.org in README"
git tag -a v0.1.14 -m "version 0.1.14"
git push -u origin master
git push origin v0.1.14

```

51- Create a gh-pages branch

```
git checkout -b gh-pages
git push -u origin gh-pages
git checkout master

```

52- Go to github settings for your repository 53- Choose a theme in GitHub Pages section 54- Your library page is ready now: [https://conquerorsoft.github.io/my\_first\_library/](https://conquerorsoft.github.io/my_first_library/)55- commit to git and increase version

```
git add .
git commit -m "Documentation instructions for the library"
git tag -a v1.0.0 -m "version 1.0.0"
git push -u origin master
git push origin v1.0.0

```

Install
-------

[](#install)

With composer

```
composer require conquerorsoft/my_first_library

```

Usage
-----

[](#usage)

```
$my_first_library = new conquerorsoft\my_first_library\FirstClass();
$encoded_string = $my_first_library->encodeString("Encoding this string");
$decode_string = $my_first_library->decodeString("03wwrwp o0xv v7 or012 y0xsnl2");

```

Change Log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Testing
-------

[](#testing)

```
composer test

```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE\_OF\_CONDUCT](CODE_OF_CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Christian Varela](https://github.com/gabrielconqueror)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 94.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

15

Last Release

3106d ago

Major Versions

v0.1.14 → v1.0.02017-11-10

### Community

Maintainers

![](https://www.gravatar.com/avatar/93d8bdab240bc597b063e912bca26fda6b7deb030e5dfea4932ac7292815a1ad?d=identicon)[gabriel0702](/maintainers/gabriel0702)

---

Top Contributors

[![cvarela0702](https://avatars.githubusercontent.com/u/1228242?v=4)](https://github.com/cvarela0702 "cvarela0702 (17 commits)")[![gabrielconqueror](https://avatars.githubusercontent.com/u/11380286?v=4)](https://github.com/gabrielconqueror "gabrielconqueror (1 commits)")

---

Tags

tutorialworkshopconquerorsoftphpworld 2017my\_first\_library

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/conquerorsoft-my-first-library/health.svg)

```
[![Health](https://phpackages.com/badges/conquerorsoft-my-first-library/health.svg)](https://phpackages.com/packages/conquerorsoft-my-first-library)
```

###  Alternatives

[php-school/learn-you-php

An introduction to PHP's core features: i/o, http, arrays, exceptions and so on.

3192.0k](/packages/php-school-learn-you-php)[php-school/php-workshop

PHP Workshop Framework

466.3k6](/packages/php-school-php-workshop)[macopedia/typo3-interactive-tour

An interactive tour through the TYPO3 backend.

131.8k](/packages/macopedia-typo3-interactive-tour)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
