Output of the "The perfect MakeFile for Symfony (at least for me! 😁)" Symfony snippet


  • Strangebuzz Snippet VM: 2.1.0
  • Symfony: 5.1.2

Code execution output:

 —— 🐝 The Strangebuzz Symfony Makefile 🐝 ——————————————————————————————————— 
help                           Outputs this help screen
wait                           Sleep 5 seconds
 —— Composer 🧙‍♂️ ———————————————————————————————————————————————————————————— 
install                        Install vendors according to the current composer.lock file
update                         Update vendors according to the composer.json file
 —— PHP 🐘 (macOS with brew) ————————————————————————————————————————————————— 
php-upgrade                    Upgrade PHP to the last version
php-set-7-2                    Set php 7.2 as the current PHP version
php-set-7-3                    Set php 7.3 as the current PHP version
php-set-7-4                    Set php 7.4 as the current PHP version
 —— Symfony 🎵 ——————————————————————————————————————————————————————————————— 
sf                             List all Symfony commands
cc                             Clear the cache. DID YOU CLEAR YOUR CACHE????
warmup                         Warmup the cache
fix-perms                      Fix permissions of all var files
assets                         Install the assets with symlinks in the public folder
purge                          Purge cache and logs
 —— Symfony binary 💻 ———————————————————————————————————————————————————————— 
bin-install                    Download and install the binary in the project (file is ignored)
cert-install                   Install the local HTTPS certificates
serve                          Serve the application with HTTPS support
unserve                        Stop the webserver
 —— Elasticsearch 🔎 ————————————————————————————————————————————————————————— 
populate                       Reset and populate the Elasticsearch index
list-index                     List all indexes on the cluster
delete-index                   Delete a given index (replace "index" by the index name to delete)
 —— Docker 🐳 ———————————————————————————————————————————————————————————————— 
up                             Start the docker hub (MySQL,redis,adminer,elasticsearch,head,Kibana)
docker-build                   UP+rebuild the application image
down                           Stop the docker hub
dpsn                           List Docker containers for the project
bash                           Connect to the application container
 —— Project 🐝 ——————————————————————————————————————————————————————————————— 
run                            Start docker, load fixtures, populate the Elasticsearch index and start the webserver
reload                         Reload fixtures and repopulate the Elasticserch index
abort                          Stop docker and the Symfony binary server
cc-redis                       Flush all Redis cache
commands                       Display all commands in the project namespace
load-fixtures                  Build the DB, control the schema validity, load fixtures and check the migration status
init-snippet                   Initialize a new snippet
 —— Tests ✅ ————————————————————————————————————————————————————————————————— 
test                           Launch main functional and unit tests
test-external                  Launch tests implying external resources (API, services...)
test-all                       Launch all tests
 —— Coding standards ✨ —————————————————————————————————————————————————————— 
cs                             Launch check style and static analysis
codesniffer                    Run php_codesniffer only
stan                           Run PHPStan only
psalm                          Run psalm only
init-psalm                     Init a new psalm config file for a given level, it must be decremented to have stricter rules
cs-fix                         Run php-cs-fixer and fix the code.
 —— Deploy & Prod 🚀 ————————————————————————————————————————————————————————— 
deploy                         Full no-downtime deployment with EasyDeploy
env-check                      Check the main ENV variables of the project
le-renew                       Renew Let's Encrypt HTTPS certificates
 —— Yarn 🐱 / JavaScript ————————————————————————————————————————————————————— 
dev                            Rebuild assets for the dev env
watch                          Watch files and build assets when needed for the dev env
build                          Build assets for production
lint                           Lints Js files
 —— Stats 📜 ————————————————————————————————————————————————————————————————— 
stats                          Commits by the hour for the main author of this project

 Back to the code  ≪ this.showUnitTest ? this.trans.hide_unit_test : this.trans.show_unit_test ≫  More on Stackoverflow   Read the doc  More on the web  Random snippet

<?php declare(strict_types=1);

namespace App\Tests\Controller\Snippets;

use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\Process\Process;

 * @covers Snippet
final class Snippet8Test extends KernelTestCase
    protected function setUp(): void

     * @covers Snippet8Trait::snippet8
     * @see https://www.strangebuzz.com/en/snippets/the-perfect-makefile-for-symfony
    public function testSnippet8(): void
        $process = new Process(['make', '-f', self::$kernel->getProjectDir().'/Makefile']);
        $this->assertStringContainsStringIgnoringCase('The Strangebuzz Symfony Makefile', $process->getOutput());