Leon Weemen

Software Developer @ SIMgroep

Craft Conference Budapest

Every once in a while I like to go to conferences, in November 2016 I went to mucon (check out the blogpost here), in October 2016 there was DOM Code and in June there is always the Dutch PHP Conference (a.k.a DPC). This year I wanted to visit a conference which I’ve never visited before so this year at the 24th of April I flew to Budapest for Craft Conference.

Craft Conference position their selfs as:

“CRAFT is about software craftsmanship, presenting which tools, methods, practices should be part of the toolbox of a modern developer and company, and serving as compass on new technologies, trends. You can learn from the best speakers and practitioners in our community” – Craft

This raises expectations of the workshops and the conference. Normally it makes me skeptical but I’ve heard a lot of good stories upfront so I took the risk.

Advanced Domain-Driven Design Workshop

The workshop I attended was the Advanced Domain-Driven Design Workshop by Nick Tune. I had chosen this workshop for several reasons but the most the important reason was that I wanted to practice and learn more about DDD. Nick Tune did not let me down, after forming groups we had to create a business model which is better then your competitors. Based on this model we had to various Domain Discovery exercises and Strategic Domain exercises on the different levels to explore and polish your model every time. I learned a lot this day.

Two days of presentations:

The session days were held at a train museum. The whole day you’re surrounded by big old locomotives. Everything at the conference is arranged for you, breakfast, lunch and even childcare! At the end of the first session day there was even dinner, drinks, a band and a coding dojo for people who energy left. About the talks: all the talks can be divided into three groups: Software (AWS, Machine Learning, Testing, etc), Operations (Docker, Kubernetes etc) and Soft skills (I’ve heard the term “team safety” a lot here). By far the most talks have a good level of quality and there is always something that could take back home. I personally enjoyed the hands on Elixir session with Claudio Ortolina, the “Fun With Dead Languages” talk by Damian Conway and the “Building Great Teams: Culture and Core Protocols” talk by Richard Kasperowski.

Time flies when you’re having fun, these days felt way too short for such an awesome conference. This is a conference that I can really recommend to any software developer out there in the field. I definitely want to go back next year.

Static Code Analysis with Vimeo Psalm and GrumPHP

Recently at my company we played around with static code analysers. What static code analysers basically do is what the name implies: doing code analysis like: Are there any unused methods? Are variables being used? Do closures have a return type?

For PHP there a few different code analysis tools like: PHPmd, Phan, Psalm. There are also SaaS solutions like Scutenizer-CI or SensioLabs Insight.

Although I’m a real fan of Scrutenizer-CI unfortunately I’m not allowed to use any SaaS solution at work so Scrutenizer and SensioLabs Insight were off the list.

We split the team into 3 groups and I started off with Phan but I wasn’t able to compile the ext-ast module so I switched over to Vimeo’s Psalm. Psalm is really easy to get started with.

    composer require --dev vimeo/psalm

Create a config file called psalm.xml like:





    
        
    
    
        
        
        
        
        
        
        
    

and then run:

./vendor/bin/psalm

or if you are using Symfony:

./bin/psalm

My first impression was that Psalm is responding aggressive on everything. My advice would be to take a good look at the configuration of psalm.

When you’re working on a project then you probably want to make sure that every new changed file is without code issues. By default Psalm cannot do this. You have two options:

  • Manually check each new file
  • Run the full scan on every file

Both options are not really doable. Luckily for us PHP developers there is a tool called GrumPHP. GrumPHP is a awesome tool made to do all kind of  checks on new and changed files. GrumPHP does not know yet how to deal Psalm by default. To resolve this issue I wrote a plugin called “grumphp-psalm“. It works very easy:

    composer require --dev weemen/grumphp-psalm

Open your grumphp.yml file and add:

parameters:
  git_dir: .
  bin_dir: bin
  tasks:
    psalm:
       config: psalm.xml
  extensions:
    - Weemen\GrumPHPPsalm\Extension\Loader

That’s all, GrumPHP will now do static analysis on every new or changed file when you try to commit it.

Blog has been born

Oh yeah blog has been born \m/

echo "hello world";

© 2017 Leon Weemen

Theme by Anders NorenUp ↑