Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

License

NotificationsYou must be signed in to change notification settings

micoli/symfony-cartography

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

testslint

The aim of this bundle is to:

  • provide an analysis of your project code bases (classes, class categorization, method calls to other service/class)
  • draw a map of all possible method calls from and to a specific class::method. be ware that this map is calculated through static analysis, it's not the classes:methods called during a specific execution, it's all the possible calls from and to a class:method

toolbar

Requirements

  • PHP 8.1.0 or higher;
  • PDO-SQLite PHP extension enabled for development;

Installation

composer require --dev micoli/symfony-cartography
  • add the line inconfig\bundles.php
Micoli\SymfonyCartography\SymfonyCartographyBundle::class => ['dev' => true, 'test' => true],`
  • add a route inconfig/routes.yaml
when@dev:    _symfony_cartography:        resource: '@SymfonyCartographyBundle/Resources/config/routes.yaml'        prefix: /_cartography
  • and createconfig/packages/symfony_cartography.yaml
symfony_cartography:  enabled: true  sources:    - '%kernel.project_dir%/src'  filters:    classes:      rules:        - '+App\' # all classes in namespace 'App\' will be excluding        - '-App\Domain\DataFixtures' # except those starting by 'App\Domain\DataFixtures'    method_calls:      exclude_loopback: true #display sameClasse to sameClasse arrows      rules:      - '-Twig\' # do not display call towards classes in 'twig' namespace      - '-ReflectionFunctionAbstract'      - '-Doctrine\'      - '-Symfony\'      - '-Webmozart\'      - '-Psr\'  messenger_dispatchers: # Class/Method used to wire event trough messenger buses    - class: App\Infrastructure\Bus\MessengerCommandBus      method: dispatch    - class: App\Infrastructure\Bus\MessengerEventDispatcher      method: dispatch  graph:    engine: visjs # visjs|plantuml|cytoscape    engine_uri: https://kroki.io/plantuml/svg#    engine_uri: http://127.0.0.1:8080/svg # if local plantuml server    withMethodDisplay: false # display methods in classes    withMethodArrows: false # if disabled, only one arrow from a class to another is draw    leftToRightDirection: false # if disabled graph is drawn top to bottom, else it is draw left To Right  colors: # colors used in graph      - class: !php/enum Micoli\SymfonyCartography\Service\Categorizer\ClassCategory::undefined        color: '#033270'      - class: !php/enum Micoli\SymfonyCartography\Service\Categorizer\ClassCategory::doctrineEntity        color: '#1368aa'      - class: !php/enum Micoli\SymfonyCartography\Service\Categorizer\ClassCategory::controller        color: '#4091c9'      - class: !php/enum Micoli\SymfonyCartography\Service\Categorizer\ClassCategory::messengerCommandHandler        color: '#9dcee2'      - class: !php/enum Micoli\SymfonyCartography\Service\Categorizer\ClassCategory::messengerEventListener        color: '#fedfd4'      - class: !php/enum Micoli\SymfonyCartography\Service\Categorizer\ClassCategory::messengerEvent        color: '#f29479'      - class: !php/enum Micoli\SymfonyCartography\Service\Categorizer\ClassCategory::messengerCommand        color: '#f26a4f'      - class: !php/enum Micoli\SymfonyCartography\Service\Categorizer\ClassCategory::symfonyConsoleCommand        color: '#ef3c2d'      - class: !php/enum Micoli\SymfonyCartography\Service\Categorizer\ClassCategory::symfonyEventListener        color: '#cb1b16'      - class: !php/enum Micoli\SymfonyCartography\Service\Categorizer\ClassCategory::doctrineRepository        color: '#65010c'      - class: !php/enum Micoli\SymfonyCartography\Service\Categorizer\ClassCategory::symfonyEvent        color: '#f29479'

Usage

  • inwebProfiler toolbar you can see a preview of the call graph from the current controllertoolbar

  • inwebProfiler page a new section calledcartography is presenttoolbar

  • To clear inner psalm cache and refresh analysedCodebasebin/console code:cartography --force

AnalysingenrichedClasses: 56methods: 25method calls: 73interfaceImplements: 34classInterfaces: 35Analyse done
  • To use a local instance of plantumldocker run -d -p 8080:8080 plantuml/plantuml-server:jettyand inconfig/packages/symfony_cartography.yamlset

    symfony_cartography:  graph:    engine: plantuml    engine_uri: http://127.0.0.1:8080/svg
  • else to use a public instance of kroki

    symfony_cartography:  graph:    engine: plantuml    engine_uri: https://kroki.io/plantuml/svg
  • Tests


Execute this command to run tests:

$ make tests-all

Todo


  • manage symfony events and handler
  • manage symfony services
  • indirect from interfaces or use service definitions
  • get called tree and calling tree

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp