Skip to content

Instantly share code, notes, and snippets.

View PetrSladek's full-sized avatar

Petr /Peggy/ Sládek PetrSladek

View GitHub Profile
@PetrSladek
PetrSladek / CacheServicerProvider.php
Last active February 14, 2025 13:23
Code snippet for Webnode DEV Blog
class CacheServiceProvider extends ServiceProvider
{
public function register(ContainerInterface $container): void
{
$container->bind(CacheAdapterInterface::class, function (ContainerInterface $container, Configuration $configuration) {
return match($configuration->get('cache.driver')) {
'filesystem' => $container->get(FileSystemCacheDriver::class),
'aerospike' => $container->get(AerospikeCacheDriver::class),
}
const input = `9548
3738
18492
17104
1738
1769
4544
1153
@PetrSladek
PetrSladek / User.php
Created February 16, 2018 10:35 — forked from Ocramius/User.php
Doctrine 2 ManyToMany - the correct way
<?php
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
/**
* @ORM\Entity()
* @ORM\Table(name="user")
*/
class User