This file contains 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 | |
class EmailSender implements SenderInterface | |
{ | |
public function send(Notification $notification) | |
{ | |
// send throw email service | |
} | |
} |
This file contains 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 Helper; | |
use Codeception\Exception\ModuleException; | |
class Api extends \Codeception\Module | |
{ | |
public function getSchemaFile() { | |
return codecept_data_dir('swagger.json'); |
This file contains 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
// | |
article_repository: | |
tags: | |
- { name: 'repository_override.registry', entity: MyNamespace\Entity\Article, class: MyNamespace\Repository\ArticleRepository} | |
// | |
class_metadata.subscriber: | |
class: MyNamespace\EventHandler\Doctrine\ClassMetadataSubscriber | |
arguments: |
This file contains 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
... | |
// В начале метода get_products(), где инициализируются переменные | |
$exclude_id_filter = ''; | |
... | |
// В середине файла, где идут схожие првоерки и наполняются пременные | |
if(!empty($filter['exclude_id'])) { | |
$exclude_id_filter = $this->db->placehold('AND p.id NOT IN (?@)', (array)$filter['exclude_id']); | |
} |
This file contains 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 | |
// <...> | |
$paginator = new Paginator($builder->get()); | |
$count = $paginator->count(); | |
$iterator = $paginator->getIterator(); | |
// Как блядь это вставить в начале моих данных?! |
This file contains 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 | |
declare(strict_types=1); | |
class Pool | |
{ | |
/** | |
* @var \Generator[]|array[] | |
*/ | |
private $iterators = []; |
This file contains 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
version: '2' | |
services: | |
nginx: | |
build: | |
context: ./ | |
dockerfile: docker/nginx.docker | |
volumes: | |
- ./:/var/www | |
- ./docker/nginx/ssl:/etc/nginx/ssl | |
ports: |
This file contains 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
$router->any('main', '/', function() {return('Hello!');}); | |
$router->get('blog', '/blog', function() {return('This is Blog');}); | |
$router->post('blog_create', '/blog', function($request) {return('Create Post' . $request->getAttribute('id'));}); | |
$router->get('blog_show', '/blog/(?P<id>\d+)', function($request) {return('Post');}); | |
$router->patch('blog_update', '/blog/(?P<id>\d+)', function($request) {return('Update Post' . $request->getAttribute('id'));}); | |
$router->delete('blog_delete', '/blog/(?P<id>\d+)', function($request) {return('Delete Post' . $request->getAttribute('id'));}); | |
// вызов нужного роута по имени |
This file contains 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
$collection = new RouterCollection(); | |
$collection->any('/', function() {return('Hello!');}); | |
$collection->get('/blog', function() {return('This is Blog');}); | |
$collection->post('/blog', function($request) {return('Create Post');}); | |
$router = new Riuter($collection); | |
$result = $router->match(); | |
This file contains 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
$router->any('/', function() {return('Hello!');}); | |
$router->get('/blog', function() {return('This is Blog');}); | |
$router->post('/blog', function($request) {return('Create Post');}); | |
$router->patch('/blog/(?P<id>\d+)', function($request) {return('Update Post' . $request->getAttribute('id'));}); | |
$router->delete('/blog/(?P<id>\d+)', function($request) {return('Delete Post' . $request->getAttribute('id'));}); | |
// $router->any — метод без указания методов, то есть для любого запроса | |