Skip to content

Instantly share code, notes, and snippets.

@ebylund
Created July 9, 2015 19:56
Show Gist options
  • Save ebylund/2aa61cc22d18532cc12d to your computer and use it in GitHub Desktop.
Save ebylund/2aa61cc22d18532cc12d to your computer and use it in GitHub Desktop.
<?php
require __DIR__.'/vendor/autoload.php';
use Memio\Memio\Config\Build;
use Memio\Model\File;
use Memio\Model\Object;
use Memio\Model\Property;
use Memio\Model\Method;
use Memio\Model\Argument;
use Symfony\Component\Yaml\Yaml;
//Describe the code you want to generate using "Models"
$methodName = "__construct";
$method = new Method($methodName);
for ($i = 1; $i < 14; $i++){
$method->addArgument(new Argument('string', 'arg'.$i));
}
$prettyPrinter = Build::prettyPrinter();
echo "\n\n";
echo $prettyPrinter->generateCode($method);
echo "\n\n\n\n";
// ******************************************************************//
$superMethod = Method::make('supHomie')
->makePrivate()
;
echo $prettyPrinter->generateCode($superMethod);
echo "\n\n\n\n";
// ******************************************************************//
$array = Yaml::parse(file_get_contents('model.yaml'));
echo Yaml::dump($array);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment