Skip to content

Instantly share code, notes, and snippets.

@RyanThompson
RyanThompson / property-handler-definition.php
Last active August 29, 2015 14:24
How to use property handlers.
<?php namespace Acme\Foo\Form;
use Anomaly\Streams\Platform\Ui\Form\FormBuilder;
class FooFormBuilder extends FormBuilder
{
/**
* Define your property normally.
*/
@RyanThompson
RyanThompson / how-to-override-a-resolving-method.php
Created July 6, 2015 23:28
Resolving methods usually support class transformation. You can also override them like this.
<?php namespace Acme;
use Anomaly\Streams\Platform\Entry\EntryModel;
class FooModel extends EntryModel
{
/**
* Return a new model collection.
*
@RyanThompson
RyanThompson / suggested-class-structure.txt
Last active August 29, 2015 14:24
This is the suggested addon structure for Streams Platform packages and addons.
src/
Foo/FooModel
Foo/FooCollection // Transformed collection for FooModel
Foo/FooPresenter // Transformed presenter for FooModel
Foo/FooObserver // Observers can not be transformed
Foo/Table/FooTableBuilder // Assumes Foo/FooModel for $model property
Foo/Table/FooTableColumns // Handler for FooTableBuilder->columns
Foo/Form/FooFormBuilder // Assumes Foo/FooModel for $model property
Foo/Form/FooFormSections // Handler for FooFormBuilder->sections
@RyanThompson
RyanThompson / coding-standards-example.php
Last active June 22, 2016 18:52
An example of the coding standards by AnomalyLabs.
<?php namespace Acme;
/**
* Class FooBar
*
* @link http://anomaly.is/foo-bar
* @author AnomalyLabs, Inc. <[email protected]>
* @author Ryan Thompson <[email protected]>
* @package Acme
*/