diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..79773d2 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,19 @@ +# editorconfig.org +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false + +[Makefile] +indent_style = tab + +[.travis.yml] +indent_size = 2 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..ce8472b --- /dev/null +++ b/.gitattributes @@ -0,0 +1,7 @@ +*.php diff=php + +/.editorconfig export-ignore +/.gitattributes export-ignore +/.gitignore export-ignore +/.php_cs export-ignore +/phpunit.xml.dist export-ignore diff --git a/.github/issue_template.md b/.github/issue_template.md new file mode 100644 index 0000000..6d56b13 --- /dev/null +++ b/.github/issue_template.md @@ -0,0 +1,16 @@ +#### 1. Which version of `kreait/firebase-php` and `kreait/firebase-bundle` are you using? + +*You can use `composer show kreait/firebase-bundle` and `composer show kreait/firebase-bundle` +to see the installed version in the `versions` line.* + +#### 2. Which version of PHP are you using? + +*You can use `php -v` on the system the issue occurs on to get the PHP version.* + +#### 3. What's the issue? + +*Please don't just copy and paste a PHP exception trace.* + +#### 4. Code that lead to the issue + +*Please use [syntax highlighted code blocks](https://help.github.com/articles/creating-and-highlighting-code-blocks/) with code that can be used to reproduce the issue.* diff --git a/.gitignore b/.gitignore index a875533..9ad280d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ -/build/ -/vendor/ -composer.lock +/build +/vendor /.php_cs.cache +/composer.lock +/phpunit.xml diff --git a/.php_cs b/.php_cs new file mode 100644 index 0000000..0308da1 --- /dev/null +++ b/.php_cs @@ -0,0 +1,17 @@ +exclude(['build', 'vendor']) + ->in(__DIR__); + +return PhpCsFixer\Config::create() + ->setUsingCache(true) + ->setRules([ + '@Symfony' => true, + 'header_comment' => ['header' => ''], + 'phpdoc_align' => false, + 'phpdoc_order' => true, + 'ordered_imports' => true, + 'array_syntax' => ['syntax' => 'short'], + ]) + ->setFinder($finder); diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..1c345ef --- /dev/null +++ b/.travis.yml @@ -0,0 +1,12 @@ +language: php + +php: + - 7.0 + - 7.1 + +sudo: false + +install: travis_retry composer update + +script: + - vendor/bin/phpunit diff --git a/CHANGELOG.md b/CHANGELOG.md index aff9de7..8757445 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## Unreleased + +* Initial release with support for `kreait/firebase-php` ^4.0 + ## 0.5 - 2015-12-07 * Updated dependencies to add support for PHPUnit and Symfony 3.0. diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..973fc8c --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,46 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at github@kreait.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 8c8b59e..6f67522 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -1,68 +1,54 @@ root('kreait_firebase'); + private $name; - $rootNode->children() - ->append($this->addConnectionsNode()); - - return $treeBuilder; + public function __construct(string $name) + { + $this->name = $name; } - /** - * {@inheritdoc} - */ - public function addConnectionsNode() + public function getConfigTreeBuilder() { $builder = new TreeBuilder(); - $node = $builder->root('connections'); - - $node - ->isRequired() - ->requiresAtLeastOneElement() - ->useAttributeAsKey('connection') - ->prototype('array') - ->children() - ->scalarNode('scheme')->defaultValue('https')->end() - ->scalarNode('host')->isRequired()->end() - ->scalarNode('secret')->end() - ->append($this->addReferencesNode()) + $root = $builder->root($this->name); + + $root + ->fixXmlConfig('project') + ->children() + ->arrayNode('projects') + ->useAttributeAsKey('name') + ->prototype('array') + ->children() + ->scalarNode('credentials') + ->info('Path to the Google Service Account credentials file for this project.') + ->example('%kernel.project_dir%/config/credentials.json') + ->end() + ->scalarNode('public') + ->defaultTrue() + ->info('If set to false, the service and its alias can only be used via dependency injection') + ->end() + ->scalarNode('database_uri') + ->example('https://my-project.firebaseio.com') + ->info('You can find the database URI in the project settings in the Firebase console') + ->end() + ->scalarNode('alias')->end() + ->end() + ->end() ->end() ->end(); - return $node; - } - - /** - * {@inheritdoc} - */ - public function addReferencesNode() - { - $builder = new TreeBuilder(); - $node = $builder->root('references'); - - $node - ->requiresAtLeastOneElement() - ->useAttributeAsKey('name') - ->prototype('scalar'); - - return $node; + return $builder; } } diff --git a/DependencyInjection/Factory/ProjectFactory.php b/DependencyInjection/Factory/ProjectFactory.php new file mode 100644 index 0000000..5b8c685 --- /dev/null +++ b/DependencyInjection/Factory/ProjectFactory.php @@ -0,0 +1,37 @@ +firebaseFactory = $firebaseFactory; + } + + public function create(array $config = []): Firebase + { + $factory = clone $this->firebaseFactory; // Ensure a new instance + + if ($config['credentials'] ?? null) { + $serviceAccount = Firebase\ServiceAccount::fromValue($config['credentials']); + $factory = $factory->withServiceAccount($serviceAccount); + } + + if ($config['database_uri'] ?? null) { + $factory = $this->firebaseFactory->withDatabaseUri($config['database_uri']); + } + + return $factory->create(); + } +} diff --git a/DependencyInjection/FirebaseExtension.php b/DependencyInjection/FirebaseExtension.php new file mode 100644 index 0000000..dd959da --- /dev/null +++ b/DependencyInjection/FirebaseExtension.php @@ -0,0 +1,56 @@ +getConfiguration($configs, $container); + $config = $this->processConfiguration($configuration, $configs); + + $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); + $loader->load('firebase.xml'); + + foreach ($config['projects'] ?? [] as $projectName => $projectConfiguration) { + $this->processProjectConfiguration($projectName, $projectConfiguration, $container); + } + } + + private function processProjectConfiguration($name, array $config, ContainerBuilder $container) + { + $projectServiceId = sprintf('%s.%s', $this->getAlias(), $name); + $isPublic = $config['public']; + + $container->register($projectServiceId, Firebase::class) + ->setFactory([new Reference(ProjectFactory::class), 'create']) + ->addArgument($config) + ->setPublic($isPublic); + + if ($config['alias'] ?? null) { + $alias = $container->setAlias($config['alias'], $projectServiceId); + $alias->setPublic($isPublic); + } + } + + public function getAlias() + { + return 'kreait_firebase'; + } + + public function getConfiguration(array $config, ContainerBuilder $container) + { + return new Configuration($this->getAlias()); + } +} diff --git a/DependencyInjection/KreaitFirebaseExtension.php b/DependencyInjection/KreaitFirebaseExtension.php deleted file mode 100644 index e975512..0000000 --- a/DependencyInjection/KreaitFirebaseExtension.php +++ /dev/null @@ -1,75 +0,0 @@ -processConfiguration($configuration, $configs); - - $this->processConnections($config['connections'], $container); - } - - /** - * {@inheritdoc} - */ - protected function processConnections(array $connectionsConfig, ContainerBuilder $container) - { - foreach ($connectionsConfig as $name => $connection) { - $connectionDefinition = new Definition(); - $connectionDefinition->setClass('Kreait\Firebase\Firebase'); - - $firebaseConfigDefinition = new Definition(); - $firebaseConfigDefinition->setClass('Kreait\Firebase\Configuration'); - - $baseUrl = $connection['scheme'] . '://' . $connection['host']; - - if(array_key_exists('secret',$connection)) { - $firebaseConfigDefinition->addMethodCall('setFirebaseSecret', [$connection['secret']]); - } - - $connectionDefinition->setArguments(array($baseUrl, $firebaseConfigDefinition)); - $connectionServiceId = 'kreait_firebase.connection.' . $name; - - $container->setDefinition($connectionServiceId, $connectionDefinition); - - if (!empty($connection['references'])) { - $this->processReferences($connectionServiceId, $connection['references'], $container); - } - } - } - - /** - * {@inheritdoc} - */ - protected function processReferences($connectionServiceId, array $referencesConfig, ContainerBuilder $container) - { - foreach ($referencesConfig as $key => $value) { - $referenceDefinition = new Definition(); - $referenceDefinition->setClass('Kreait\Firebase\Reference'); - $referenceDefinition->setArguments(array( - new Reference($connectionServiceId), - $value - )); - - $container->setDefinition('kreait_firebase.reference.' . $key, $referenceDefinition); - } - } - -} diff --git a/FirebaseBundle.php b/FirebaseBundle.php new file mode 100644 index 0000000..25fa0a7 --- /dev/null +++ b/FirebaseBundle.php @@ -0,0 +1,16 @@ + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2ed8564 --- /dev/null +++ b/Makefile @@ -0,0 +1,25 @@ +.DEFAULT_GOAL:= help +.PHONY: tests coverage view-coverage cs docs view-docs tag + +tests: ## Executes the test suite + vendor/bin/phpunit + +coverage: ## Executes the test suite and generates code coverage reports + @vendor/bin/phpunit --coverage-html=build/coverage + +view-coverage: ## Shows the code coverage report + open build/coverage/index.html + +cs: ## Fixes coding standard problems + @vendor/bin/php-cs-fixer fix || true + +tag: ## Creates a new signed git tag + $(if $(TAG),,$(error TAG is not defined. Pass via "make tag TAG=2.0.1")) + @echo Tagging $(TAG) + chag update $(TAG) + git add --all + git commit -m 'Release $(TAG)' + git tag -s $(TAG) -m 'Release $(TAG)' + +help: + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-16s\033[0m %s\n", $$1, $$2}' diff --git a/README.md b/README.md index a44f6ee..111ba86 100644 --- a/README.md +++ b/README.md @@ -1,105 +1,57 @@ -# Firebase Symfony2 Bundle +# Firebase SDK Bundle -A Symfony2 Bundle for the [Firebase PHP client](https://github.com/kreait/firebase-php). +A Symfony Bundle for the [Firebase PHP SDK](https://github.com/kreait/firebase-php). --- ## Installation -### Download the bundle +Add the bundle using [Composer](https://getcomposer.org) -Execute the following from the project root directory - -``` - composer require kreait/firebase-bundle +```bash +composer require kreait/firebase-bundle ^1.0 ``` -### Enable the bundle - -Then, enable the bundle by adding the following line in the `app/AppKernel.php file of your project: - ```php -// app/AppKernel.php -class AppKernel extends Kernel -{ - public function registerBundles() - { - $bundles = array( - // ... - new Kreait\FirebaseBundle\KreaitFirebaseBundle(), - ); - - // ... - } -} -``` - -### Add minimal configuration - -Add the following to `app/config/config.yml` - -``` +// Symfony without Flex +// in %kernel.root_dir%/AppKernel.php +$bundles = array( + // ... + new Kreait\Firebase\Symfony\Bundle\FirebaseBundle(), +); + +// Symfony with Flex +// in config/bundles.php +return [ + // ... + Kreait\Firebase\Symfony\Bundle\FirebaseBundle::class => ['all' => true], +]; +``` +### Configuration + +```yaml +# app/config/config.yml (Symfony without Flex) +# config/packages/firebase.yaml (Symfony with Flex) kreait_firebase: - connections: - main: - host: prefix-suffix-1234.firebaseio.com + projects: + # You can access your firebase project with + # $container->get('kreait_firebase.first') + first: + # Optional: If set to false, the service and its alias + # can only be used via dependency injection + public: true + # Optional: Path to the projects Service Account credentials file + # If omitted, the library will try to discover it. + credentials: '%kernel.project_dir%/config/service_account_credentials.json' + # You can find the database URI at + # https://console.firebase.google.com/project/first/database/data + database_uri: 'https://my-project.firebaseio.com' + # Optional: If set, you can access your project with + # $container->get('firebase') + alias: 'firebase' + second: # $container->get('kreait_firebase.second') + database_uri: 'https://second.firebaseio.com' + third: # $container->get('kreait_firebase.third') + ... + ``` - -Setup complete! - -## Configuration - -Following configuration - -``` -kreait_firebase: - connections: - main: - scheme: https - host: prefix-suffix-1234.firebaseio.com - secret: - references: - users: data/users - images: data/images -``` - -will automagically register the following services - - - kreait_firebase.connection.main (instance of Kreait\Firebase\Firebase) - - kreait_firebase.reference.users (instance of Kreait\Firebase\Reference) - - kreait_firebase.reference.images (instance of Kreait\Firebase\Reference) - - -## Usage - -Please see [https://github.com/kreait/firebase-php#documentation](https://github.com/kreait/firebase-php#documentation) -for the full documentation - -### Retrieving a Firebase connection - -```php -$firebase = $this->container->get('kreait_firebase.connection.main'); -``` - -### Retrieving a Firebase Reference - -```php -$users = $this->container->get('kreait_firebase.reference.users'); -``` - -### Authentication - -To use authentication, you need to set the Firebase secret in your configuration. - -Then, in your code, you can authenticate a request like this: - -```php -$firebase = $this->container->get('kreait_firebase.connection.main'); -$tokenGenerator = $firebase->getConfiguration()->getAuthTokenGenerator(); - -$adminToken = $tokenGenerator->createAdminToken(); - -$firebase->setAuthToken($adminToken); -``` - -This procedure is quite cumbersome at the moment, but will be made more conveniant in an upcoming release. diff --git a/Resources/config/firebase.xml b/Resources/config/firebase.xml new file mode 100644 index 0000000..31eb584 --- /dev/null +++ b/Resources/config/firebase.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/Tests/DependencyInjection/ConfigurationTest.php b/Tests/DependencyInjection/ConfigurationTest.php deleted file mode 100644 index a63cd43..0000000 --- a/Tests/DependencyInjection/ConfigurationTest.php +++ /dev/null @@ -1,70 +0,0 @@ -assertConfigurationIsInvalid( - [ - [] // no values at al - ], - 'connections' - ); - } - - public function testValuesAreInvalidIfNoConnectionAreProvided() - { - $this->assertConfigurationIsInvalid( - [ - [ - 'connections' => [] - ] - ], - 'connections' - ); - } - - public function testValuesAreInvalidIfNoHostIsProvided() - { - $this->assertConfigurationIsInvalid( - [ - [ - 'connections' => [ - 'connection' => [] - ] - ] - ], - 'host' - ); - } - - public function testValuesAreInvalidIfReferencesAreSetButEmpty() - { - $this->assertConfigurationIsInvalid( - [ - [ - 'connections' => [ - 'connection' => [ - 'host' => 'host', - 'references' => [], - ] - ] - ] - ], - 'references' - ); - } -} diff --git a/Tests/DependencyInjection/Factory/ProjectFactoryTest.php b/Tests/DependencyInjection/Factory/ProjectFactoryTest.php new file mode 100644 index 0000000..8b2889e --- /dev/null +++ b/Tests/DependencyInjection/Factory/ProjectFactoryTest.php @@ -0,0 +1,53 @@ +firebaseFactory = $this->createMock(FirebaseFactory::class); + $this->factory = new ProjectFactory($this->firebaseFactory); + } + + /** + * @test + */ + public function it_can_handle_a_custom_database_uri() + { + $this->firebaseFactory + ->expects($this->once()) + ->method('withDatabaseUri') + ->with('http://domain.tld'); + + $this->factory->create(['database_uri' => 'http://domain.tld']); + } + + /** + * @test + */ + public function it_can_handle_a_credentials_path() + { + $this->firebaseFactory + ->expects($this->once()) + ->method('withServiceAccount'); + + $this->factory->create(['credentials' => __DIR__.'/../../_fixtures/valid_credentials.json']); + } +} diff --git a/Tests/DependencyInjection/FirebaseExtensionTest.php b/Tests/DependencyInjection/FirebaseExtensionTest.php new file mode 100644 index 0000000..69426f0 --- /dev/null +++ b/Tests/DependencyInjection/FirebaseExtensionTest.php @@ -0,0 +1,99 @@ +extension = new FirebaseExtension(); + } + + /** + * @test + */ + public function a_project_can_have_an_alias() + { + $container = $this->createContainer([ + 'projects' => [ + 'foo' => [ + 'alias' => 'bar', + ], + ], + ]); + + $this->assertSame($container->get($this->extension->getAlias().'.foo'), $container->get('bar')); + } + + /** + * @test + */ + public function a_project_can_be_private() + { + $container = $this->createContainer([ + 'projects' => [ + 'foo' => [ + 'alias' => 'bar', + 'public' => false + ], + ], + ]); + + $this->assertFalse($container->has($this->extension->getAlias().'.foo')); + $this->assertFalse($container->has('bar')); + } + + /** + * @test + */ + public function it_can_provide_multiple_projects() + { + $container = $this->createContainer([ + 'projects' => [ + 'foo' => [], + 'bar' => [], + ], + ]); + + $this->assertTrue($container->hasDefinition($this->extension->getAlias().'.foo')); + $this->assertTrue($container->hasDefinition($this->extension->getAlias().'.bar')); + } + + /** + * @test + */ + public function it_supports_specifying_credentials() + { + $container = $this->createContainer([ + 'projects' => [ + 'foo' => [ + 'credentials' => __DIR__.'/../_fixtures/valid_credentials.json', + ], + ], + ]); + + $this->assertTrue($container->hasDefinition($this->extension->getAlias().'.foo')); + } + + protected function createContainer(array $config = []) + { + $container = new ContainerBuilder(); + + $this->extension->load([$this->extension->getAlias() => $config], $container); + + $container->compile(); + + return $container; + } +} diff --git a/Tests/DependencyInjection/KreaitFirebaseExtensionTest.php b/Tests/DependencyInjection/KreaitFirebaseExtensionTest.php deleted file mode 100644 index 05b503b..0000000 --- a/Tests/DependencyInjection/KreaitFirebaseExtensionTest.php +++ /dev/null @@ -1,42 +0,0 @@ -load([ - 'connections' => [ - 'foo' => [ - 'host' => 'example.com', - 'secret' => 'secret', - 'references' => [ - 'foo' => 'foo/bar' - ], - ] - ] - ]); - - $this->assertContainerBuilderHasService('kreait_firebase.connection.foo'); - - /** @var Firebase $firebase */ - $firebase = $this->container->get('kreait_firebase.connection.foo'); - - $this->assertEquals('https://example.com', $firebase->getBaseUrl()); - $this->assertEquals('secret', $firebase->getConfiguration()->getFirebaseSecret()); - - $this->assertInstanceOf('Kreait\Firebase\Reference', $this->container->get('kreait_firebase.reference.foo')); - } -} diff --git a/Tests/FirebaseBundleTest.php b/Tests/FirebaseBundleTest.php new file mode 100644 index 0000000..81b098f --- /dev/null +++ b/Tests/FirebaseBundleTest.php @@ -0,0 +1,22 @@ +assertInstanceOf(FirebaseExtension::class, $bundle->getContainerExtension()); + } +} diff --git a/Tests/KreaitFirebaseBundleTest.php b/Tests/KreaitFirebaseBundleTest.php deleted file mode 100644 index f567a32..0000000 --- a/Tests/KreaitFirebaseBundleTest.php +++ /dev/null @@ -1,14 +0,0 @@ -assertInstanceOf('Kreait\\FirebaseBundle\\KreaitFirebaseBundle', $out); - } -} diff --git a/Tests/_fixtures/valid_credentials.json b/Tests/_fixtures/valid_credentials.json new file mode 100644 index 0000000..87b8fe4 --- /dev/null +++ b/Tests/_fixtures/valid_credentials.json @@ -0,0 +1,12 @@ +{ + "type": "service_account", + "project_id": "project", + "private_key_id": "private_key_id", + "private_key": "-----BEGIN PRIVATE KEY-----\nsome gibberish\n-----END PRIVATE KEY-----\n", + "client_email": "client@email.tld", + "client_id": "1234567890", + "auth_uri": "https://some.google.tld/o/oauth2/auth", + "token_uri": "https://some.google.tld/o/oauth2/token", + "auth_provider_x509_cert_url": "https://some.google.tld/oauth2/v1/certs", + "client_x509_cert_url": "https://some.google.tld/robot/v1/metadata/x509/user%40project.iam.gserviceaccount.com" +} diff --git a/composer.json b/composer.json index 1746809..491021c 100644 --- a/composer.json +++ b/composer.json @@ -1,30 +1,32 @@ { - "name": "kreait/firebase-bundle", - "description": "Symfony2 Bundle for Firebase REST API client", - "keywords": ["firebase", "rest", "api", "http"], - "homepage": "https://github.com/kreait/firebase-bundle", - "license": "MIT", - "authors": [ - { - "name": "Jérôme Gamez", - "homepage": "https://github.com/jeromegamez", - "email": "jerome@kreait.com" + "name": "kreait/firebase-bundle", + "description": "Symfony Bundle for the Firebase Admin SDK", + "keywords": ["firebase", "google", "sdk", "api", "database", "symfony", "bundle", "symfony-bundle"], + "homepage": "https://github.com/kreait/firebase-bundle", + "license": "MIT", + "type": "symfony-bundle", + "authors": [ + { + "name": "Jérôme Gamez", + "homepage": "https://github.com/jeromegamez" + } + ], + "require": { + "kreait/firebase-php": "^4.0", + "symfony/dependency-injection": "^2.7|^3.3|^4.0", + "symfony/config": "^2.8|^3.3|^4.0", + "symfony/http-kernel": "^2.7|^3.3|^4.0" }, - { - "name": "Armen Mkrtchyan", - "homepage": "https://github.com/iamtankist", - "email": "armen@kreait.com" + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.0", + "phpunit/phpunit": "^6.0|^7.0" + }, + "autoload": { + "psr-4": { + "Kreait\\Firebase\\Symfony\\Bundle\\": "" + } + }, + "config": { + "sort-packages": true } - ], - "require": { - "kreait/firebase-php": "0.9.*", - "symfony/framework-bundle": "^2.0|^3.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.6|^5.0", - "matthiasnoback/symfony-dependency-injection-test": "0.7.*" - }, - "autoload": { - "psr-4": { "Kreait\\FirebaseBundle\\": "" } - } } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 961b616..6bb43c0 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,17 +1,22 @@ - - + - - ./Tests/ + + ./Tests - ./ + . ./Tests + ./Resources ./vendor