@@ -139,7 +139,7 @@ |
||
139 | 139 | // find reflexive many-to-many relationships |
140 | 140 | if ($relationship->getType() == Relationship::MANY_TO_MANY && $relationship->isReflexive()) { |
141 | 141 | $prop = NameUtils::toCamelCase($relationship->getRelatedPluralName()); |
142 | - $inverses[$prop] = '\''.NameUtils::toCamelCase($relationship->getReverseRelatedPluralName()) . '\''; |
|
142 | + $inverses[$prop] = '\'' . NameUtils::toCamelCase($relationship->getReverseRelatedPluralName()) . '\''; |
|
143 | 143 | } |
144 | 144 | } |
145 | 145 |
@@ -9,6 +9,9 @@ |
||
9 | 9 | |
10 | 10 | class EmberModelGenerator extends AbstractEmberGenerator { |
11 | 11 | |
12 | + /** |
|
13 | + * @return string |
|
14 | + */ |
|
12 | 15 | public function generate(Table $model) { |
13 | 16 | $class = new EmberClassGenerator('Model'); |
14 | 17 | $class->addImport('Model', 'ember-data/model'); |
@@ -126,7 +126,7 @@ |
||
126 | 126 | $types = ['module', 'app']; |
127 | 127 | $question = new Question('Package type (module|app)', $type); |
128 | 128 | $question->setAutocompleterValues($types); |
129 | - $question->setValidator(function($answer) use ($types) { |
|
129 | + $question->setValidator(function ($answer) use ($types) { |
|
130 | 130 | if (!in_array($answer, $types)) { |
131 | 131 | throw new \RuntimeException('The name of the type should be one of: ' . |
132 | 132 | implode(',', $types)); |
@@ -34,7 +34,7 @@ |
||
34 | 34 | $this->setDispatcher($dispatcher); |
35 | 35 | $this->keekoDispatcher = $dispatcher; |
36 | 36 | |
37 | - $dispatcher->addListener(ConsoleEvents::TERMINATE, function(ConsoleTerminateEvent $event) { |
|
37 | + $dispatcher->addListener(ConsoleEvents::TERMINATE, function (ConsoleTerminateEvent $event) { |
|
38 | 38 | $command = $event->getCommand(); |
39 | 39 | $this->finishedCommands[] = $command->getName(); |
40 | 40 | }); |
@@ -36,10 +36,10 @@ |
||
36 | 36 | $name = $split; |
37 | 37 | } else { |
38 | 38 | $name .= '_' . $split; |
39 | - $idColumns []= $split . '_id'; |
|
39 | + $idColumns [] = $split . '_id'; |
|
40 | 40 | } |
41 | 41 | |
42 | - $idColumns []= $name . '_id'; |
|
42 | + $idColumns [] = $name . '_id'; |
|
43 | 43 | } |
44 | 44 | } |
45 | 45 |
@@ -10,11 +10,9 @@ |
||
10 | 10 | use keeko\tools\generator\responder\TwigHtmlResponderGenerator; |
11 | 11 | use keeko\tools\generator\Types; |
12 | 12 | use keeko\tools\helpers\QuestionHelperTrait; |
13 | -use keeko\tools\model\Relationship; |
|
14 | 13 | use keeko\tools\ui\ResponseUI; |
15 | 14 | use keeko\tools\utils\NamespaceResolver; |
16 | 15 | use phootwork\collection\Set; |
17 | -use phootwork\file\File; |
|
18 | 16 | use phootwork\lang\Text; |
19 | 17 | use Symfony\Component\Console\Input\InputArgument; |
20 | 18 | use Symfony\Component\Console\Input\InputInterface; |
@@ -246,6 +246,9 @@ |
||
246 | 246 | return $action; |
247 | 247 | } |
248 | 248 | |
249 | + /** |
|
250 | + * @param string $type |
|
251 | + */ |
|
249 | 252 | private function generateRelationshipAction(Relationship $relationship, $type) { |
250 | 253 | $model = $relationship->getModel(); |
251 | 254 | $module = $this->package->getKeeko()->getModule(); |
@@ -11,6 +11,9 @@ |
||
11 | 11 | return this.get(\'session\').hasPermission(\'%s\', \'%s\'); |
12 | 12 | })'; |
13 | 13 | |
14 | + /** |
|
15 | + * @return string |
|
16 | + */ |
|
14 | 17 | public function generate(Table $model) { |
15 | 18 | $class = new EmberClassGenerator('Ability'); |
16 | 19 | $class->addImport('Ember', 'ember'); |
@@ -10,7 +10,6 @@ |
||
10 | 10 | use keeko\tools\generator\responder\TwigHtmlResponderGenerator; |
11 | 11 | use keeko\tools\generator\Types; |
12 | 12 | use keeko\tools\helpers\QuestionHelperTrait; |
13 | -use keeko\tools\model\Relationship; |
|
14 | 13 | use keeko\tools\ui\ResponseUI; |
15 | 14 | use keeko\tools\utils\NamespaceResolver; |
16 | 15 | use phootwork\collection\Set; |
@@ -12,6 +12,9 @@ discard block |
||
12 | 12 | private $imports; |
13 | 13 | private $properties; |
14 | 14 | |
15 | + /** |
|
16 | + * @param string $parent |
|
17 | + */ |
|
15 | 18 | public function __construct($parent = null) { |
16 | 19 | $this->imports = new ArrayList(); |
17 | 20 | $this->properties = new Map(); |
@@ -23,10 +26,18 @@ discard block |
||
23 | 26 | $this->parent = $parent; |
24 | 27 | } |
25 | 28 | |
29 | + /** |
|
30 | + * @param string $import |
|
31 | + * @param string $from |
|
32 | + */ |
|
26 | 33 | public function addImport($import, $from) { |
27 | 34 | $this->imports->add(['import' => $import, 'from' => $from]); |
28 | 35 | } |
29 | 36 | |
37 | + /** |
|
38 | + * @param string $property |
|
39 | + * @param string $value |
|
40 | + */ |
|
30 | 41 | public function setProperty($property, $value) { |
31 | 42 | $this->properties->set($property, $value); |
32 | 43 | } |
@@ -6,6 +6,9 @@ |
||
6 | 6 | |
7 | 7 | class EmberSerializerGenerator extends AbstractEmberGenerator { |
8 | 8 | |
9 | + /** |
|
10 | + * @return string |
|
11 | + */ |
|
9 | 12 | public function generate(Table $model) { |
10 | 13 | $filter = $this->generatorDefinitionService->getWriteFilter($model); |
11 | 14 | if (count($filter) == 0) { |