-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
TBoileau
committed
Apr 21, 2020
0 parents
commit 03a664f
Showing
82 changed files
with
7,734 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# In all environments, the following files are loaded if they exist, | ||
# the latter taking precedence over the former: | ||
# | ||
# * .env contains default values for the environment variables needed by the app | ||
# * .env.local uncommitted file with local overrides | ||
# * .env.$APP_ENV committed environment-specific defaults | ||
# * .env.$APP_ENV.local uncommitted environment-specific overrides | ||
# | ||
# Real environment variables win over .env files. | ||
# | ||
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES. | ||
# | ||
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2). | ||
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration | ||
|
||
###> symfony/framework-bundle ### | ||
APP_ENV=dev | ||
APP_SECRET=7ea6cff520c89e6e0653a832b6382ade | ||
#TRUSTED_PROXIES=127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 | ||
#TRUSTED_HOSTS='^(localhost|example\.com)$' | ||
###< symfony/framework-bundle ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# define your env variables for the test env here | ||
KERNEL_CLASS='App\Kernel' | ||
APP_SECRET='$ecretf0rt3st' | ||
SYMFONY_DEPRECATIONS_HELPER=999999 | ||
PANTHER_APP_ENV=panther |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# define your env variables for the test env here | ||
KERNEL_CLASS='App\Kernel' | ||
APP_SECRET='$ecretf0rt3st' | ||
SYMFONY_DEPRECATIONS_HELPER=999999 | ||
PANTHER_APP_ENV=panther |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Code quality | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
phpcs: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Validate composer.json and composer.lock | ||
run: composer validate | ||
|
||
- name: Install dependencies | ||
run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader | ||
|
||
- name: Detecting PHP Code Standards Violations | ||
run: vendor/bin/phpcs --standard=PSR12 tests src domain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Testing project | ||
on: [push, pull_request] | ||
jobs: | ||
symfony: | ||
name: Symfony (PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }}) | ||
runs-on: ${{ matrix.operating-system }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
operating-system: [ubuntu-latest] | ||
php-versions: ['7.4'] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup PHP, with composer and extensions | ||
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php | ||
with: | ||
php-version: ${{ matrix.php-versions }} | ||
extensions: mbstring, xml, ctype, iconv, intl | ||
coverage: xdebug #optional | ||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
- name: Cache composer dependencies | ||
uses: actions/cache@v1 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
# Use composer.json for key, if composer.lock is not committed. | ||
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
- name: Install Composer dependencies | ||
run: | | ||
composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader | ||
- name: Run Tests | ||
run: php bin/phpunit --testsuite unit,integration --coverage-text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
###> symfony/framework-bundle ### | ||
/.env.local | ||
/.env.local.php | ||
/.env.*.local | ||
/config/secrets/prod/prod.decrypt.private.php | ||
/public/bundles/ | ||
/var/ | ||
/vendor/ | ||
###< symfony/framework-bundle ### | ||
|
||
###> symfony/phpunit-bridge ### | ||
.phpunit | ||
.phpunit.result.cache | ||
/phpunit.xml | ||
###< symfony/phpunit-bridge ### | ||
|
||
###> phpunit/phpunit ### | ||
/phpunit.xml | ||
.phpunit.result.cache | ||
###< phpunit/phpunit ### | ||
/.idea | ||
/build | ||
.php_cs.cache | ||
*.sh | ||
debug.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
COMMENT CONTRIBUER AU PROJET ? | ||
============================== | ||
|
||
# Github | ||
|
||
## Backlog | ||
Retrouvez l'ensemble des [cas d'utilisation](https://github.com/TBoileau/code-challenge/labels/use%20case) dans la section [issues](https://github.com/TBoileau/code-challenge/issues). | ||
|
||
Si vous avez un doute sur ce qu'est un cas d'utilisation, je vous invite à jeter un oeil [ici](docs/index.md#cas-dutilisation). | ||
|
||
## S'assigner un cas d'utilisation | ||
Dans la section **issues** seront listés tous les cas d'utilisation, vous pouvez alors vous assigner un cas d'utilisation, mais il sera important de respecter les règles suivantes : | ||
* Je veux prendre en charge un cas d'utilisation, je m'engage donc à la concevoir, responsabilisez-vous ! Ce n'est pas grave si vous ne pouvez pas la terminer mais prévenez-nous ! | ||
* Si aucun commit en 7 jours n'est fait après l'assignation, je supprimerais l'assignation | ||
* Si aucun commit en 14 jours depuis le dernier commit n'est fait, je reprendrais le suite du développement | ||
* Si vous avez le moindre doute sur la comphrésion du cas d'utilisation, n'hésitez pas à le dire en commentant l'**issue** | ||
|
||
## Workflow | ||
Vous venez de vous assigner un cas d'utilisation, quelle est la marche à suivre : | ||
* Clonez le projet sur votre PC | ||
* Situez-vous sur la branche `develop` | ||
* Créez une nouvelle branche avec le prefix `feature/`, par exemple `feature/authentication` | ||
* Implémenter et tester le cas d'utilisation | ||
* Pousser votre feature sur **github** | ||
* Une fois le cas d'utilisation terminé, faites une **pull request** | ||
* On effectuera un **code review** de votre code, une fois validé | ||
|
||
*Note : vous pouvez utiliser [git flow](https://danielkummer.github.io/git-flow-cheatsheet/index.fr_FR.html) pour vous simplifier la vie !* | ||
|
||
Règles : | ||
* Toujours partir de la branche `develop` pour implémenter un nouveau cas d'utilisation | ||
* Toujours prefixer le nom de vos branche par `feature/` | ||
* Pensez à *push* votre **feature** pour que l'on puisse son avancement, attention on n'est pas la pour fliquer. | ||
* Ne jamais proposer de **pull request** si le code n'est pas testé | ||
|
||
# Bonnes pratiques | ||
Il est essentiel de respecter les bonnes pratiques suivantes : | ||
* Appliquer le [PSR-12](https://www.php-fig.org/psr/psr-12/) | ||
* Respecter les [bonne pratiques de Symfony](https://symfony.com/doc/current/best_practices.html) dans la mesure du possible | ||
* Pratiquer le [Test driven development](docs/tdd.md) | ||
* Suivre l'architecture mise en place : [Clean architecture](docs/index.md#clean-architecture) | ||
|
||
**Vous avez le moindre doute, c'est normal, cela ne doit pas vous empécher de contribuer, on est tous là pour apprendre. N'hésitez surtout pas à poser vos questions, que ce soit en live sur [Twitch](https://www.twitch.tv/toham) ou sur le [Discord](https://discord.gg/AMd6d4a).** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
CODE CHALLENGE | ||
============== | ||
|
||
Rejoignez-nous sur : | ||
* [Twitch](https://www.twitch.tv/toham) | ||
* [Youtube](https://www.youtube.com/c/ThomasBoileau) | ||
* [Discord](https://discord.gg/AMd6d4a) | ||
|
||
# Sommaire | ||
* [Concept](#concept) | ||
* [Participer](#comment-participer-au-dveloppement-) | ||
* [Projet](#projet) | ||
* [Contribution](CONTRIBUTION.md) | ||
* [Documentation](docs/index.md) | ||
|
||
# Concept | ||
**Code challenge** est une application web, qui a pour objectif de proposer aux utilisateurs inscrits de s'entraîner sur **PHP** et **Symfony**. | ||
|
||
L'objectif est de proposer un projet communautaire, ou chacun sera libre de participer à la conception de l'application. | ||
|
||
L'intérêt est de monter en compétence sur **PHP** et **Symfony** ensemble, autour d'un projet fédérateur. Ce n'es pas tout, le but à long terme est de passer la certification **Symfony**. | ||
Quoi de plus vertueux que de monter en compétence en concevant ensemble une application pour s'entraîner sur **Symfony**, pour enfin décrocher la certification. | ||
|
||
Le projet vous tente ? Rejoignez-nous sur Twitch [www.twitch.tv/toham](https://www.twitch.tv/toham) ! | ||
|
||
# Comment participer au développement ? | ||
Tout d'abord, vous n'avez aucune obligation, cependant si vous vous engagez pour implémenter une fonctionnalité, on compte sur vous ! | ||
|
||
*Je veux participer au projet, comment je fais ?* C'est très simple, rejoignez nous sur [discord](https://discord.gg/AMd6d4a), et contactez-moi en m'envoyant un message avec votre identifiant **Github** pour que je puisse vous ajouter en tant que collaborateur. | ||
|
||
# Projet | ||
Comme je l'ai expliqué plus haut, le but de se projet est de monter en compétence,pas seulement sur **PHP** et **Symfony**, mais aussi sur l'architecture logiciel comme la **Clean architecture**, en suivant les bonnes pratiques. | ||
|
||
Plus concrètement, nous allons mettre en place : | ||
* Clean architecture | ||
* **T**est **D**river **D**evelopment | ||
|
||
Je vous invite à lire le fichier de [contribution](CONTRIBUTION.md); | ||
|
||
Pour en savoir plus, jetez un oeil à la [documentation](docs/index.md) | ||
|
||
# Crédits | ||
|
||
* [Thomas Boileau](https://github.com/TBoileau) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
|
||
use App\Kernel; | ||
use Symfony\Bundle\FrameworkBundle\Console\Application; | ||
use Symfony\Component\Console\Input\ArgvInput; | ||
use Symfony\Component\ErrorHandler\Debug; | ||
|
||
if (!in_array(PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) { | ||
echo 'Warning: The console should be invoked via the CLI version of PHP, not the '.PHP_SAPI.' SAPI'.PHP_EOL; | ||
} | ||
|
||
set_time_limit(0); | ||
|
||
require dirname(__DIR__).'/vendor/autoload.php'; | ||
|
||
if (!class_exists(Application::class)) { | ||
throw new LogicException('You need to add "symfony/framework-bundle" as a Composer dependency.'); | ||
} | ||
|
||
$input = new ArgvInput(); | ||
if (null !== $env = $input->getParameterOption(['--env', '-e'], null, true)) { | ||
putenv('APP_ENV='.$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $env); | ||
} | ||
|
||
if ($input->hasParameterOption('--no-debug', true)) { | ||
putenv('APP_DEBUG='.$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0'); | ||
} | ||
|
||
require dirname(__DIR__).'/config/bootstrap.php'; | ||
|
||
if ($_SERVER['APP_DEBUG']) { | ||
umask(0000); | ||
|
||
if (class_exists(Debug::class)) { | ||
Debug::enable(); | ||
} | ||
} | ||
|
||
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']); | ||
$application = new Application($kernel); | ||
$application->run($input); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
|
||
if (!file_exists(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php')) { | ||
echo "Unable to find the `simple-phpunit.php` script in `vendor/symfony/phpunit-bridge/bin/`.\n"; | ||
exit(1); | ||
} | ||
|
||
if (false === getenv('SYMFONY_PHPUNIT_DIR')) { | ||
putenv('SYMFONY_PHPUNIT_DIR='.__DIR__.'/.phpunit'); | ||
} | ||
|
||
require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
{ | ||
"name": "tboileau/code-challenge", | ||
"description": "This is a community project, join us on twitch /toham. Code challenge is a simple project to practice on php and symfony.", | ||
"type": "project", | ||
"license": "proprietary", | ||
"require": { | ||
"php": "^7.4", | ||
"ext-ctype": "*", | ||
"ext-iconv": "*", | ||
"ext-json": "*", | ||
"symfony/console": "5.0.*", | ||
"symfony/dotenv": "5.0.*", | ||
"symfony/flex": "^1.3.1", | ||
"symfony/framework-bundle": "5.0.*", | ||
"symfony/serializer-pack": "^1.0", | ||
"symfony/yaml": "5.0.*" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "^7.5", | ||
"squizlabs/php_codesniffer": "3.*", | ||
"symfony/maker-bundle": "^1.15", | ||
"symfony/panther": "^0.7.1", | ||
"symfony/test-pack": "^1.0" | ||
}, | ||
"config": { | ||
"preferred-install": { | ||
"*": "dist" | ||
}, | ||
"sort-packages": true | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"App\\": "src/", | ||
"TBoileau\\CodeChallenge\\Domain\\": "domain/src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"App\\Tests\\": "tests/", | ||
"TBoileau\\CodeChallenge\\Domain\\Tests\\": "domain/tests/" | ||
} | ||
}, | ||
"replace": { | ||
"paragonie/random_compat": "2.*", | ||
"symfony/polyfill-ctype": "*", | ||
"symfony/polyfill-iconv": "*", | ||
"symfony/polyfill-php72": "*", | ||
"symfony/polyfill-php71": "*", | ||
"symfony/polyfill-php70": "*", | ||
"symfony/polyfill-php56": "*" | ||
}, | ||
"scripts": { | ||
"auto-scripts": { | ||
"cache:clear": "symfony-cmd", | ||
"assets:install %PUBLIC_DIR%": "symfony-cmd" | ||
}, | ||
"post-install-cmd": [ | ||
"@auto-scripts" | ||
], | ||
"post-update-cmd": [ | ||
"@auto-scripts" | ||
] | ||
}, | ||
"conflict": { | ||
"symfony/symfony": "*" | ||
}, | ||
"extra": { | ||
"symfony": { | ||
"allow-contrib": false, | ||
"require": "5.0.*" | ||
} | ||
} | ||
} |
Oops, something went wrong.