Skip to content

Instantly share code, notes, and snippets.

View faizanakram99's full-sized avatar
💭
PHPing(SYMFONYing) all the time

Faizan Akram Dar faizanakram99

💭
PHPing(SYMFONYing) all the time
View GitHub Profile
@faizanakram99
faizanakram99 / cloudSettings
Last active August 30, 2020 01:55
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-08-30T01:55:03.234Z","extensionVersion":"v3.4.3"}
<?php
namespace Qbil\TradeBundle\Domain;
use Doctrine\ORM\EntityManagerInterface;
use Qbil\TradeBundle\Entity\Contract;
use Qbil\TradeBundle\Entity\Contractline;
use Qbil\TradeBundle\Entity\Eenheid;
use Qbil\TradeBundle\Entity\Log;
use Symfony\Component\Security\Core\User\UserInterface;
<?php
// .....
class blaBla
{
/**
* @Route("/suggestdestinations")
*
* @return \Symfony\Component\HttpFoundation\Response
<?php
use Aws\Ec2\Ec2Client;
use Aws\ElasticBeanstalk\ElasticBeanstalkClient;
use Aws\ElasticBeanstalk\Exception\ElasticBeanstalkException;
use Aws\Rds\Exception\RdsException;
use Aws\Rds\RdsClient;
require __DIR__.'/vendor/autoload.php';
<?php
namespace Qbil\CommonBundle\Services;
use Qbil\CommonBundle\Exception\LoadingConfigurationFailedException;
interface ConfigurationAdapterInterface
{
/**
* @throws LoadingConfigurationFailedException
@faizanakram99
faizanakram99 / ArgumentResolverTest.php
Last active October 13, 2021 13:07
RequestDTOArgumentValueResolver
<?php
namespace Qbil\Tests\CommonBundle\Services;
use Qbil\CommonBundle\Services\DTOArgumentValueResolver;
use Qbil\Tests\Fixtures\Controller\DTOController;
use Qbil\Tests\Fixtures\DTO\Person;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Controller\ArgumentResolver;
@faizanakram99
faizanakram99 / 01_httpd_phpfpm.config
Created April 27, 2020 20:23 — forked from mattzuba/01_httpd_phpfpm.config
Apache 2.4 / PHP-FPM 5.5 on Amazon Elastic Beanstalk
packages:
yum:
php55-fpm: []
files:
"/opt/elasticbeanstalk/hooks/appdeploy/pre/26_phpfpm_config.sh":
mode: "000755"
owner: root
group: root
content: |
name: Code check
on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]
types: [ synchronize, opened, reopened, ready_for_review ]
jobs:
@faizanakram99
faizanakram99 / MonospaceResponse.php
Created November 18, 2020 12:02
View Monolog in browser with HttpFoundation component
<?php
declare(strict_types=1);
namespace Qbil\CommonBundle\Extension;
use Symfony\Component\HttpFoundation\Response;
use Webmozart\Assert\Assert;
final class MonospaceResponse extends Response
@faizanakram99
faizanakram99 / TranslationConfigCacheFactory.php
Created June 30, 2022 16:09
Example of ConfigCacheFactory for overriding translation cache for multi-tenant app with tenant specific translations
<?php
namespace Yup\Translation;
use Symfony\Component\Config\ConfigCacheFactoryInterface;
use Symfony\Component\Config\ConfigCacheInterface;
class TranslationConfigCacheFactory implements ConfigCacheFactoryInterface
{
private ConfigCacheFactoryInterface $configCacheFactory;