Skip to content

Instantly share code, notes, and snippets.

@ox160d05d
ox160d05d / GetCustomerJourneyCatalogResponse.php
Created December 20, 2019 06:02
Just an abstract response
View GetCustomerJourneyCatalogResponse.php
<?php
declare(strict_types=1);
namespace App\CustomerJourney\UI\Response;
use App\Common\App\ResponseInterface;
use App\Common\AssetManager;
use App\CustomerJourney\Domain\CustomerJourney;
View Do-only-once
<?php
//...
private function ensureTransactionStarted()
{
if (!$this->transactionStarted) {
$this->em->beginTransaction();
$this->transactionStarted = true;
}
}
View golang_string_length
package main
import (
"fmt"
)
func main() {
str := "Hello, ⌘"
// Print length of string variable "str"
View golang-memory-cache
package memory_cache
type DataCache struct {
data map[string]string
}
func (s dataCache) Get(key string) (string, bool) {
if val, ok := s.data[key]; ok {
return val, true
}
View PHP 3 Solid UserManager
<?php
namespace App\Manager;
use App\Service\Joke\ProviderInterface;
use App\Entity\User;
use Psr\Container\Container;
class UserManager {
public $em;