-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6a3426b
commit 7f0c26e
Showing
9 changed files
with
896 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/vendor/ | ||
composer.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
language: php | ||
|
||
php: | ||
- 7.1 | ||
|
||
matrix: | ||
fast_finish: true | ||
|
||
before_install: | ||
- mkdir ~/bin; wget -O ~/bin/phpunit https://phar.phpunit.de/phpunit-6.1.3.phar; chmod +x ~/bin/phpunit | ||
|
||
install: composer update --prefer-dist --no-interaction $COMPOSER_FLAGS | ||
|
||
script: ~/bin/phpunit --coverage-text | ||
|
||
notifications: | ||
discord: | ||
channels: | ||
- 312160566291971:V7pRJV-3rzpjDuYxKIlbQ7Eihfg4PlIUShhesTdyg4IlRK0G7Akr_jm7SjzK-oqgFc6N | ||
pull_request_template: | ||
- 'Build [#%{build_number}](%{build_url}) ([%{commit}](%{compare_url})) of %{repository}@%{branch} in PR [#%{pull_request_number}](%{pull_request_url}) by %{author} %{result} in %{duration}' | ||
branch_template: | ||
- 'Build [#%{build_number}](%{build_url}) ([%{commit}](%{compare_url})) of %{repository}@%{branch} by %{author} %{result} in %{duration}' | ||
slack: redori:zPaW8aAbTCF9NJh13BtWq9UV | ||
email: | ||
- [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace GollumSF\SerializerDescribeAnnotationBundle\Annotation; | ||
|
||
/** | ||
* @Annotation | ||
* @Target({"CLASS"}) | ||
*/ | ||
class SerializerDescribe { | ||
|
||
/** @var array */ | ||
private $properties = []; | ||
|
||
public function __construct ($param) { | ||
$this->properties = isset($param['value']) ? $param['value'] : []; | ||
} | ||
|
||
public function getProperties(): array { | ||
return $this->properties; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace GollumSF\SerializerDescribeAnnotationBundle\DependencyInjection; | ||
|
||
use GollumSF\SerializerDescribeAnnotationBundle\Mapping\Loader\AnnotationClassLoader; | ||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\DependencyInjection\Definition; | ||
use Symfony\Component\DependencyInjection\Reference; | ||
|
||
class SerializerPass implements CompilerPassInterface { | ||
|
||
public function process(ContainerBuilder $container) { | ||
|
||
$container->setDefinition( | ||
AnnotationClassLoader::class, | ||
new Definition(AnnotationClassLoader::class, [ | ||
new Reference('annotation_reader') | ||
]) | ||
); | ||
|
||
$chainLoader = $container->getDefinition('serializer.mapping.chain_loader'); | ||
/** @var array $loaders */ | ||
$loaders = $chainLoader->getArgument(0); | ||
$loaders[] = $container->getDefinition(AnnotationClassLoader::class); | ||
$loaders = $chainLoader->setArgument(0, $loaders); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace GollumSF\SerializerDescribeAnnotationBundle; | ||
|
||
use GollumSF\SerializerDescribeAnnotationBundle\DependencyInjection\SerializerPass; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\HttpKernel\Bundle\Bundle; | ||
|
||
/** | ||
* GollumSFSerializerDescribeAnnotationBundle | ||
* | ||
* @author Damien Duboeuf <[email protected]> | ||
*/ | ||
class GollumSFSerializerDescribeAnnotationBundle extends Bundle { | ||
|
||
public function build(ContainerBuilder $container) { | ||
$container->addCompilerPass(new SerializerPass()); | ||
} | ||
} |
Oops, something went wrong.