Skip to content

Commit a938d72

Browse files
authored
Merge pull request #2 from zarathustra323/namespaces
Fix namespaces and file names
2 parents 978d70f + 15691b9 commit a938d72

File tree

10 files changed

+24
-22
lines changed

10 files changed

+24
-22
lines changed

As3PostProcessBundle.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
<?php
2-
namespace As3\PostProcessBundle;
2+
namespace As3\Bundle\PostProcessBundle;
33

44
use Symfony\Component\HttpKernel\Bundle\Bundle;
55
use Symfony\Component\DependencyInjection\ContainerBuilder;
6-
use As3\PostProcessBundle\DependencyInjection\Compiler;
6+
use As3\Bundle\PostProcessBundle\DependencyInjection\Compiler;
77

88
class As3PostProcessBundle extends Bundle
99
{
1010
public function build(ContainerBuilder $container)
1111
{
12+
parent::build($container);
1213
$container->addCompilerPass(new Compiler\AddTasksCompilerPass());
1314
$container->addCompilerPass(new Compiler\AddPluginsCompilerPass());
1415
}

DependencyInjection/CygnusPostProcessExtension.php renamed to DependencyInjection/As3PostProcessExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace As3\PostProcessBundle\DependencyInjection;
3+
namespace As3\Bundle\PostProcessBundle\DependencyInjection;
44

55
use Symfony\Component\DependencyInjection\ContainerBuilder;
66
use Symfony\Component\Config\FileLocator;

DependencyInjection/Compiler/AddPluginsCompilerPass.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
2-
namespace As3\PostProcessBundle\DependencyInjection\Compiler;
2+
3+
namespace As3\Bundle\PostProcessBundle\DependencyInjection\Compiler;
34

45
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
56
use Symfony\Component\DependencyInjection\ContainerBuilder;

DependencyInjection/Compiler/AddTasksCompilerPass.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
2-
namespace As3\PostProcessBundle\DependencyInjection\Compiler;
2+
3+
namespace As3\Bundle\PostProcessBundle\DependencyInjection\Compiler;
34

45
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
56
use Symfony\Component\DependencyInjection\ContainerBuilder;

DependencyInjection/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace As3\PostProcessBundle\DependencyInjection;
3+
namespace As3\Bundle\PostProcessBundle\DependencyInjection;
44

55
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
66
use Symfony\Component\Config\Definition\ConfigurationInterface;

Plugins/PluginInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace As3\PostProcessBundle\Plugins;
3+
namespace As3\Bundle\PostProcessBundle\Plugins;
44

55
use Symfony\Component\HttpKernel\Event\PostResponseEvent;
66
use Symfony\Component\HttpFoundation\Response;

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ To install this bundle via composer, perform the following command: `composer re
1212
### Register the Bundle
1313

1414
Once installed, register the bundle in your `AppKernel.php`:
15-
```
15+
```php
1616
// app/AppKernel.php
1717
public function registerBundles()
1818
{
@@ -35,8 +35,8 @@ A task can be used to execute logic after the response has been sent to the user
3535

3636
Example:
3737

38-
```
39-
use As3\PostProcessBundle\TaskInterface;
38+
```php
39+
use As3\Bundle\PostProcessBundle\TaskInterface;
4040

4141
class SleepTestTask implements TaskInterface
4242
{
@@ -52,7 +52,7 @@ class SleepTestTask implements TaskInterface
5252
```
5353

5454
To register your task, call the `addTask` method against the task manager's service (`as3_post_process.task.manager`):
55-
```
55+
```php
5656
$manager = $this->get('as3_post_process.task.manager');
5757
$manager->addTask(new SleepTestTask(), 5);
5858
```
@@ -61,7 +61,7 @@ Tasks can have a `priority` set when they are added to the manager -- by default
6161

6262
You can also register a service by using the tag `as3_post_process.task` if your task should be run on every request.
6363

64-
```
64+
```yaml
6565
# src\MyBundle\Resources\services.yml
6666
services:
6767
my_app.my_cool_task:
@@ -76,7 +76,7 @@ A plugin can be used to modify the response before it is returned to the user.
7676
7777
Example:
7878
79-
```
79+
```php
8080
use Symfony\Component\HttpFoundation\Response;
8181

8282
/**
@@ -117,7 +117,7 @@ class NewRelicInjector extends PluginInterface
117117

118118
This plugin will disable automatic injection of NewRelic end user monitoring javascript. To enable this for all requests, add the following service definition:
119119

120-
```
120+
```yaml
121121
my_app.my_bundle.new_relic_injector:
122122
class: MyApp\MyBundle\NewRelicPlugin
123123
tags:

Resources/config/services.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
as3_post_process.task.manager:
3-
class: As3\PostProcessBundle\Task\TaskManager
3+
class: As3\Bundle\PostProcessBundle\Task\TaskManager
44
tags:
55
- { name: kernel.event_listener, event: kernel.response, method: filterResponse, priority: -255 }
66
- { name: kernel.event_listener, event: kernel.terminate, method: execute, priority: 1 }

Task/TaskInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace As3\PostProcessBundle\Task;
3+
namespace As3\Bundle\PostProcessBundle\Task;
44

55
/**
66
* Interface for Tasks to be executed "post process" - after the response is sent

Task/TaskManager.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?php
22

3-
namespace As3\PostProcessBundle\Task;
3+
namespace As3\Bundle\PostProcessBundle\Task;
44

55
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
66
use Symfony\Component\HttpKernel\Event\PostResponseEvent;
77
use Symfony\Component\HttpFoundation\Response;
8-
use As3\PostProcessBundle\Plugins\PluginInterface;
8+
use As3\Bundle\PostProcessBundle\Plugins\PluginInterface;
99

1010
/**
1111
* The task manager is responsible for running PHP code after a response is sent to the browser.
@@ -169,8 +169,7 @@ public function isEnabled()
169169
* Executes the post-response Tasks.
170170
* Is called via Symfony's kernel.terminate event.
171171
*
172-
* @param Symfony\Component\HttpKernel\Event\PostResponseEvent $event The Symfony post response event
173-
* @return void
172+
* @param PostResponseEvent $event
174173
*/
175174
public function execute(PostResponseEvent $event)
176175
{
@@ -192,8 +191,8 @@ public function execute(PostResponseEvent $event)
192191
* Sets the HTTP headers required to execute post-response Tasks.
193192
* Is called via Symfony's kernel.response event.
194193
*
195-
* @param Symfony\Component\HttpKernel\Event\FilterResponseEvent $event The Symfony response event
196-
* @return Symfony\Component\HttpFoundation\Response
194+
* @param FilterResponseEvent $event
195+
* @return Response
197196
*/
198197
public function filterResponse(FilterResponseEvent $event)
199198
{

0 commit comments

Comments
 (0)