Skip to content

Instantly share code, notes, and snippets.

View kolomiec-valeriy's full-sized avatar

Valeriy kolomiec-valeriy

View GitHub Profile
/**
* @Route("/goals/{id}", methods={"POST"})
*
* @param Goal $goal
* @param UserService $userService
*
* @return JsonResponse
*/
public function add(Goal $goal, UserService $userService)
{
/**
* @param $id
*
* @return \Symfony\Component\HttpFoundation\JsonResponse
*
* @IsGranted("ROLE_GENERAL_USER")
* @Route("/journal-note/{id}", methods={"GET"}, requirements={"id": "\d+"})
*/
public function viewAction($id)
{
<?php
namespace App\Normalizer;
use App\Entity\JournalNote;
use App\Exception\JournalNoteException;
use Symfony\Bridge\Doctrine\RegistryInterface;
use Symfony\Component\Serializer\Exception\LogicException;
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
<?php
namespace App\Service;
use Symfony\Component\HttpFoundation\JsonResponse;
class MessageHelper
{
public function __construct()
{
<?php
namespace App\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Process\Process;
<?php
namespace App\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Process\Process;
<?php
namespace App\Service;
use Psr\Log\LoggerInterface;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpKernel\KernelInterface;
<?php
namespace App\Service;
use Psr\Log\LoggerInterface;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpKernel\KernelInterface;
.highcharts-credits {
display: none;
}
.highchart-block {
min-width: 250px;
max-width:500px;
height: 250px;
margin: 0 auto 20px;
}
.page-break {
@kolomiec-valeriy
kolomiec-valeriy / ExportBooksController.php
Created March 1, 2019 10:18
Export books with chapters to json files in Zip apchive
<?php
namespace App\Controller;
use App\Entity\BibleBook;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Routing\Annotation\Route;
class ExportBooksController extends Controller