This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
foreach ($nominals as $nominal) { | |
for ($i = 1; $i <= $nominal['code_count']; $i++) { | |
$code = new Code(); | |
$code->setShop($shop); | |
$code->setCode($this->GenerateData($codeLength, $codeType, $codePrefix)); | |
$code->setPincode($this->GenerateData($pincodeLength, $pincodeType)); | |
$code->setCodeLiveCikle($codeLiveCikle); | |
$code->setMinDateActivity($minDateActivity); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace DesignPatterns\Creational\AbstractFactory; | |
/** | |
* In this case, the abstract factory is a contract for creating some components | |
* for the web. There are two ways of rendering text: HTML and JSON | |
*/ | |
abstract class AbstractFactory | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace DesignPatterns\Structural\DependencyInjection; | |
class DatabaseConfiguration | |
{ | |
/** | |
* @var string | |
*/ | |
private $host; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Command; | |
use App\Entity\User; | |
use Knp\Command\Command; | |
use Symfony\Component\Console\Input\InputArgument; | |
use Symfony\Component\Console\Input\InputInterface; | |
use Symfony\Component\Console\Output\OutputInterface; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function indexAction(Request $request) | |
{ | |
$em = $this->getDoctrine()->getManager(); | |
$shipment = new Shipment(); | |
$form = $this->createFormBuilder($shipment) | |
->add('name', TextType::class) | |
->getForm(); | |
$form->handleRequest($request); | |
if ($form->isSubmitted() && $form->isValid()) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function createNewContributionAction(Request $request, int $userReviewId, int $review_id) | |
{ | |
$user = $this->getApp()['user']; | |
$userReview = $this->getRepository(UserReview::class)->findBy(['id' => $userReviewId]); | |
$userReview = $userReview[0]; | |
$form = $this->getFormFactory()->createBuilder(CreateContributionType::class)->getForm(); | |
$form->handleRequest($request); | |
if ($form->isSubmitted()) { | |
if (isset($_POST['save'])) { | |
$data = $form->getData(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$app->register(new Silex\Provider\SecurityServiceProvider(), | |
[ | |
$app['security.firewalls'] = [ | |
'secured' => [ | |
'pattern' => '^/', | |
'anonymous' => true, | |
'form' => [ | |
'login_path' => '/login', | |
'check_path' => '/admin/login_check', | |
], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$this->denyAccessUnlessGranted('edit_comment', $comment); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace MainBundle\Validator\Constraints; | |
use Symfony\Component\Validator\Constraint; | |
/** @Annotation */ | |
class CustomLength extends Constraint | |
{ | |
// Define all annotation parameters; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerName giftshere | |
DocumentRoot /home/maximstrutinskiy/Sites/giftshere/web | |
<Directory /home/maximstrutinskiy/Sites/giftshere/web> | |
AllowOverride None | |
Require all granted | |
Allow from All | |
</Directory> | |
ErrorLog /home/maximstrutinskiy/Sites/giftshere-log/error.log | |
CustomLog /home/maximstrutinskiy/Sites/giftshere-log/access.log combined |