git clone --mirror ORIGINAL-REPOSITORY-URL DIRECTORY-NAME
cd DIRECTORY-NAME
git remote add NEW-REMOTE NEW-REPOSITORY-URL
git push NEW-REMOTE --mirror
# delete local tag '12345' | |
git tag -d 12345 | |
# delete remote tag '12345' (eg, GitHub version too) | |
git push origin :refs/tags/12345 | |
# alternative approach | |
git push --delete origin tagName | |
git tag -d tagName |
<?php | |
declare(strict_types = 1); | |
namespace Xthiago\Infrastructure\Validation\SymfonyValidator\Constraints; | |
use Xthiago\Domain\Model\PhoneNumber\PhoneNumber; | |
use Xthiago\Domain\Model\PhoneNumber\InvalidPhoneNumberException; | |
use Symfony\Component\Validator\Constraint; | |
use Symfony\Component\Validator\ConstraintValidator; |
There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore
is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules
directory) as well as files that are generated (and regenerated) as artifacts of a build process.
All other files should be in your own global gitignore file. Create a file called .gitignore
in your home directory and add anything you want to ignore. You then need to tell git where your global gitignore file is.
git config --global core.excludesfile ~/.gitignore
git config --global core.excludesfile %USERPROFILE%\.gitignore
Value object that depends on system time:
<?php
declare(strict_types=1);
namespace Xthiago;
final class BirthDate
Tem uns testes aqui que acredito que a legibilidade seria muito melhor se tivéssemos uma comparação de strings entre a resposta esperada e a efetiva:
// [..] setup dos dados
$firstPage = actionToFetchFirstPage();
$expectedFirstPage = <<<EOL
{
"data":[
{
"name":"xthiago",
<?php | |
declare(strict_types=1); | |
namespace Zalas\PHPUnit\Injector\Symfony\TestCase; | |
use Symfony\Component\DependencyInjection\ResettableContainerInterface; | |
use Symfony\Component\HttpKernel\KernelInterface; | |
/** | |
* Mimics the behaviour of Symfony's KernelTestCase. |
sudo apt install gedit | |
cd /tmp/ | |
wget https://download.jetbrains.com/webide/PhpStorm-2021.2.3.tar.gz | |
tar -zxvf PhpStorm-2021.2.3.tar.gz | |
mkdir ~/Apps | |
mv PhpStorm-212.5457.49/ ~/Apps/ | |
ln -s ~/Apps/PhpStorm-212.5457.49 ~/Apps/phpstorm | |
# shortcut | |
vim jetbrains-phpstorm.desktop |
git branch -r --merged | egrep -v '(master|main|release|development)' | sed 's/origin\///' | xargs -n 1 git push --delete origin |