Skip to content

Instantly share code, notes, and snippets.

View bwaidelich's full-sized avatar
🏠
Working from home

Bastian Waidelich bwaidelich

🏠
Working from home
View GitHub Profile
@bwaidelich
bwaidelich / CatchUpWorkerCommandController.php
Created November 15, 2023 09:58
Creating a service for the Neos 9.0 Content Repository
<?php
declare(strict_types=1);
final class CatchUpWorkerCommandController extends CommandController {
public function __construct(
private readonly ContentRepositoryRegistry $contentRepositoryRegistry,
private readonly ProjectionCatchUpServiceFactory $projectionCatchUpServiceFactory,
) {
parent::__construct();
@bwaidelich
bwaidelich / ExistsValidator.php
Last active November 9, 2023 10:39
TYPO3 Flow – Unique & Exists Validators
<?php
namespace My\Package\Validation;
use TYPO3\Flow\Persistence\RepositoryInterface;
class ExistsValidator extends \TYPO3\Flow\Validation\Validator\AbstractValidator {
/**
* @var array
*/
@bwaidelich
bwaidelich / index.html
Last active March 23, 2023 14:44 — forked from mpj/index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Intro to XState</title>
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<div id="box"></div>
@bwaidelich
bwaidelich / magicMethodBenchmark.php
Created November 6, 2013 11:34
A simple script to compare performance of magic __call methods to real implementations
<?php
class MagicMethodFixture {
/**
* @var array
*/
protected $configurations;
public function __construct() {
$this->configurations = array(
@bwaidelich
bwaidelich / Settings.yaml
Last active September 22, 2022 16:19
A simple example showing how doctrine behaviors (in this chase soft-deleteable) can be used within TYPO3 Flow.
TYPO3:
Flow:
# disable reflection for non psr-0 compliant 3rd party packages
object:
excludeClasses:
'gedmo.doctrineextensions' : ['Gedmo\\.*']
# register soft deletable filter & event listeners
persistence:
doctrine:
@bwaidelich
bwaidelich / Example.fusion
Created June 21, 2022 10:50
Neos CMS: Fusion based Zip Archive (example structure)
<Some.Package:ZipArchiveLink zip.files={['resource://Neos.Neos/Public/Images/Login/Logo.svg', 'resource://Neos.Neos/Public/Images/Login/Wallpaper.jpg']} filename="archive.zip">
Download
</Some.Package:ZipArchiveLink>
@bwaidelich
bwaidelich / Tests_Behavior_Bootstrap_FeatureContext.php
Last active April 22, 2022 07:00
GraphQL based Behat testing in Flow
<?php
declare(strict_types=1);
use Behat\Behat\Context\Context;
use Behat\Gherkin\Node\PyStringNode;
use Behat\Gherkin\Node\TableNode;
use Doctrine\DBAL\Connection;
use Doctrine\ORM\EntityManagerInterface;
use Firebase\JWT\JWT;
@bwaidelich
bwaidelich / SomeIdentifier.php
Last active January 14, 2022 09:34
Example of a "constant" value object that can be compared
<?php
final class SomeIdentifier
{
/**
* @var string
*/
private $value;
/**
* @var self[]
@bwaidelich
bwaidelich / Configuration_Policy.yaml
Created November 25, 2021 12:03
Example of a Flow policy that respects method parameters
# Concrete assignments from roles to privileges can happen in your global /Configuration/Policy.yaml file
roles:
'Some.Distribution:Administrator':
privileges:
- privilegeTarget: 'Some.Package:AccessAnyProduct'
permission: GRANT
'Some.Distribution:User':
const nestedStates = {
initial: 'a1',
states: {
a1: {
on: {
FOO: "a2"
}
},
a2: {
type: "final"