This repository was archived by the owner on Nov 9, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathrun.php
More file actions
executable file
·37 lines (30 loc) · 1.33 KB
/
run.php
File metadata and controls
executable file
·37 lines (30 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env php
<?php
if (!file_exists(__DIR__ . '/../vendor/autoload.php')) {
die(
'You need to set up the project dependencies using the following commands:' . PHP_EOL .
'wget https://getcomposer.org/composer.phar' . PHP_EOL .
'php composer.phar install' . PHP_EOL
);
}
require __DIR__ . '/../vendor/autoload.php';
require __DIR__ . '/autoload.php';
$parser = new SpecificationParser(new SpecificationFilename);
$className = $parser->getClassName();
$abstractClassName = $parser->getAbstractClassName();
$interfaceName = $parser->getInterfaceClassName();
$operations = $parser->getOperations();
$queries = $parser->getQueries();
$states = $parser->getStates();
$generator = new InterfaceGenerator;
$generator->generate($operations, $interfaceName);
$generator = new AbstractStateClassGenerator;
$generator->generate($operations, $abstractClassName, $interfaceName);
$generator = new ClassGenerator;
$generator->generate($operations, $states, $className, $interfaceName);
$codeGenerator = new StateClassGenerator;
$testGenerator = new TestGenerator;
foreach ($states as $state => $data) {
$codeGenerator->generate($data, $state, $abstractClassName);
$testGenerator->generate($data, $operations, $queries, $states, $state, $className, $abstractClassName);
}