Skip to content

Instantly share code, notes, and snippets.

View eujoy's full-sized avatar

Angelos Giannis eujoy

View GitHub Profile
@eujoy
eujoy / RobertCMartin-CleanCodeHeuristics.md
Last active March 1, 2024 14:04
Robert C. Martin - Clean Code Heuristics
@eujoy
eujoy / tdt-with-functions.go
Created June 10, 2020 12:29
Example of creating unit tests using the table driven approach
func TestWithFunctions(t *testing.T) {
type setupFunc func(t *testing.T, <other options>)
type checkFunc func(t *testing.T, <other options>)
testCases := map[string]struct{
setupFn setupFunc
checkFn checkFunc
wantResult interface{}
wantError error
}{
<?php
namespace \Example\MyClass;
class User {
/** @var int $id */
public $id;
/** @var string $first_name */
<?php
class UserBuilder {
/**
* Private variables, constructor, build function...
*/
/**
* Set the value for first_name.
*
@eujoy
eujoy / UserBuilder.php
Created July 3, 2020 18:44
This is an automatically created builder for the user class https://gist.github.com/Angelos-Giannis/10b21950968a22a0859c1ff6527d71cf as it has been generated by using https://github.com/Angelos-Giannis/php-builder-class.
<?php
declare(strict_types = 1);
namespace /** @todo define namespace */;
/** @todo Define dependencies for the builder (e.g. DI). */
use \Example\MyClass\User;
class UserBuilder