Blog

Anzeige der Einträge mit Tag 'php'

Late Static Binding Mocking Problem

In a recent attempt to upgrade Disco to the latest version of ProxyManager I ran into this FATAL ERROR: "Declaration of Mock_ClassGenerator_f7ebad25::setExtendedClass($extendedClass): ProxyManager\Generator\ClassGenerator must be compatible with ProxyManager\Generator\ClassGenerator::setExtendedClass($extendedClass): Zend\Code\Generator\ClassGenerator" when I tried to execute the unit tests. It took me a while to understand the source of the problem, thus I think sharing the problem might help my future me and probably you as well. Let's assume you have two classes The_Parent and The_Child:

mehr lesen...


Verfasst von Stephan Hochdörfer am 18.05.2017 | 0 Kommentare

Mocking callables in an Expressive app

While working with Zend Expressive, a PSR-7 middleware microframework, I wanted to apply some unit testing with a nice coverage to my middlewares. Middlewares are called by the __invoke method if you provide them as an object and not as a closure. The signature of the __invoke method looks like this:

mehr lesen...


Verfasst von Florian Horn am 26.04.2017 | 0 Kommentare

method_exists vs. is_callable

As it turns out method_exists and is_callable work slightly different and you might not be aware of it. I figured this out last year when I introduced protected methods in the config classes of bitexpert/disco. Recently I saw a similar issue in another open-source project and thought it might be a good idea to share my findings with the world.

mehr lesen...


Verfasst von Stephan Hochdörfer am 27.01.2017 | 0 Kommentare

Announcing Disco 0.6.0

Beginning of this week I was finally able to release a new version of Disco which comes with one major change besides from the fact that I rewrote the generator logic for the bean methods and fix a few edge-case issues in the bean creation process.

mehr lesen...


Verfasst von Stephan Hochdörfer am 09.11.2016 | 0 Kommentare

Announcing Disco 0.5.0

Yesterday I was finally able to release a new version of Disco which comes with 4 major changes that I want to highlight briefly in this blog post.

mehr lesen...


Verfasst von Stephan Hochdörfer am 02.09.2016 | 0 Kommentare

Delivering files with PSR-7

When it comes to reading and returning the contents of a file in a PSR-7 middleware most developers seem use code that does the following: Read the file first, then write it to the response body.

mehr lesen...


Verfasst von Stephan Hochdörfer am 09.08.2016 | 0 Kommentare

Having fun with PSR-7

When I came up with the idea to build a PSR-7 based flat-file CMS I thought that it must be fairly trivial to build a static page exporter by simply "faking" requests and storing the resulting responses. Turns out I was right and this an quick recap of what I did ;)

mehr lesen...


Verfasst von Stephan Hochdörfer am 25.07.2016 | 0 Kommentare

Hello addItEasy 0.1.0!

I was looking for a way to show how our libraries like Adrenaline, Pathfinder and Disco work in a "real world" application. I came up with the idea to build just another simple flat-file CMS. AddItEasy might be the first flat-file CMS based on a PSR-7 implementation which adds a nice touch: We can easily create a static file export from the content. That means that you do not need to upload addItEasy to your server, you can simply export the files and e.g. let GitHub host the static HTML pages.

mehr lesen...


Verfasst von Stephan Hochdörfer am 19.07.2016 | 0 Kommentare

Announcing Adrenaline v0.1.0

In the course of polishing the Adroit v.0.4.0 release we realized that it would totally make sense to turn Adroit into an own separate (micro) web framework to be able to set up projects quickly. Whilst the focus of Adroit was to provide a PSR-7 compatible middleware for ADR we came up with the idea to create a separate package which we named Adrenaline.

mehr lesen...


Verfasst von Peter Hildenbrand am 15.07.2016 | 0 Kommentare

Announcing Adroit v0.4.0

Over the course of the last few months we worked hard to improve our Adroit middleware. The result is the recently released version v0.4.0 which turned Adroit into a "real" ADR / PSR-7 middleware. We extracted the routing component into a separate package called Pathfinder and splitted "monolithic" middleware into smaller components. In addition to that we introduced the concept of several hooks to be able to add "custom logic" in between the execution of the different steps in the ADR workflow.

mehr lesen...


Verfasst von Peter Hildenbrand am 12.07.2016 | 0 Kommentare