Add more files
This commit is contained in:
11
README.md
11
README.md
@@ -0,0 +1,11 @@
|
||||
# PCM Skeleton Bundle
|
||||
|
||||
This skeleton bundle contains the bare bones of a Symfony bundle.
|
||||
|
||||
To get started, add a bundle name and description inside of `composer.json`. Add yourself as an author too, if you are cool enough.
|
||||
|
||||
Change the **class name** and **namespace** of the bundle file in `/src`. Change the **file name** to match the class name also.
|
||||
|
||||
# Conventions
|
||||
- `YAML` files must end with `.yml`
|
||||
- Namespaces should always start with `Pcm\ExampleBundle` (change `Example` to whatever is appropriate)
|
||||
|
||||
41
composer.json
Normal file
41
composer.json
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"name": "pcm/bundle-name",
|
||||
"description": "bundle description",
|
||||
|
||||
"type": "symfony-bundle",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Bradley Goode",
|
||||
"email": "bg@pcmsystems.co.uk"
|
||||
},
|
||||
{
|
||||
"name": "Matt Feeney",
|
||||
"email": "mf@pcmsystems.co.uk"
|
||||
}
|
||||
],
|
||||
|
||||
"require": {
|
||||
"symfony/dependency-injection": "^6.1",
|
||||
"symfony/framework-bundle": "^6.1",
|
||||
"symfony/yaml": "^6.1",
|
||||
"symfony/http-client": "^6.1"
|
||||
},
|
||||
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^9.5",
|
||||
"symfony/phpunit-bridge": "^6.1"
|
||||
},
|
||||
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Pcm\\GeocodeBundle\\": "src/"
|
||||
}
|
||||
},
|
||||
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Pcm\\GeocodeBundle\\Tests\\": "tests/"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
services:
|
||||
_defaults:
|
||||
autowire: true
|
||||
autoconfigure: true
|
||||
|
||||
pcm_example.example_service:
|
||||
alias: Pcm\ExampleBundle\Service\ExampleService
|
||||
public: true
|
||||
|
||||
Pcm\ExampleBundle\Service\ExampleService: ~
|
||||
|
||||
19
phpunit.xml.dist
Normal file
19
phpunit.xml.dist
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" backupGlobals="false" colors="true" bootstrap="./vendor/autoload.php">
|
||||
<coverage>
|
||||
<include>
|
||||
<directory>./src</directory>
|
||||
</include>
|
||||
</coverage>
|
||||
<php>
|
||||
<ini name="error_reporting" value="-1"/>
|
||||
<ini name="intl.default_locale" value="en"/>
|
||||
<ini name="intl.error_level" value="0"/>
|
||||
<ini name="memory_limit" value="-1"/>
|
||||
</php>
|
||||
<testsuites>
|
||||
<testsuite name="Test suite">
|
||||
<directory suffix="Test.php">./tests</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
</phpunit>
|
||||
19
src/PcmExampleBundle.php
Normal file
19
src/PcmExampleBundle.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Pcm\ExampleBundle;
|
||||
|
||||
use Symfony\Component\Config\FileLocator;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
|
||||
use Symfony\Component\HttpKernel\Bundle\AbstractBundle;
|
||||
|
||||
class PcmExampleBundle extends AbstractBundle {
|
||||
public function loadExtension(array $config, ContainerConfigurator $container, ContainerBuilder $builder): void
|
||||
{
|
||||
$loader = new YamlFileLoader($builder, new FileLocator(__DIR__.'/../config/'));
|
||||
$loader->load('services.yml');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user