|
1 | | -# PHP Bootstrap (base / project skeleton) |
2 | | - |
| 1 | +# 🐘 PHP Bootstrap (base / project skeleton) |
| 2 | + |
3 | 3 | [![Latest Version on Packagist][ico-version]][link-packagist] |
4 | 4 | [![Software License][ico-license]][link-license] |
5 | | -[![Build Status][ico-travis]][link-travis] |
6 | | -[![Quality Score][ico-code-quality]][link-code-quality] |
| 5 | +[![Build Status][ico-gh-actions]][link-gh-actions] |
7 | 6 | [![Total Downloads][ico-downloads]][link-downloads] |
8 | | - |
9 | | -## Introduction |
10 | 7 |
|
11 | | -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). |
12 | | - |
13 | | -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: |
| 8 | +## Introduction |
| 9 | + |
| 10 | +This is a repository intended to serve as a starting point if you want to bootstrap a project in PHP. This repository |
| 11 | +has been explained in |
| 12 | +the [CodelyTV video "Introducción a PHP: Cómo configurar tu entorno de desarrollo 🐘" (Spanish)](https://www.youtube.com/watch?v=v2IjMrpZog4). |
| 13 | + |
| 14 | +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 |
| 15 | +have to worry about the boilerplate, just run `composer create-project codelytv/php-bootstrap your-project-name` and |
| 16 | +there you go: |
| 17 | + |
14 | 18 | * Latest versions of PHP and PHPUnit |
15 | 19 | * Best practices applied: |
16 | | - * [`README.md`][link-readme] (badges included) |
17 | | - * [`LICENSE`][link-license] |
18 | | - * [`composer.json`][link-composer-json] |
19 | | - * [`phpunit.xml`][link-phpunit] |
20 | | - * [`.gitignore`][link-gitignore] |
21 | | - * [`.editorconfig`][link-editorconfig] |
22 | | - * [`.travis.yml`][link-travis-yml] |
23 | | - * [`.scrutinizer.yml`][link-scrutinizer] |
| 20 | + * [`README.md`][link-readme] |
| 21 | + * [`LICENSE`][link-license] |
| 22 | + * [`composer.json`][link-composer-json] |
| 23 | + * [`ecs.php`](./ecs.php) |
| 24 | + * [`phpunit.xml`][link-phpunit] |
| 25 | + * [`psalm.xml`](./psalm.xml) |
| 26 | + * [`.gitignore`][link-gitignore] |
| 27 | + * [`.editorconfig`][link-editorconfig] |
24 | 28 | * Some useful resources to start coding |
25 | 29 |
|
26 | 30 | ## How To Start |
27 | 31 |
|
28 | | -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/): |
| 32 | +You have 2 different alternatives: Using our [Packagist project](https://packagist.org/packages/codelytv/php-bootstrap) |
| 33 | +with Composer, or manually cloning [this repo](https://github.com/CodelyTV/php-bootstrap/): |
29 | 34 |
|
30 | 35 | ### Using Composer |
31 | 36 |
|
32 | 37 | Start completely from scratch without having to delete this bootstrap project Git history: |
33 | 38 |
|
34 | 39 | 1. If you don't have it already, [install Composer](https://getcomposer.org/download/). |
35 | | -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`. |
| 40 | +2. Create your project based on the [Packagist project](https://packagist.org/packages/codelytv/php-bootstrap). This |
| 41 | + will also download the project dependencies: `composer create-project codelytv/php-bootstrap your-project-name`. |
36 | 42 | 3. Move to the project directory: `cd your-project-name` |
37 | | -4. Run all the checks: `composer test`. This will do some checks that you can perform with isolated commands: |
38 | | - 1. [PHP Parallel Lint](https://github.com/JakubOnderka/PHP-Parallel-Lint): `composer lint`. |
39 | | - 2. [PHP Style Check](https://github.com/squizlabs/PHP_CodeSniffer): `composer style`. If you want to fix style issues automatically: `composer fix-style`. |
40 | | - 3. [PHP Unit](https://phpunit.de/): `composer phpunit`. |
| 43 | +4. Run all the checks: `composer test`. This will do some checks that you can perform with isolated commands: |
| 44 | + 1. [Codely Style](https://github.com/CodelyTV/php-coding_style-codely): `composer lint`. |
| 45 | + 2. [Easy coding standard](https://github.com/easy-coding-standard/easy-coding-standard): `composer style`. If you |
| 46 | + want to fix style issues automatically: `composer lint:fix`. |
| 47 | + 3. [Static Analysis](https://github.com/vimeo/psalm): `composer static-analysis`. |
| 48 | + 4. [PHP Unit](https://phpunit.de/): `composer phpunit`. |
41 | 49 | 5. Create your own repository: |
42 | 50 | 1. Initialize your own Git repository: `git init` |
43 | 51 | 2. Add the bootstrap files: `git add .` |
44 | 52 | 3. Commit: `git commit -m "Initial commit with project boilerplate based on https://github.com/CodelyTV/php-bootstrap"` |
45 | 53 | 4. Add your remote repository: `git remote add origin git@github.com:your-username/your-project-name` |
46 | 54 | 5. Upload your local commits to the new remote repo: `git push -u origin master` |
47 | | -6. Start coding! |
| 55 | +6. Start coding! |
48 | 56 |
|
49 | | -### Cloning the repository |
| 57 | +### Cloning the repository |
50 | 58 |
|
51 | | -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: |
| 59 | +Just in case you prefer to avoid dealing with `composer create-project`, you can also clone this repository. We |
| 60 | +recommend to follow the next step-by-step process in order to avoid adding the bootstrap project commits to your project |
| 61 | +Git history: |
52 | 62 |
|
53 | | -1. [Use this repositoy template](https://github.com/CodelyTV/php-basic-skeleton/generate) |
| 63 | +1. [Use this repository template](https://github.com/CodelyTV/php-basic-skeleton/generate) |
54 | 64 | 2. Clone your project |
55 | 65 | 3. Move to the project directory: `cd your-project-name` |
56 | 66 | 4. If you don't have it already, [install Composer](https://getcomposer.org/download/). |
57 | 67 | 5. Install the project dependencies: `composer install` |
58 | | -6. Run all the checks: `composer test`. This will do some checks that you can perform with isolated commands: |
59 | | - 1. [PHP Style Check](https://github.com/squizlabs/PHP_CodeSniffer): `composer style`. If you want to fix style issues automatically: `composer fix-style`. |
60 | | - 2. [PHP Unit](https://phpunit.de/): `composer phpunit`. |
| 68 | +6. Run the tests: `composer test`. |
61 | 69 | 7. Start coding! |
62 | 70 |
|
63 | | -## Helpful resources |
64 | | - |
65 | | -### PHP 7 |
66 | | - |
67 | | -* [PHP 7 new features](http://php.net/manual/en/migration70.new-features.php) |
68 | | -* [Scalar type declarations example](https://github.com/tpunt/PHP7-Reference#scalar-type-declarations) |
69 | | -* [Return type declarations example](https://github.com/tpunt/PHP7-Reference#return-type-declarations) |
70 | | - |
71 | | -### PHPUnit |
| 71 | +## Related skeleton templates |
72 | 72 |
|
73 | | -* [Introduction to writing tests for PHPUnit](https://phpunit.de/manual/current/en/writing-tests-for-phpunit.html) |
74 | | -* [Testing exceptions with PHPUnit](https://phpunit.de/manual/current/en/writing-tests-for-phpunit.html#writing-tests-for-phpunit.exceptions) |
75 | | -* [PHPUnit assertions](https://phpunit.de/manual/current/en/appendixes.assertions.html) |
| 73 | +This very same basic skeleton philosophy implemented in other programming languages: |
76 | 74 |
|
77 | | -### Refactoring |
| 75 | +- [🔷🕸️ TypeScript Web Skeleton](https://github.com/CodelyTV/typescript-web-skeleton) |
| 76 | +- [🔷🌍 TypeScript API Skeleton](https://github.com/CodelyTV/typescript-api-skeleton) |
| 77 | +- [🔷✨ TypeScript DDD Skeleton](https://github.com/CodelyTV/typescript-ddd-skeleton) |
| 78 | +- [✨ JavaScript Basic Skeleton](https://github.com/CodelyTV/javascript-basic-skeleton) |
| 79 | +- [☕ Java Basic Skeleton](https://github.com/CodelyTV/java-basic-skeleton) |
| 80 | +- [📍 Kotlin Basic Skeleton](https://github.com/CodelyTV/kotlin-basic-skeleton) |
| 81 | +- [🧬 Scala Basic Skeleton](https://github.com/CodelyTV/scala-basic-skeleton) |
| 82 | +- [🦈 C# Basic Skeleton](https://github.com/CodelyTV/csharp-basic-skeleton) |
78 | 83 |
|
79 | | -* [Refactoring.guru Code Smells catalog](https://refactoring.guru/smells/smells) |
80 | | -* [Refactoring.guru Refactorings catalog](https://refactoring.guru/catalog) |
81 | | -* [SourceMaking Refactorings catalog](https://sourcemaking.com/refactoring) |
82 | | -* [Martin Fowler Refactorings catalog](http://refactoring.com/catalog/) |
83 | | -* [CodelyTV Refactoring videos (Spanish)](http://codely.tv/tag/refactoring/) |
84 | | - |
85 | | -## Other programming languages |
86 | | - |
87 | | -* [PHP](https://github.com/CodelyTV/php-bootstrap) |
88 | | -* [Scala](https://github.com/CodelyTV/scala_bootstrap) |
89 | | - |
90 | | -## About |
91 | | - |
92 | | -This hopefully helpful utility has been developed by [CodelyTV][link-author] and [contributors][link-contributors]. |
93 | | - |
94 | | -We'll try to maintain this project as simple as possible, but Pull Requests are welcomed! |
| 84 | +[ico-version]: https://img.shields.io/packagist/v/codelytv/php-bootstrap.svg?style=flat-square |
95 | 85 |
|
96 | | -## License |
| 86 | +[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square |
97 | 87 |
|
98 | | -The MIT License (MIT). Please see [License File][link-license] for more information. |
| 88 | +[ico-gh-actions]: https://github.com/CodelyTV/php-basic-skeleton/actions/workflows/ci.yml/badge.svg |
99 | 89 |
|
100 | | -[ico-version]: https://img.shields.io/packagist/v/codelytv/php-bootstrap.svg?style=flat-square |
101 | | -[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square |
102 | | -[ico-travis]: https://img.shields.io/travis/CodelyTV/php-bootstrap/master.svg?style=flat-square |
103 | 90 | [ico-code-quality]: https://img.shields.io/scrutinizer/g/CodelyTV/php-bootstrap.svg?style=flat-square |
| 91 | + |
104 | 92 | [ico-downloads]: https://img.shields.io/packagist/dt/codelytv/php-bootstrap.svg?style=flat-square |
105 | 93 |
|
106 | 94 | [link-packagist]: https://packagist.org/packages/codelytv/php-bootstrap |
| 95 | + |
107 | 96 | [link-license]: LICENSE |
108 | | -[link-travis]: https://travis-ci.org/CodelyTV/php-bootstrap |
109 | | -[link-code-quality]: https://scrutinizer-ci.com/g/CodelyTV/php-bootstrap |
| 97 | + |
| 98 | +[link-gh-actions]: https://github.com/CodelyTV/php-basic-skeleton/actions |
| 99 | + |
110 | 100 | [link-downloads]: https://packagist.org/packages/codelytv/php-bootstrap |
| 101 | + |
111 | 102 | [link-readme]: README.md |
| 103 | + |
112 | 104 | [link-composer-json]: composer.json |
| 105 | + |
113 | 106 | [link-phpunit]: phpunit.xml |
| 107 | + |
114 | 108 | [link-gitignore]: .gitignore |
115 | | -[link-editorconfig]: .editorconfig |
116 | | -[link-scrutinizer]: .scrutinizer.yml |
117 | | -[link-author]: https://github.com/CodelyTV |
| 109 | + |
| 110 | +[link-editorconfig]: .editorconfig |
0 commit comments