Loading code/test6.php +11 −45 Changes for code/test6.php: 11 added lines, 45 removed lines. Original line number Diff line number Diff line Loading @@ -8,52 +8,18 @@ * @var $viewFile string */ //\UnicaenCode\Util::run('NewService', ['class' => 'Intervenant\Service\ExempleService', 'awareTrait' => false, 'useGetter' => false, 'factory' => false]); $introspection = \UnicaenCode\Util::introspection(); $traits = $introspection->getTraits(); $rc = new ReflectionClass(\Application\View\Helper\AgrementViewHelper::class); $rm = $rc->getMethod('__invoke'); $d = \UnicaenCode\Util::getMethodDocDeclaration($rm); var_dump($d); return; $classes = \UnicaenCode\Util::introspection()->getClasses('Application'); //var_dump($classes); foreach ($classes as $class => $file) { if (trait_exists($class)) { if ('AwareTrait' === substr($class, -10)) { $c = new ReflectionClass($class); $ms = $c->getMethods(); foreach ($ms as $m) { if (0 === strpos($m->getName(), 'get')) { $refClass = null; if ($m->getReturnType()) { $refClass = $m->getReturnType()->getName(); } else { $dc = $m->getDocComment(); if (false !== strpos($dc, '@return')) { $deb = strpos($dc, '@return') + 8; $type = substr($dc, $deb); $type = trim(substr($type, 0, strpos($type, "\n"))); $ns = \UnicaenCode\Util::classNamespace($class); if ('\Traits' === substr($ns, -7)) { $ns = substr($ns, 0, -7); } $refClass = $ns . "\\" . $type; } } if (!$refClass) { echo '<h2>' . $class . '</h2>'; echo '<div class="bg-danger">Type de retour INCONNU</div>'; } } } } foreach ($traits as $trait) { $params = $introspection->getTraitParams($trait); if ($params['aware']) { var_dump($params); } \UnicaenCode\Util::codeGenerator()->generer('awareTrait', [ 'class' => $trait['targetClass'], 'useGetter' => true, 'subDir' => $params['subDir'], ]); } No newline at end of file composer.lock +4 −4 Changes for composer.lock: 4 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -6857,7 +6857,7 @@ "source": { "type": "git", "url": "https://git.unicaen.fr/lib/unicaen/app.git", "reference": "61000315f7bf98c6870ef37e386704e681b14275" "reference": "8e620328723c25a1b7f6a8f4cc910d410e217c42" }, "require": { "beberlei/assert": "^3.3", Loading Loading @@ -6914,7 +6914,7 @@ ] }, "description": "Module de base des applications unicaen", "time": "2022-01-10T10:06:47+00:00" "time": "2022-01-31T09:45:35+00:00" }, { "name": "unicaen/auth", Loading Loading @@ -7016,7 +7016,7 @@ "source": { "type": "git", "url": "https://git.unicaen.fr/lib/unicaen/code.git", "reference": "e3ae361e8b847f467ff994de65fe5765f3aaa396" "reference": "e51ac4a52ba3b41a74ab96eff89817ef8ab4d7ff" }, "require": { "easybook/geshi": ">=1.0", Loading @@ -7034,7 +7034,7 @@ ] }, "description": "Boite à outils pour la programmation avec la bibliothèque Unicaen", "time": "2022-01-27T08:06:47+00:00" "time": "2022-01-31T09:45:09+00:00" }, { "name": "unicaen/console", Loading module/Intervenant/src/Controller/StatutController.php +3 −1 Changes for module/Intervenant/src/Controller/StatutController.php: 3 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ namespace Intervenant\Controller; use Application\Cache\Traits\CacheContainerTrait; use Application\Controller\AbstractController; use Intervenant\Entity\Db\Statut; use Application\Provider\Privilege\Privileges; use Intervenant\Form\StatutSaisieFormAwareTrait; Loading @@ -16,7 +17,8 @@ use Laminas\View\Model\ViewModel; class StatutController extends AbstractController { use StatutServiceAwareTrait; use StatutSaisieFormAwareTrait; //use StatutSaisieFormAwareTrait; use TypeIntervenantServiceAwareTrait; use CacheContainerTrait; use DossierAutreServiceAwareTrait; Loading Loading
code/test6.php +11 −45 Changes for code/test6.php: 11 added lines, 45 removed lines. Original line number Diff line number Diff line Loading @@ -8,52 +8,18 @@ * @var $viewFile string */ //\UnicaenCode\Util::run('NewService', ['class' => 'Intervenant\Service\ExempleService', 'awareTrait' => false, 'useGetter' => false, 'factory' => false]); $introspection = \UnicaenCode\Util::introspection(); $traits = $introspection->getTraits(); $rc = new ReflectionClass(\Application\View\Helper\AgrementViewHelper::class); $rm = $rc->getMethod('__invoke'); $d = \UnicaenCode\Util::getMethodDocDeclaration($rm); var_dump($d); return; $classes = \UnicaenCode\Util::introspection()->getClasses('Application'); //var_dump($classes); foreach ($classes as $class => $file) { if (trait_exists($class)) { if ('AwareTrait' === substr($class, -10)) { $c = new ReflectionClass($class); $ms = $c->getMethods(); foreach ($ms as $m) { if (0 === strpos($m->getName(), 'get')) { $refClass = null; if ($m->getReturnType()) { $refClass = $m->getReturnType()->getName(); } else { $dc = $m->getDocComment(); if (false !== strpos($dc, '@return')) { $deb = strpos($dc, '@return') + 8; $type = substr($dc, $deb); $type = trim(substr($type, 0, strpos($type, "\n"))); $ns = \UnicaenCode\Util::classNamespace($class); if ('\Traits' === substr($ns, -7)) { $ns = substr($ns, 0, -7); } $refClass = $ns . "\\" . $type; } } if (!$refClass) { echo '<h2>' . $class . '</h2>'; echo '<div class="bg-danger">Type de retour INCONNU</div>'; } } } } foreach ($traits as $trait) { $params = $introspection->getTraitParams($trait); if ($params['aware']) { var_dump($params); } \UnicaenCode\Util::codeGenerator()->generer('awareTrait', [ 'class' => $trait['targetClass'], 'useGetter' => true, 'subDir' => $params['subDir'], ]); } No newline at end of file
composer.lock +4 −4 Changes for composer.lock: 4 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -6857,7 +6857,7 @@ "source": { "type": "git", "url": "https://git.unicaen.fr/lib/unicaen/app.git", "reference": "61000315f7bf98c6870ef37e386704e681b14275" "reference": "8e620328723c25a1b7f6a8f4cc910d410e217c42" }, "require": { "beberlei/assert": "^3.3", Loading Loading @@ -6914,7 +6914,7 @@ ] }, "description": "Module de base des applications unicaen", "time": "2022-01-10T10:06:47+00:00" "time": "2022-01-31T09:45:35+00:00" }, { "name": "unicaen/auth", Loading Loading @@ -7016,7 +7016,7 @@ "source": { "type": "git", "url": "https://git.unicaen.fr/lib/unicaen/code.git", "reference": "e3ae361e8b847f467ff994de65fe5765f3aaa396" "reference": "e51ac4a52ba3b41a74ab96eff89817ef8ab4d7ff" }, "require": { "easybook/geshi": ">=1.0", Loading @@ -7034,7 +7034,7 @@ ] }, "description": "Boite à outils pour la programmation avec la bibliothèque Unicaen", "time": "2022-01-27T08:06:47+00:00" "time": "2022-01-31T09:45:09+00:00" }, { "name": "unicaen/console", Loading
module/Intervenant/src/Controller/StatutController.php +3 −1 Changes for module/Intervenant/src/Controller/StatutController.php: 3 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ namespace Intervenant\Controller; use Application\Cache\Traits\CacheContainerTrait; use Application\Controller\AbstractController; use Intervenant\Entity\Db\Statut; use Application\Provider\Privilege\Privileges; use Intervenant\Form\StatutSaisieFormAwareTrait; Loading @@ -16,7 +17,8 @@ use Laminas\View\Model\ViewModel; class StatutController extends AbstractController { use StatutServiceAwareTrait; use StatutSaisieFormAwareTrait; //use StatutSaisieFormAwareTrait; use TypeIntervenantServiceAwareTrait; use CacheContainerTrait; use DossierAutreServiceAwareTrait; Loading