Skip to content

Instantly share code, notes, and snippets.

View wowo's full-sized avatar

Wojciech Sznapka wowo

View GitHub Profile
@wowo
wowo / sample-log.json
Created September 13, 2020 13:49
schemas
{
"time": "2020-09-13 15:45:00",
"level": "info",
"channel": "main",
"message": "Some log entry has been produced"
}
<?php
namespace Example\FooBundle\Service;
use Doctrine\ORM\EntityRepository;
use Symfony\Component\HttpKernel\Log\LoggerInterface;
class FooService
{
protected $fooRepository;
<?php
namespace Example\FooBundle\Repository;
use Doctrine\ORM\EntityRepository;
class FooRepository extends EntityRepository
{
}
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="[..]">
<parameters>
<parameter key="example.foo.repository.class">
Example\FooBundle\Repository\FooRepository</parameter>
<parameter key="example.foo.service.class">
Example\FooBundle\Service\FooService</parameter>
</parameters>
<?php
namespace Example\FooBundle\Repository;
use Doctrine\Common\Persistence\ObjectRepository;
interface FooRepositoryInterface extends ObjectRepository
{
public function fetchLatest();
}
<?php
namespace Example\FooBundle\Service;
use Doctrine\ORM\EntityRepository;
use Symfony\Component\HttpKernel\Log\LoggerInterface;
class FooService
{
protected $fooRepository;
<?php
namespace Example\FooBundle\Repository;
use Doctrine\ORM\EntityRepository;
class FooRepository extends EntityRepository
implements FooRepositoryInterface
{
public function fetchLatest()
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="[..]">
<parameters>
<parameter key="example.foo.repository.class">
Example\FooBundle\Repository\FooRepository</parameter>
<parameter key="example.foo.service.class">
Example\FooBundle\Service\FooService</parameter>
</parameters>
@wowo
wowo / composer.json
Last active September 3, 2019 19:38
log-demo
{
"name": "wowo/log-demo",
"type": "project",
"require": {
"monolog/monolog": "^2.0"
},
"authors": [
{
"name": "Wojciech Sznapka",
"email": "wojciech@sznapka.pl"
$poundToEuro = (float) simplexml_load_file('https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml')->xpath("//*[@currency='GBP']")[0]['rate'];