Skip to content

Instantly share code, notes, and snippets.

View burus86's full-sized avatar
馃彔
Working from home

Juan Jes煤s G贸mez Noya burus86

馃彔
Working from home
View GitHub Profile
<?php
/**
* 1. Dummy Test Example
*/
final class PaymentProcessor
{
public function __construct(private LoggerInterface $logger) {}
public function processPayment(float $amount): void

Instrucciones de instalaci贸n

composer require --dev phpro/grumphp-shim

Instrucciones para deshabilitar GrumPHP

<?php
declare(strict_types=1);
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
return static function (RectorConfig $rectorConfig): void {
@burus86
burus86 / clone_or_sync_repos.sh
Last active October 16, 2025 18:56
Script to clone or sync a list of repositories, creating a temporal branch with format: {branch}_{yyyymmdd}
#!/bin/bash
# Variables
declare -a branches=("develop" "master" "test" "qa")
url="[email protected]:burus86"
repository_path=$HOME/www/__personal-projects
# List of repositories to clone or sync
repositories=(
@burus86
burus86 / pre-commit
Created January 13, 2023 17:01
Git hooks for pre-commit (ECS) and pre-push (ECS, PhpStan and PhpUnit)
#!/bin/bash
RESET='\e[0m'
RED='\e[31m'
GREEN='\e[32m'
YELLOW='\e[33m'
#----------------------------------------------------------------------------------------------------------------------
# FUNCTIONS
# -*- mode: gitconfig; -*-
# vim: set filetype=gitconfig:
##
# GitAlias.com collection of many git alias items, including shortcuts,
# helpers, workflows, utilties, visualizers, reports, etc.
#
#
# ## Usage
#
@burus86
burus86 / code_checks.yaml
Created October 28, 2022 16:23
Github actions to check code, tests and linter
name: Code Checks
on:
pull_request: null
push:
branches:
- master
jobs:
code_checks:
@burus86
burus86 / .editorconfig
Last active May 8, 2024 14:17
Interesting tools for new PHP projects: Rector, Easy Coding Standard, PHPStan, PHPUnit, ...
; This file is for unifying the coding style for different editors and IDEs.
; More information at https://editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_size = 4
@burus86
burus86 / Day.php
Created September 20, 2022 13:01 — forked from Ocramius/Day.php
Example abstraction that only allows a resolution of "day" for time inside a specific business domain
<?php
declare(strict_types=1);
namespace Core\Domain\Time;
use DateTimeImmutable;
use DateTimeZone;
use Generator;
use Iterator;
@burus86
burus86 / GitCommitBestPractices.md
Created August 17, 2022 08:54 — forked from luismts/GitCommitBestPractices.md
Git Tips and Git Commit Best Practices

Git Commit Best Practices

Basic Rules

Commit Related Changes

A commit should be a wrapper for related changes. For example, fixing two different bugs should produce two separate commits. Small commits make it easier for other developers to understand the changes and roll them back if something went wrong. With tools like the staging area and the ability to stage only parts of a file, Git makes it easy to create very granular commits.

Commit Often

Committing often keeps your commits small and, again, helps you commit only related changes. Moreover, it allows you to share your code more frequently with others. That way it鈥榮 easier for everyone to integrate changes regularly and avoid having merge conflicts. Having large commits and sharing them infrequently, in contrast, makes it hard to solve conflicts.