keinos / hello-world-tpl
Overly cautious HelloWorld class. See the repo for details.
Installs: 276
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 4
Language:Shell
Requires
- php: ^8.0 || ^7.1
- ext-mbstring: *
Requires (Dev)
- bamarni/composer-bin-plugin: @stable
- humbug/box: @stable
- phan/phan: @stable
- php-coveralls/php-coveralls: @stable
- phpbench/phpbench: @dev
- phpmd/phpmd: @stable
- phpstan/extension-installer: @stable
- phpstan/phpstan: @stable
- phpunit/phpunit: @stable
- psalm/phar: 4.1.1
- squizlabs/php_codesniffer: @stable
- dev-master
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.1
- 1.1.0
- 1.0.39
- 1.0.38
- 1.0.37
- 1.0.36
- 1.0.35
- 1.0.34
- 1.0.33
- 1.0.32
- 1.0.31
- 1.0.30
- 1.0.29
- 1.0.28
- 1.0.27
- 1.0.26
- 1.0.25
- 1.0.24
- 1.0.23
- 1.0.22
- 1.0.21
- 1.0.20
- 1.0.19
- 1.0.18
- 1.0.17
- 1.0.16
- 1.0.15
- 1.0.14
- 1.0.13
- 1.0.12
- 1.0.11
- 1.0.10
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
This package is auto-updated.
Last update: 2024-10-29 05:53:20 UTC
README
Super cautious "Hello-World"
This repo is an overly-cautious Hello-World PHP script for fun. It includes the following tests and CIs to just say "Hello-World!".
Tests
- Supported PHP Version to test
- PHP v7.1, 7.2, 7.3, 7.4, 8.0 (, nightly)
- Details see: .travis.yml
- Note: The nightly build version (PHP8-dev) might fail in TravisCI.
- Unit Test & Code Coverage
- Coding Standard Compliance
- PHP_CodeSniffer (PSR-2, PSR-12)
- PHP Mess Detector (Avoid complexity)
- PHP Static Analysis
- Benchmark
- Docker for Local Testing
- Details see: docker-compose.yml
CIs Used
This repo uses the following CIs. On your use, register your repo first.
- TravisCI: Used for running tests.
- COVERALLS: Used for code coverage.
- Scrutinizer CI: Used for code quality.
Using this package as a template/boilerplate
How to
How to use it as a template
TL; DR
Copy, initialize the project, smoke test, add CI's ACCESS TOKEN then you're redy-to-go!
TS; DR
-
Create a new copy.
Choose one of the below commands that suits you.
- Note that you need to specify your project's name. This will be your "package name" as well.
# For composer user with NO Docker composer create-project keinos/hello-world-tpl MyNewProject cd MyNewProject
# For Docker and docker-compose user (No PHP nor composer user) git clone https://github.com/KEINOS/TPL-PHP-HelloWorld.git MyNewProject cd MyNewProject
-
Initialize.
Run the command below to initialize your project. This will re-write the package and vendor names to the provided name. (Ex. MyVendorName)
rm -rf .git git init ./.devcontainer/initialize_package.php MyVendorName
-
Functioning test.
Before anything, run the tests to check it's basic test functionality.
composer test -- --all --verbose
-
Initial commit.
Commit your first change.
git add . git commit -m 'initial commit'
-
Push the repo to GitHub then register it to the following CIs.
-
Re-name
COVERALLS.env.sample
toCOVERALLS.env
under./tests/conf
. -
Get your access token from COVERALLS' settings and place/replace the token value in
COVERALLS.env
. -
Run tests again to see COVERALLS' function-ability.
-
If the local test passes then commit changes and push.
-
If the tests passes on CIs then start building your project.
Developing via Docker
This repo can be developed via Docker. Run:
composer dev
Or, if you use Visual Studio Code (a.k.a. VS Code) and have Docker, then "Remote - Containers" extension is available.
In this case, you don't need to install the packages or even PHP on your local env.
- Install Microsoft's "Remote - Containers" extension to your VS Code.
git clone
this repo to your local.- Remove the
.git
directory and initialize as a new one bygit init
. - Open folder in a Container by: F1 -> "Remote-Containers: Reopen in Container".
Credit
This repo was very much inspired by:
- このPHPがテンプレートエンジンのくせに慎重すぎる @ Qiita