profile
viewpoint
Peter Kruithof pkruithof Breda, NL

pkruithof/markdownify-bundle 3

Provides Symfony integration for the Markdownify/Markdownify_Extra scripts

pkruithof/dotfiles 2

My collection of dotfiles.

pkruithof/assert 0

Thin assertion library for use in libraries and business-model

pkruithof/command-extra-bundle 0

Symfony2 bundle which adds useful functionality for Commands

pkruithof/event-store-bus-bridge 0

Marry CQRS with Event Sourcing

pkruithof/event-store-client 0

PHP 7.2 Event Store Client Implementation

pkruithof/MixCloud-Desktop 0

MixCloud Desktop app with support for Play/Pause media keys

issue commentmallowigi/a-file-icon-idea

Selected directory icon barely visible

Works like a charm, thank you!

pkruithof

comment created time in 2 months

issue commentgoogleapis/google-cloud-php

[Firestore] Possible issues with transactions

We still need to look into the question about aborted transactions being replayed.

Indeed, is this also the reason the Transaction test is skipped?

pkruithof

comment created time in 2 months

created tagtreehouselabs/io-bundle

tagv3.1.1

Bundle that facilitates importing/exporting data

created time in 2 months

release treehouselabs/io-bundle

v3.1.1

released time in 2 months

Pull request review commenttreehouselabs/io-bundle

Fixed datetime transformer for invalid years

  namespace TreeHouse\IoBundle\Item\Modifier\Data\Transformer; -use TreeHouse\Feeder\Modifier\Data\Transformer\StringToDateTimeTransformer as FallbackTransformer;+use DateTime;+use TreeHouse\Feeder\Exception\TransformationFailedException; use TreeHouse\Feeder\Modifier\Data\Transformer\TransformerInterface;  class StringToDateTimeTransformer implements TransformerInterface {-    /**-     * @var \DateTimeZone-     */-    protected $timezone;+    /** @var \DateTimeZone */+    private $timezone;+    /** @var int */+    private $minYear;      /**      * @param \DateTimeZone $timezone      */-    public function __construct(\DateTimeZone $timezone = null)+    public function __construct(\DateTimeZone $timezone = null, int $minYear = 1900)     {         $this->timezone = $timezone ?: new \DateTimeZone('UTC');+        $this->minYear = $minYear;     }      /**      * @inheritdoc      */     public function transform($value)     {-        if (is_null($value) || empty($value)) {+        if (empty($value)) {             return null;         } -        if ($value instanceof \DateTime) {+        if ($value instanceof DateTime) {             return $value;         } -        // check if strtotime matches-        if (false !== strtotime($value)) {-            return new \DateTime($value, $this->timezone);+        try {+            $date = new DateTime($value, $this->timezone);+            if ((int) $date->format('Y') < $this->minYear) {+                throw new TransformationFailedException(+                    "The given date was older than the minimum year of {$this->minYear}: {$value}"+                );+            }++            return $date;+        } catch (\Exception $exception) {+            throw new TransformationFailedException(+                $exception->getMessage()+            );         }--        // last resort-        $transformer = new FallbackTransformer();

This basically already did the same thing.

pkruithof

comment created time in 2 months

Pull request review commenttreehouselabs/io-bundle

Fixed datetime transformer for invalid years

  namespace TreeHouse\IoBundle\Item\Modifier\Data\Transformer; -use TreeHouse\Feeder\Modifier\Data\Transformer\StringToDateTimeTransformer as FallbackTransformer;+use DateTime;+use TreeHouse\Feeder\Exception\TransformationFailedException; use TreeHouse\Feeder\Modifier\Data\Transformer\TransformerInterface;  class StringToDateTimeTransformer implements TransformerInterface {-    /**-     * @var \DateTimeZone-     */-    protected $timezone;+    /** @var \DateTimeZone */+    private $timezone;+    /** @var int */+    private $minYear;      /**      * @param \DateTimeZone $timezone      */-    public function __construct(\DateTimeZone $timezone = null)+    public function __construct(\DateTimeZone $timezone = null, int $minYear = 1900)     {         $this->timezone = $timezone ?: new \DateTimeZone('UTC');+        $this->minYear = $minYear;     }      /**      * @inheritdoc      */     public function transform($value)     {-        if (is_null($value) || empty($value)) {+        if (empty($value)) {             return null;         } -        if ($value instanceof \DateTime) {+        if ($value instanceof DateTime) {             return $value;         } -        // check if strtotime matches-        if (false !== strtotime($value)) {

This never worked for "invalid" dates like 0000-00-00 which for PHP is actually valid. Besides, the DateTime constructor already throws when the format is invalid.

pkruithof

comment created time in 2 months

create barnchtreehouselabs/io-bundle

branch : datetime-transformer-fix

created branch time in 2 months

issue commentmallowigi/a-file-icon-idea

Selected directory icon barely visible

What's interesting is that sometimes when I fiddle around with the icon/theme settings, it seems to (re)set some property and the arrow color stays the light grey it normally is. Only it does not stay that way for long. I'm trying to remember if the problem occurs again when I (re)start the IDE, or if it happens more randomly. I'll watch out for it and report back if I can.

In the meantime, is there anything else you need for this?

pkruithof

comment created time in 3 months

issue openedmallowigi/a-file-icon-idea

Selected directory icon barely visible

Hi, I'm not sure if this is the right place to raise this issue, but here goes:

The icon for a selected directory seems to get a different color, which is barely visible against the highlight color:

Not selected:

image

Selected:

image

Selected, but not active window:

image

I've tried all arrow styles, but they all have this problem. I'm using the Material Theme in combination with Darcula.

created time in 3 months

more