/** * Rendu d'un maker * * @param Maker $maker * @return string */ public function maker(Maker $maker) { $content = ''; // CONSTANT foreach ($maker->getConstants() as $name => $value) { $content .= sprintf('const %s = %s;', $name, $this->render('value', $value)) . PHP_EOL; } if (!empty($name)) { $content .= str_repeat(PHP_EOL, 2); } // PROPERTIES foreach ($maker->getProperties() as $property) { $content .= $this->render('property', $property) . str_repeat(PHP_EOL, 2); } // METHODS $methods = []; foreach ($maker->getMethods() as $method) { $methods[] = $this->render('method', $method); } $content .= implode(str_repeat(PHP_EOL, 2), $methods); // rendu globale $content = $this->render('maker_class', $maker, $content); return $content; }