https://github.com/crazyfactory/php-package-boilerplate
https://github.com/crazyfactory/php-package-boilerplate
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/crazyfactory/php-package-boilerplate
- Owner: crazyfactory
- Created: 2018-07-26T07:50:58.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-10-30T12:19:21.000Z (over 7 years ago)
- Last Synced: 2025-02-16T15:31:24.805Z (over 1 year ago)
- Language: PHP
- Size: 165 KB
- Stars: 0
- Watchers: 10
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PHP Package Boilerplate [](https://travis-ci.com/crazyfactory/php-package-boilerplate)
Use this project as a starting point for PHP packages.
## Requirements
- php: *>7.1*
- composer installed
## Startup Steps
- Clone to your localhost `git clone https://github.com/crazyfactory/php-package-boilerplate NEW_PACKAGE_NAME`
- Remove `src/Example.php` and `tests/unit/ExampleTest.php`
- Adjust `composer.json`:
- `name`: _NEW_PACKAGE_NAME_
- `autoload` and `autoload-dev` _NEW_PACKAGE_NAMESPACE_
- `phpunit` or `codeception` for testing? Set dependencies here
- Adjust `README.md`:
- set package name
- set Travis CI badge
- add description what this project is about
- add Requirements (PHP version, composer, ...)
- add example usage
- Run `composer install`
- Switch to your new remote
```bash
rm -rf .git
git init
git add .
git commit -m "feat(All): Start"
git remote add origin
git push -u --force origin master
```
- check the repo _SETTINGS_ > _collaborators & teams_: **SuperAdmins** have _Admin_ rights, **Developers** have _Write_ access
## Scripts
Run Tests
```bash
composer test
```
Run Tests with code coverage
```
composer test:coverage
```
Lint
```bash
composer lint
```
Run linting with auto-fix
```
composer lint:fix
```