Politics, Sociology, Firefighting, Technology, and Original Fiction

Tag: PHP

New EventServiceProvider Location For Lumen 5.2

This is as much a note to myself as anything, but if you have recently tried to update a project that was using Lumen 5.1 to use Lumen 5.2, you might get an error that Illuminate\Foundation\Support\Providers\EventServiceProvider can no longer be found.

The problem is explicit in the error, thankfully: the class can no longer be found. The question then is, where has that file gone?

Read More

Simple PHP Getter/Setter Snippet For Sublime Text

The following snippet is what I use in PHP when I am building out a class and need to quickly and easily flesh out the getters and setters for my protected and private variables:

To use this snippet yourself, throw it in a text file named getter-setter.sublime-snippet and put it in the folder where your user preferences are stored. For reference, on OSX the default location should be ~/Library/Application Support/Sublime Text 3/Packages/User/.

Read More

Get Fully Qualified Class Name From File Contents In PHP

Ever needed to get the name of a class from a file without actually loading that file in PHP? Probably not – I’ll admit it’s kind of a super edgy edge case. Nonetheless, it’s an interesting problem, and I ran into it working on some migration scripts for a project. So, for the sake of my own memory, I thought I would put together this quick little write-up. Hopefully it helps someone else out as well.

Read More

Gitlab CI PHPUnit Test Coverage Parsing

Test Coverage Parsing

If you use Gitlab CI (and I suggest you do if you are using Gitlab already), you may have noticed in the settings that there is an item titled “Test coverage parsing”.

It looks a little something like this:Screen Shot 2015-04-12 at 10.09.51 PM

This feature allows you to give Gitlab CI a regex that will parse the output of your test runner and grab what percentage of your code is covered by your unit tests. The resulting percentage will then display for each individual build in your list of builds.

I know for me, having this displayed in my face helps add that extra bit of incentive to write some more tests.

Read More

Powered by WordPress & Theme by Anders Norén