Skip to content

Commit d9fb0ae

Browse files
committed
touches
1 parent 3e08190 commit d9fb0ae

24 files changed

+100
-98
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/composer.lock
2+
/vendor

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This bundle creates a simple way to incorporate Underground Elephant base code i
1616
``` php
1717
$bundles = array(
1818
// ...
19-
new Uecode\Bundle\CommonBundle\UecodeCommonBundle
19+
new Uecode\Bundle\CommonBundle\UecodeCommonBundle(),
2020
```
2121

2222
3. Make sure, if you are using a user entity, it implements `Uecode\Bundle\CommonBundle\Model\UserInterface`

src/Uecode/Bundle/CommonBundle/Controller/Controller.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* @package common-bundle
45
* @copyright (c) 2013 Underground Elephant
@@ -18,6 +19,7 @@
1819
* See the License for the specific language governing permissions and
1920
* limitations under the License.
2021
*/
22+
2123
namespace Uecode\Bundle\CommonBundle\Controller;
2224

2325
use Doctrine\ORM\EntityManager;
@@ -39,7 +41,6 @@
3941
*/
4042
abstract class Controller extends FrameworkController implements InitializableControllerInterface
4143
{
42-
4344
use DatabaseAwareTrait, UserServiceAwareTrait, ResponseServiceAwareTrait, ViewServiceAwareTrait;
4445

4546
/**
@@ -58,6 +59,9 @@ public function initialize(EntityManager $em, UserService $us, ResponseService $
5859
/**
5960
* Overwrites the render function
6061
*
62+
* @param $view
63+
* @param array $parameters
64+
* @param \Symfony\Component\HttpFoundation\Response $response
6165
* @return Response
6266
*/
6367
public function render($view, array $parameters = array(), Response $response = null)
@@ -69,6 +73,7 @@ public function render($view, array $parameters = array(), Response $response =
6973
/**
7074
* Slugify's the given string
7175
*
76+
* @param string $string
7277
* @return string
7378
*/
7479
protected function slug($string)

src/Uecode/Bundle/CommonBundle/DependencyInjection/Configuration.php

+4-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* @package common-bundle
45
* @copyright (c) 2013 Underground Elephant
@@ -18,16 +19,15 @@
1819
* See the License for the specific language governing permissions and
1920
* limitations under the License.
2021
*/
22+
2123
namespace Uecode\Bundle\CommonBundle\DependencyInjection;
2224

2325
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
24-
use \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
25-
26-
use \Uecode\Bundle\UecodeBundle\DependencyInjection\ConfigurationInterface;
26+
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
27+
use Uecode\Bundle\UecodeBundle\DependencyInjection\ConfigurationInterface;
2728

2829
class Configuration implements ConfigurationInterface
2930
{
30-
3131
/**
3232
* {@inheritDoc}
3333
*/
@@ -36,9 +36,6 @@ public function appendTo(ArrayNodeDefinition &$rootNode)
3636
$rootNode->append($this->addCommonNode());
3737
}
3838

39-
/**
40-
*
41-
*/
4239
private function addCommonNode()
4340
{
4441
$treeBuilder = new TreeBuilder();
@@ -49,9 +46,6 @@ private function addCommonNode()
4946
return $rootNode;
5047
}
5148

52-
/**
53-
*
54-
*/
5549
private function addServiceNode()
5650
{
5751
$treeBuilder = new TreeBuilder();

src/Uecode/Bundle/CommonBundle/DependencyInjection/UecodeCommonExtension.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* @package common-bundle
45
* @copyright (c) 2013 Underground Elephant
@@ -21,15 +22,14 @@
2122

2223
namespace Uecode\Bundle\CommonBundle\DependencyInjection;
2324

24-
use \Symfony\Component\DependencyInjection\ContainerBuilder;
25-
use \Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
26-
use \Symfony\Component\Config\FileLocator;
27-
use \Symfony\Component\DependencyInjection\Loader;
28-
use \Symfony\Component\HttpKernel\DependencyInjection\Extension;
25+
use Symfony\Component\DependencyInjection\ContainerBuilder;
26+
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
27+
use Symfony\Component\Config\FileLocator;
28+
use Symfony\Component\DependencyInjection\Loader;
29+
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
2930

3031
class UecodeCommonExtension extends Extension
3132
{
32-
3333
/**
3434
* {@inheritdoc}
3535
*/

src/Uecode/Bundle/CommonBundle/Event/ControllerEvent.php

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* @package common-bundle
45
* @author Aaron Scherer
@@ -18,15 +19,15 @@
1819
* See the License for the specific language governing permissions and
1920
* limitations under the License.
2021
*/
22+
2123
namespace Uecode\Bundle\CommonBundle\Event;
2224

23-
use \Symfony\Component\EventDispatcher\Event;
24-
use \Symfony\Component\HttpKernel\Event\FilterControllerEvent;
25-
use \Uecode\Bundle\CommonBundle\Model\InitializableControllerInterface as Controller;
25+
use Symfony\Component\EventDispatcher\Event;
26+
use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
27+
use Uecode\Bundle\CommonBundle\Model\InitializableControllerInterface as Controller;
2628

2729
class ControllerEvent extends Event
2830
{
29-
3031
/**
3132
* @var Controller
3233
*/

src/Uecode/Bundle/CommonBundle/Event/ResponseEvent.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* @package common-bundle
45
* @author Aaron Scherer
@@ -18,15 +19,14 @@
1819
* See the License for the specific language governing permissions and
1920
* limitations under the License.
2021
*/
21-
namespace Uecode\Bundle\CommonBundle\Event;
2222

23-
use \Symfony\Component\HttpFoundation\Response;
23+
namespace Uecode\Bundle\CommonBundle\Event;
2424

25-
use \Symfony\Component\EventDispatcher\Event;
25+
use Symfony\Component\HttpFoundation\Response;
26+
use Symfony\Component\EventDispatcher\Event;
2627

2728
class ResponseEvent extends Event
2829
{
29-
3030
/**
3131
* @var Response
3232
*/

src/Uecode/Bundle/CommonBundle/EventListener/ControllerListener.php

+14-15
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* @package common-bundle
45
* @author Aaron Scherer
@@ -18,25 +19,21 @@
1819
* See the License for the specific language governing permissions and
1920
* limitations under the License.
2021
*/
21-
namespace Uecode\Bundle\CommonBundle\EventListener;
2222

23-
use \Symfony\Component\HttpKernel\Event\FilterControllerEvent;
23+
namespace Uecode\Bundle\CommonBundle\EventListener;
2424

25-
use \Uecode\Bundle\CommonBundle\UecodeCommonEvents;
26-
use \Uecode\Bundle\CommonBundle\Event\ControllerEvent;
27-
use \Uecode\Bundle\CommonBundle\Model\InitializableControllerInterface;
28-
use \Uecode\Bundle\CommonBundle\Traits\DatabaseAwareTrait;
29-
use \Uecode\Bundle\CommonBundle\Traits\UserServiceAwareTrait;
30-
use \Uecode\Bundle\CommonBundle\Traits\ResponseServiceAwareTrait;
31-
use \Uecode\Bundle\CommonBundle\Traits\ViewServiceAwareTrait;
32-
use \Uecode\Bundle\CommonBundle\Traits\DispatcherAwareTrait;
25+
use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
26+
use Uecode\Bundle\CommonBundle\UecodeCommonEvents;
27+
use Uecode\Bundle\CommonBundle\Event\ControllerEvent;
28+
use Uecode\Bundle\CommonBundle\Model\InitializableControllerInterface;
29+
use Uecode\Bundle\CommonBundle\Traits\DatabaseAwareTrait;
30+
use Uecode\Bundle\CommonBundle\Traits\UserServiceAwareTrait;
31+
use Uecode\Bundle\CommonBundle\Traits\ResponseServiceAwareTrait;
32+
use Uecode\Bundle\CommonBundle\Traits\ViewServiceAwareTrait;
33+
use Uecode\Bundle\CommonBundle\Traits\DispatcherAwareTrait;
3334

34-
/**
35-
* ControllerListener Class
36-
*/
3735
class ControllerListener
3836
{
39-
4037
use DatabaseAwareTrait, UserServiceAwareTrait, ResponseServiceAwareTrait, ViewServiceAwareTrait,
4138
DispatcherAwareTrait;
4239

@@ -46,7 +43,7 @@ class ControllerListener
4643
*
4744
* @param FilterControllerEvent $event
4845
*
49-
* @return $mixed
46+
* @return void
5047
*/
5148
public function preController(FilterControllerEvent $event)
5249
{
@@ -79,5 +76,7 @@ public function preController(FilterControllerEvent $event)
7976
new ControllerEvent($controllerObject, $event)
8077
);
8178
}
79+
80+
return;
8281
}
8382
}

src/Uecode/Bundle/CommonBundle/Extension/FileExtension.php

+5-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* @package common-bundle
45
* @author Aaron Scherer
@@ -18,19 +19,13 @@
1819
* See the License for the specific language governing permissions and
1920
* limitations under the License.
2021
*/
21-
namespace Uecode\Bundle\CommonBundle\Extension;
2222

23-
use Twig_Extension;
24-
use Twig_SimpleFunction;
23+
namespace Uecode\Bundle\CommonBundle\Extension;
2524

2625
use Symfony\Component\HttpKernel\KernelInterface;
2726

28-
/**
29-
* FileExtension Class
30-
*/
3127
class FileExtension extends \Twig_Extension
3228
{
33-
3429
/**
3530
* @var KernelInterface
3631
*/
@@ -44,8 +39,8 @@ public function __construct(KernelInterface $kernel)
4439
public function getFunctions()
4540
{
4641
$functions = [
47-
new Twig_SimpleFunction('file_include', [$this, 'file'], ['is_safe' => ['html']]),
48-
new Twig_SimpleFunction('file_exists', [$this, 'fileExists'])
42+
new \Twig_SimpleFunction('file_include', [$this, 'file'], ['is_safe' => ['html']]),
43+
new \Twig_SimpleFunction('file_exists', [$this, 'fileExists'])
4944
];
5045

5146
return $functions;
@@ -66,7 +61,7 @@ public function getName()
6661
*
6762
* @param $path A logical path to the file ( e.g '@AcmeFooBundle:Foo:resource.txt' ).
6863
*
69-
* @return bool Whether or not the file exists
64+
* @return Boolean Whether or not the file exists
7065
*/
7166
public function fileExists($path)
7267
{

src/Uecode/Bundle/CommonBundle/Extension/InspectExtension.php

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* @package common-bundle
45
* @author Aaron Scherer
@@ -18,10 +19,8 @@
1819
* See the License for the specific language governing permissions and
1920
* limitations under the License.
2021
*/
21-
namespace Uecode\Bundle\CommonBundle\Extension;
2222

23-
use Twig_Extension;
24-
use Twig_SimpleFunction;
23+
namespace Uecode\Bundle\CommonBundle\Extension;
2524

2625
/**
2726
* InspectExtension Class
@@ -32,8 +31,8 @@ class InspectExtension extends \Twig_Extension
3231
public function getFunctions()
3332
{
3433
return [
35-
new Twig_SimpleFunction('inspect', [$this, 'inspect']),
36-
new Twig_SimpleFunction('var_dump', [$this, 'var_dump']),
34+
new \Twig_SimpleFunction('inspect', [$this, 'inspect']),
35+
new \Twig_SimpleFunction('var_dump', [$this, 'var_dump']),
3736
];
3837
}
3938

src/Uecode/Bundle/CommonBundle/Extension/StringExtension.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* @package common-bundle
45
* @author Aaron Scherer
@@ -18,10 +19,8 @@
1819
* See the License for the specific language governing permissions and
1920
* limitations under the License.
2021
*/
21-
namespace Uecode\Bundle\CommonBundle\Extension;
2222

23-
use Twig_Extension;
24-
use Twig_SimpleFunction;
23+
namespace Uecode\Bundle\CommonBundle\Extension;
2524

2625
/**
2726
* InspectExtension Class
@@ -31,7 +30,7 @@ class StringExtension extends \Twig_Extension
3130

3231
public function getFunctions()
3332
{
34-
return [new Twig_SimpleFunction('sprintf', [$this, 'sprintf'])];
33+
return [new \Twig_SimpleFunction('sprintf', [$this, 'sprintf'])];
3534
}
3635

3736
/**

src/Uecode/Bundle/CommonBundle/Model/InitializableControllerInterface.php

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* @package common-bundle
45
* @author Aaron Scherer
@@ -18,19 +19,16 @@
1819
* See the License for the specific language governing permissions and
1920
* limitations under the License.
2021
*/
22+
2123
namespace Uecode\Bundle\CommonBundle\Model;
2224

23-
use \Doctrine\ORM\EntityManager;
24-
use \Uecode\Bundle\CommonBundle\Service\UserService;
25-
use \Uecode\Bundle\CommonBundle\Service\ResponseService;
26-
use \Uecode\Bundle\CommonBundle\Service\ViewService;
25+
use Doctrine\ORM\EntityManager;
26+
use Uecode\Bundle\CommonBundle\Service\UserService;
27+
use Uecode\Bundle\CommonBundle\Service\ResponseService;
28+
use Uecode\Bundle\CommonBundle\Service\ViewService;
2729

28-
/**
29-
* InitializableControllerInterface Class
30-
*/
3130
interface InitializableControllerInterface
3231
{
33-
3432
public function initialize(
3533
EntityManager $em,
3634
UserService $us,

src/Uecode/Bundle/CommonBundle/Model/UserInterface.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* @package common-bundle
45
* @author Aaron Scherer
@@ -18,14 +19,14 @@
1819
* See the License for the specific language governing permissions and
1920
* limitations under the License.
2021
*/
22+
2123
namespace Uecode\Bundle\CommonBundle\Model;
2224

2325
/**
2426
* Base User Model. Required for UserService
2527
*/
2628
interface UserInterface
2729
{
28-
2930
/**
3031
* Gets the User ID for Database Retrieval
3132
*

0 commit comments

Comments
 (0)