Skip to content

Commit

Permalink
# This is a combination of 4 commits.
Browse files Browse the repository at this point in the history
# This is the 1st commit message:

add monorepo split for value objects function

# The commit message #2 will be skipped:

# fixup! add monorepo split for value objects function

# The commit message #3 will be skipped:

# fixup! fixup! add monorepo split for value objects function

# The commit message #4 will be skipped:

# fixup! fixup! fixup! add monorepo split for value objects function
  • Loading branch information
TomasVotruba committed Sep 8, 2020
1 parent bed168b commit 9131252
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 4 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@
"Rector\\DowngradePhp72\\": "rules/downgrade-php72/src",
"Rector\\DowngradePhp74\\": "rules/downgrade-php74/src",
"Rector\\DowngradePhp80\\": "rules/downgrade-php80/src",
"Rector\\SymfonyPhpConfig\\": "rules/symfony-php-config/src"
"Rector\\SymfonyPhpConfig\\": ["packages/symfony-php-config/src", "rules/symfony-php-config/src"]
},
"files": [
"rules/symfony-php-config/functions/functions.php"
"packages/symfony-php-config/functions/functions.php"
]
},
"autoload-dev": {
Expand Down
13 changes: 13 additions & 0 deletions monorepo-builder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

declare(strict_types=1);

use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symplify\MonorepoBuilder\ValueObject\Option;

return static function (ContainerConfigurator $containerConfigurator): void {
$parameters = $containerConfigurator->parameters();
$parameters->set(Option::DIRECTORIES_TO_REPOSITORIES, [
__DIR__ . '/packages/symfony-php-config' => 'git@github.com:rector/symfony-php-config.git',
]);
};
30 changes: 30 additions & 0 deletions packages/symfony-php-config/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "rector/symfony-php-config",
"description": "Tools that easy work with Symfony PHP Configs",
"license": "MIT",
"authors": [
{ "name": "Tomas Votruba", "email": "tomas.vot@gmail.com", "homepage": "https://tomasvotruba.com" }
],
"require": {
"php": "^7.2.4|^8.0",
"symfony/dependency-injection": "^4.4.8|^5.0.6",
"symfony/http-kernel": "^4.4.8|^5.0.6",
"symplify/package-builder": "^8.2.11"
},
"require-dev": {
"phpunit/phpunit": "^8.5|^9.2"
},
"autoload": {
"psr-4": {
"Rector\\SymfonyPhpConfig\\": "src"
},
"files": [
"functions/functions.php"
]
},
"autoload-dev": {
"psr-4": {
"Rector\\SymfonyPhpConfig\\Tests\\": "tests"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Rector\SymfonyPhpConfig;

use Rector\Core\Exception\ShouldNotHappenException;
use Rector\SymfonyPhpConfig\Exception\ValueObjectException;
use Rector\SymfonyPhpConfig\Reflection\ArgumentAndParameterFactory;
use ReflectionClass;
use function Symfony\Component\DependencyInjection\Loader\Configurator\inline_service;
Expand Down Expand Up @@ -70,7 +70,7 @@ function resolve_argument_values(ReflectionClass $reflectionClass, object $objec
'Constructor for "%s" was not found. Be sure to use only value objects',
$reflectionClass->getName()
);
throw new ShouldNotHappenException($message);
throw new ValueObjectException($message);
}

foreach ($constructorMethodReflection->getParameters() as $constructorParameter) {
Expand Down
11 changes: 11 additions & 0 deletions packages/symfony-php-config/src/Exception/ValueObjectException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

declare(strict_types=1);

namespace Rector\SymfonyPhpConfig\Exception;

use Exception;

final class ValueObjectException extends Exception
{
}
22 changes: 22 additions & 0 deletions travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# inspired by /~https://github.com/rectorphp/rector/blob/master/.travis.yml
language: php

dist: bionic

php: 7.4

before_install:
- phpenv config-rm xdebug.ini

jobs:
include:
-
name: "Split Monorepo"
if: (branch = master OR tag IS present) && type = push
script:
- composer update
# travis_retry to prevent fails
- travis_retry vendor/bin/monorepo-builder split --ansi

notifications:
email: false

0 comments on commit 9131252

Please sign in to comment.