I have a small package with 6-7 files (i.e., main class, extending classes, interface, which can be viewed in this link) and I'd like not to use require_once method to connect these classes together.
What might be the correct way to do so?
Attempts
I have tried to add them to vendor directory using composer.
composer require our-new-package-private
and
composer require our-new-package-private ~1.0.0
It returns an error:
[InvalidArgumentException]
Could not find a matching version of package equity-usco. Check the package spelling, your version constraint and that the package is available i
n a stability which matches your minimum-stability (stable).
Questions
Do I need to first push the new package to a private GitHub repo, and then run:
composer require our-new-package-privateWhat might be the correct way to solve this problem and add a new private package or multiple scripts to a PHP-based app? Maybe, I should manually defined it in
autoload=>psr-0orautoload=>psr-4in composer.json?
Currently it's still not possible to create a composer package from a repository subfolder/ (Github Issue)
You can follow this Packagist link to create your own package.