Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Deprecating Legacy

Tomas Votruba TomasVotruba

🎯
Deprecating Legacy
View GitHub Profile
View classic-doctrine-config.php
<?php
declare(strict_types=1);
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (ContainerConfigurator $containerConfigurator): void {
$containerConfigurator->extension('doctrine', [
'dbal' => [
'host' => '%env(DATABASE_HOST)%',
@TomasVotruba
TomasVotruba / SearchExtension.php
Created May 22, 2020
Nette Service Autodiscovery - backport to Nette 2.4
View SearchExtension.php
<?php
declare(strict_types=1);
namespace App\DependencyInjection\Extensions;
use Nette;
use Nette\DI\CompilerExtension;
use Nette\DirectoryNotFoundException;
use Nette\Loaders\RobotLoader;
@TomasVotruba
TomasVotruba / ecs.yaml
Last active Oct 22, 2019
Co bychom udělali jinak? - Spaceflow & Rector talk at Péhápkaři 2019/10, LMC
View ecs.yaml
# install: composer require symplify/easy-coding-standard --dev
# dry-run: vendor/bin/ecs check src
# run: vendor/bin/ecs check src --fix
# ----------------------------- Step 1 -----------------------------
services:
# use ::class
Symplify\CodingStandard\Fixer\Php\ClassStringToClassConstantFixer: ~
@TomasVotruba
TomasVotruba / PHPStanRule.php
Created Aug 22, 2019
[PHPStan] Don't use *X suffixed services in *Y suffixed class (here don't use *Repository outside *Facade) - do it generic next time
View PHPStanRule.php
<?php declare(strict_types=1);
namespace Spaceflow\PHPStan\Rector\Rule;
use Nette\Utils\Strings;
use PEAR_PackageFileManager_Fileset;
use PhpParser\Node;
use PhpParser\Node\Expr\MethodCall;
use PHPStan\Analyser\Scope;
use PHPStan\Rules\Rule;
You can’t perform that action at this time.