Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
build:
environment:
php:
version: '7.0'
version: '7.2'
2 changes: 1 addition & 1 deletion .semver
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
:major: 1
:minor: 1
:minor: 2
:patch: 0
:special: ''
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ language: php
sudo: false

php:
- '7.0'
- '7.2'

cache:
directories:
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License

Copyright (c) 2016 CodelyTV. http://codely.tv
Copyright (c) 2018 CodelyTV. https://codely.tv

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
48 changes: 41 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

## Introduction

This is a repository intended to serve as a starting point if you want to bootstrap a project in PHP.
This is a repository intended to serve as a starting point if you want to bootstrap a project in PHP. This repository has been explained in the [CodelyTV video "Introducción a PHP: Cómo configurar tu entorno de desarrollo 🐘" (Spanish)](https://www.youtube.com/watch?v=v2IjMrpZog4).

It could be useful if you want to start from scratch a kata or a little exercise or project. The idea is that you don't have to worry about the boilerplate, just run `composer create-project codelytv/php-bootstrap your-kata-name` and there you go:
* Latest versions of PHP and PHPUnit in order to practice with them
It could be useful if you want to start from scratch a kata or a little exercise or project. The idea is that you don't have to worry about the boilerplate, just run `composer create-project codelytv/php-bootstrap your-project-name` and there you go:
* Latest versions of PHP and PHPUnit
* Best practices applied:
* [`README.md`][link-readme] (badges included)
* [`LICENSE`][link-license]
Expand All @@ -25,13 +25,47 @@ It could be useful if you want to start from scratch a kata or a little exercise

## How To Start

You have 2 different alternatives: Using our [Packagist project](https://packagist.org/packages/codelytv/php-bootstrap) with Composer, or manually cloning [this repo](https://github.com/CodelyTV/php-bootstrap/):

### Using Composer

Start completely from scratch without having to delete this bootstrap project Git history:

1. If you don't have it already, [install Composer](https://getcomposer.org/download/).
2. Create your project based on this bootstrap repo: `composer create-project codelytv/php-bootstrap your-kata-name`.
3. Run all the checks: `composer test`. This will do some checks that you can perform with isolated commands:
2. Create your project based on the [Packagist project](https://packagist.org/packages/codelytv/php-bootstrap). This will also download the project dependencies: `composer create-project codelytv/php-bootstrap your-project-name`.
3. Move to the project directory: `cd your-project-name`
4. Run all the checks: `composer test`. This will do some checks that you can perform with isolated commands:
1. [PHP Parallel Lint](https://github.com/JakubOnderka/PHP-Parallel-Lint): `composer lint`.
2. [PHP Style Check](https://github.com/squizlabs/PHP_CodeSniffer): `composer style`. If you want to fix style issues automatically: `composer fix-style`.
3. [PHP Unit](https://phpunit.de/): `composer phpunit`.
5. Create your own repository:
1. Initialize your own Git repository: `git init`
2. Add the bootstrap files: `git add .`
3. Commit: `git commit -m "Initial commit with project boilerplate based on https://github.com/CodelyTV/php-bootstrap"`
4. Add your remote repository: `git remote add origin git@github.com:your-username/your-project-name`
5. Upload your local commits to the new remote repo: `git push -u origin master`
6. Start coding!

### Cloning the repository

Just in case you prefer to avoid dealing with `composer create-project`, you can also clone this repository. We recommend to follow the next step by step process in order to avoid adding the bootstrap project commits to your project Git history:

1. Clone this repository: `git clone https://github.com/CodelyTV/php-bootstrap your-project-name`
2. Move to the project directory: `cd your-project-name`
3. If you don't have it already, [install Composer](https://getcomposer.org/download/).
4. Install the project dependencies: `composer install`
5. Run all the checks: `composer test`. This will do some checks that you can perform with isolated commands:
1. [PHP Parallel Lint](https://github.com/JakubOnderka/PHP-Parallel-Lint): `composer lint`.
2. [PHP Style Check](https://github.com/squizlabs/PHP_CodeSniffer): `composer style`. If you want to fix style issues automatically: `composer fix-style`.
3. [PHP Unit](https://phpunit.de/): `composer phpunit`.
4. Start coding!
6. Create your own repository cleaning the bootstrap project history:
1. Remove previous Git history in order to do not add the bootstrap repo noise in your project: `rm -rf .git`
2. Initialize your own Git repository: `git init`
3. Add the bootstrap files: `git add .`
4. Commit: `git commit -m "Initial commit with project boilerplate based on https://github.com/CodelyTV/php-bootstrap"`
5. Add your remote repository: `git remote add origin git@github.com:your-username/your-project-name`
6. Upload your local commits to the new remote repo: `git push -u origin master`
7. Start coding!

## Helpful resources

Expand All @@ -41,7 +75,7 @@ It could be useful if you want to start from scratch a kata or a little exercise
* [Scalar type declarations example](https://github.com/tpunt/PHP7-Reference#scalar-type-declarations)
* [Return type declarations example](https://github.com/tpunt/PHP7-Reference#return-type-declarations)

### PHPUnit 5.5
### PHPUnit

* [Introduction to writing tests for PHPUnit](https://phpunit.de/manual/current/en/writing-tests-for-phpunit.html)
* [Testing exceptions with PHPUnit](https://phpunit.de/manual/current/en/writing-tests-for-phpunit.html#writing-tests-for-phpunit.exceptions)
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@
}
],
"require": {
"php": "^7.0"
"php": "^7.2"
},
"require-dev": {
"jakub-onderka/php-parallel-lint": "^0.9",
"jakub-onderka/php-parallel-lint": "^1.0",
"jakub-onderka/php-console-highlighter": "^0.3",
"squizlabs/php_codesniffer": "^2.7",
"phpunit/phpunit": "^5.7",
"symfony/var-dumper": "^3.2"
"squizlabs/php_codesniffer": "^3.3",
"phpunit/phpunit": "^7.2",
"symfony/var-dumper": "^4.1"
},
"autoload": {
"psr-4": {
Expand Down
Loading