Skip to content

2. Requirements

Marco Muths edited this page Apr 11, 2019 · 5 revisions

Externals

If you are not using the official docker image you will need need GraphViz for graph creation on your host, which is an open source graph visualization software and available for the most platforms.

Project to be analyzed

PHP is a dynamic language with a weak type system. It also contains a lot of statements, which resolves only in runtime. This tool is a static code analysis, thus it have some limitations. Here is a non-exhaustive list of unsupported php-features:

  • Dynamic features such as eval and $$x
  • Globals such as global $x;
  • Dynamic funcs such as call_user_func, call_user_func_array, create_function

This tool analyzes abstract datatypes, so your application must be written in OOP-Style using Namespaces.

For a better violaton detection between dependencies you should apply naming conventions. Each package should have an own namespace and same is true for each layer.

Naming convention example for an User-Package used in an Application

  • Namespace for Application Controllers: Application\Controller\..
  • Namespace for User Service: User\Service\..
  • Namespace for User Persistence Layer: User\Repository\..

In this case you can declare Controller with namespace Application\Controller to tell they are belonging to Application-Layer. Application-Layer is permitted to access to Service-Layer (User\Service-Namespace) and is not permitted to access Persistence Layer (User\Repository-Namespace).

Clone this wiki locally