What’s new in PHP7.1
Introduction If you have not read yet our blog post about new features in PHP7, we highly recommend to do so before continue reading. In this post we’re going to…
Introduction If you have not read yet our blog post about new features in PHP7, we highly recommend to do so before continue reading. In this post we’re going to…
Haven’t you switched to PHP7 yet? If not, you should read “How Badoo saved one million dollars switching to PHP7” and consider to change your version. Moreover, remind to update at least to…
Suppose that we have a value object or, more in general, an object where its data has been set in the constructor
1 2 3 4 5 6 7 8 9 10 11 |
class Foo { protected $bar; protected $foobar; public function construct($bar, $foobar) { // .... } } |
and its FormType
1 2 3 4 5 6 7 8 9 10 11 |
class FooType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options) { $builder ->add('bar') ->add('foobar'); } // ... } |
Let’s assume that bar and foobar are taken from HTTP…
Saturday the 15th of October we leaved the comfort of our couches (have we already said we are a distributed team from all around Italy?) to leave to the glorious…
In the Scaling Symfony sessions with Memcached article we focused on scaling our Symfony session with Memcached. Memcached is very easy to set-up and use but it lacks of persistence and some…
Getting informations on a running instance from the inside is a tedious task and it’s usually done in an insecure and error prone way. With this article we want to…
What this code does?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
class DateTimeInterval { private $from; private $to; private $allDayLong; public function setFrom(\DateTime $from) { if ($this->isAllDayLong()) { $from->setTime(0, 0, 0); } $this->from = $from; return $this; } public function getFrom() { ... } // omitted public function setTo(\DateTime $to) { if ($this->isAllDayLong()) { $to->setTime(23, 59, 59); } $this->to = $to; return $this; } public function getTo() { ... } // omitted public function allDayLong() { $this->allDayLong = true; } public function isAllDayLong() { return $this->allDayLong; } } |
It’s a simple class that represent a DateTimeInterval with a flag named allDayLong that let an object of DateTimeInterval class to fill all day. You can see that…
It’s said necessity is the mother of invention and in this article we’ll show the reason why we initially wrote s3-pit-restore. Our infrastructure heavily rely on S3 object storage to…
Sometimes happens, as it happened to us, that you have one or more services you want to share between your VPCs. For us, the case was for an ELK stack…
If you know PHPSpec a bit, you certainly are aware of let function.
1 2 3 4 |
function let(EntityManager $em) { $this->beConstructedWith($em); } |
that helps you to define “automagic” mocks handled directly by PHPSpec and that you can pass to…
AWS is well known for its cloud services for almost everything you need in a cloud environment. As Madisoft we like them a lot and we use many of them…
Good news mates: we were selected as speakers for Symfony Day 2016 (Italy) that will take place in Rome (tickets available here). Samuele and Matteo sent out their talk proposals and both were…