Skip to content

Instantly share code, notes, and snippets.

View domagoj03's full-sized avatar

Domagoj Blazonija domagoj03

  • Orioly, Inc.
  • Zagreb, Croatia
View GitHub Profile
@domagoj03
domagoj03 / get-form-validation-errors.ts
Created October 14, 2019 09:15 — forked from JohannesHoppe/get-form-validation-errors.ts
Get all validation errors for Angular FormGroup
import {FormGroup, ValidationErrors} from '@angular/forms';
export interface IFormError {
control: string;
error: string;
value: any;
}
export function getFormValidationErrors(form: FormGroup) {
const result = [];
@domagoj03
domagoj03 / FinalClass.php
Created July 16, 2018 12:10 — forked from DragonBe/FinalClass.php
Testing final classes is tricky, but possible even though you cannot directly mock a "final" class
<?php
namespace FinalClass;
require_once __DIR__ . '/vendor/autoload.php';
use PHPUnit\Framework\TestCase;
final class Foo
{
protected $bar;