Download the PHP package smeghead/php-class-diagram without Composer

On this page you can find all versions of the php package smeghead/php-class-diagram. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-class-diagram

php-class-diagram

A CLI tool that parses the PHP source directory and generates PlantUML class diagram scripts as output.

Testing Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

Features

What is PlantUML

PlantUML - Wikipedia PlantUML is an open-source tool allowing users to create diagrams from a plain text language. Besides various UML diagrams, PlantUML has support for various other software development related formats (such as Archimate, Block diagram, BPMN, C4, Computer network diagram, ERD, Gantt chart, Mind map, and WBD), as well as visualisation of JSON and YAML files.

Hypermedia Feature

One of the standout features of this tool is the ability to generate class diagrams with clickable links that navigate directly to the source code of those classes. This transforms the diagrams into interactive hypermedia tools, enhancing the understanding of the source code visually and interactively.

To enable this feature, generate the diagrams in SVG format and use the --svg-topurl option to specify the base URL for the links:

To embed the SVG diagrams in HTML while preserving the clickable links, use the embed or object tags instead of img. Here’s an example:

This ensures that the SVG image is responsive and the hyperlinks remain functional.

Hypermedia example

Dogfooding

php-class-diagram class diagram (linked SVG file)

php-class-diagram class diagram without fields and methods

If your analysis primarily focuses on the relationships between classes, a simpler notation may be more appropriate.

php-class-diagram package related diagram

Visualizing package relationships can uncover critical design issues.

Install

From DockerHub

You can utilize a Docker image that includes php-class-diagram and PlantUML from the following URL.

From Composer

Now, you can execute ./vendor/bin/php-class-diagram. For instance, try to display help message.

How to execute

Class Diagram

If there are three PHP source files in the directory test/fixtures/no-namespace each with a TYPE comment,

Executing php-class-diagram will output the PlantUML script.

Use PlantUML to convert the PlantUML script to an image.

option header

You can specify the string to be output to the PlantUML header.

option include

You can add patterns to specify the target files for processing.

option exclude

You can specify patterns to exclude files from the processing. If you want to ignore a folder, you must specify the relative path to the target php source directory.

option rel-target

If there are a very large number of target classes, the class diagram will be cumbersome and difficult to understand. In such a case, you can specify the classes you want to study in the --rel-target field to generate a class diagram for only the related classes. By using --rel-target-from and --rel-target-to, it is also possible to further narrow down the list according to the direction of dependencies.

Package Diagram

You can visualize package dependencies by creating a package relationship diagram using php-class-diagram.

Packages that depend on each other are undesirable. If the tool detects such dependencies, it will issue a warning with a thick red line.

Division Diagram

If you are utilizing the Enum feature introduced in PHP 8.1, you can generate the division diagram. Visualizing the divisions employed in the program can be beneficial for research and design purposes.

GitHub Actions support

The following repository provides actions for generating class diagrams using php-class-diagram in GitHub Actions workflows.

smeghead/php-class-diagram-gh-action

Development

Open shell

install dependencies

execute tests

CONTRIBUTING

Both Issues and Pull Requests are welcome!


All versions of php-class-diagram with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
symfony/finder Version ^5.3|^6.0|^7.0
nikic/php-parser Version ^5.2
phpstan/phpdoc-parser Version ^1.30
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package smeghead/php-class-diagram contains the following files

Loading the files please wait ....