Giter Site home page Giter Site logo

object-graph's Introduction

Hi!

I am Sebastian Bergmann. If you develop software using the PHP programming language then you may have come across my name. I am the creator and maintainer of PHPUnit as well as many other libraries and tools that are commonly used.


๐Ÿ‘ท Check out what I'm currently working on


๐Ÿ”ญ Latest releases I've contributed to


๐Ÿ“ซ How to reach me

object-graph's People

Contributors

localheinz avatar om4csaba avatar sebastianbergmann avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

object-graph's Issues

Mention dot and graphviz

You should probably mention graphviz to actually make use of the dot file to generate a PNG from object_graph_dump() method.

People need e.g.

sudo apt install graphviz

and otherwise get sh: 1: dot: not found

Build automation

  • Have Composer in tools/composer and managed through composer self-update (see update-tools target in build.xml
  • Install Psalm using Phive as tools/psalm (phive install --copy psalm)
  • Install PHP-CS-Fixer using Phive as tools/php-cs-fixer (phive install --copy php-cs-fixer)
  • Create Psalm configuration
  • Add Psalm build step to GitHub Actions-based CI workflow
  • Add PHP-CS-Fixer build step to GitHub Actions-based CI workflow

DotWriter does not escape attribute values

Hello.

I'm debugging this in a docker container so I haven't got very far yet, but my experimentation is showing that if an object property contains a PHP tag then the rendering will fail.

Demo Script

<?php

require_once __DIR__ . '/../vendor/autoload.php';

use function SebastianBergmann\ObjectGraph\object_graph_dump;

class ExampleBreakage
{
    protected $property = '<?';
}

object_graph_dump(__DIR__ . '/graph.png', new ExampleBreakage());

exit(0);

Demo Script Output

Error: /tmp/object_graph_dumpYXT0TI: syntax error in line 8 near ''

Is it possible this tag is being parsed erroneously somehow? The script runs properly when I change the property value from <? to hello_world.

Support \SplObjectStorage like attributes expand

Demo code:

class Test
{
    protected $elements;
    
    public function __construct()
    {
        $this->elements = new \SplObjectStorage();
    }
    
    public function add($object, $info = [])
    {
        $this->elements->attach($object, $info);
    }
}

class Item { protected $name = 'name'; }

$test = new Test();
$test->add(new Item(), ['order' => 1]);
$test->add(new Item(), ['order' => 2]);

object_graph_dump('a.png', $test);

the result:
image

Maybe the \SplObjectStorage can be expanded to display is better ๐Ÿ˜„

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.