@@ -31,7 +31,7 @@ |
||
31 | 31 | * |
32 | 32 | * @param UrlGeneratorInterface $generator |
33 | 33 | * |
34 | - * @return void |
|
34 | + * @return \Twig_ExtensionInterface |
|
35 | 35 | */ |
36 | 36 | public function __construct(UrlGeneratorInterface $generator) |
37 | 37 | { |
@@ -41,7 +41,7 @@ |
||
41 | 41 | * @param FileLocatorInterface $locator A FileLocatorInterface instance |
42 | 42 | * @param TemplateNameParserInterface $parser A TemplateNameParserInterface instance |
43 | 43 | * |
44 | - * @return void |
|
44 | + * @return null|\Twig_LoaderInterface |
|
45 | 45 | */ |
46 | 46 | public function __construct(FileLocatorInterface $locator, TemplateNameParserInterface $parser) |
47 | 47 | { |
@@ -8,8 +8,8 @@ |
||
8 | 8 | */ |
9 | 9 | namespace PPI\Templating\Twig\Loader; |
10 | 10 | |
11 | -use Symfony\Component\Templating\TemplateNameParserInterface, |
|
12 | - Symfony\Component\Config\FileLocatorInterface; |
|
11 | +use Symfony\Component\Templating\TemplateNameParserInterface; |
|
12 | +use Symfony\Component\Config\FileLocatorInterface; |
|
13 | 13 | |
14 | 14 | /** |
15 | 15 | * FilesystemLoader extends the default Twig filesystem loader |
@@ -70,7 +70,7 @@ |
||
70 | 70 | /** |
71 | 71 | * Renders a template. |
72 | 72 | * |
73 | - * @param mixed $name A template name |
|
73 | + * @param string $name A template name |
|
74 | 74 | * @param array $parameters An array of parameters to pass to the template |
75 | 75 | * |
76 | 76 | * @throws \InvalidArgumentException if the template does not exist |
@@ -10,13 +10,13 @@ |
||
10 | 10 | |
11 | 11 | namespace PPI\Templating\Twig; |
12 | 12 | |
13 | -use PPI\Templating\TemplateReference, |
|
14 | - PPI\Templating\EngineInterface, |
|
15 | - PPI\Templating\GlobalVariables, |
|
16 | - Symfony\Component\Templating\TemplateNameParserInterface, |
|
17 | - Symfony\Component\Templating\StreamingEngineInterface, |
|
18 | - Symfony\Component\HttpFoundation\Response, |
|
19 | - Symfony\Component\Config\FileLocatorInterface; |
|
13 | +use PPI\Templating\TemplateReference; |
|
14 | +use PPI\Templating\EngineInterface; |
|
15 | +use PPI\Templating\GlobalVariables; |
|
16 | +use Symfony\Component\Templating\TemplateNameParserInterface; |
|
17 | +use Symfony\Component\Templating\StreamingEngineInterface; |
|
18 | +use Symfony\Component\HttpFoundation\Response; |
|
19 | +use Symfony\Component\Config\FileLocatorInterface; |
|
20 | 20 | |
21 | 21 | /** |
22 | 22 | * This engine knows how to render Twig templates. |
@@ -81,9 +81,9 @@ |
||
81 | 81 | { |
82 | 82 | |
83 | 83 | if ('@' === $file[0]) { |
84 | - if (false !== strpos($file, '..')) { |
|
85 | - throw new \RuntimeException(sprintf('File name "%s" contains invalid characters (..).', $file)); |
|
86 | - } |
|
84 | + if (false !== strpos($file, '..')) { |
|
85 | + throw new \RuntimeException(sprintf('File name "%s" contains invalid characters (..).', $file)); |
|
86 | + } |
|
87 | 87 | |
88 | 88 | $path = $this->baseModulePath . '/' . substr($file, 1); |
89 | 89 | if (file_exists($path)) { |
@@ -124,7 +124,7 @@ |
||
124 | 124 | $paths = array(); |
125 | 125 | |
126 | 126 | foreach ($this->modules as $module) { |
127 | - $paths[$module] = $this->baseModulePath.DIRECTORY_SEPARATOR.$module; |
|
127 | + $paths[$module] = $this->baseModulePath . DIRECTORY_SEPARATOR . $module; |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | return $paths; |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | */ |
89 | 89 | public function offsetExists($property) |
90 | 90 | { |
91 | - return method_exists($this, 'get'.ucfirst($property)); |
|
91 | + return method_exists($this, 'get' . ucfirst($property)); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | /** |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | */ |
97 | 97 | public function offsetGet($property) |
98 | 98 | { |
99 | - return call_user_func(array($this, 'get'.ucfirst($property))); |
|
99 | + return call_user_func(array($this, 'get' . ucfirst($property))); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | /** |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | */ |
105 | 105 | public function offsetSet($property, $value) |
106 | 106 | { |
107 | - throw new \RuntimeException('Usage of '.__METHOD__.' is not allowed'); |
|
107 | + throw new \RuntimeException('Usage of ' . __METHOD__ . ' is not allowed'); |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | /** |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | */ |
113 | 113 | public function offsetUnset($property) |
114 | 114 | { |
115 | - throw new \RuntimeException('Usage of '.__METHOD__.' is not allowed'); |
|
115 | + throw new \RuntimeException('Usage of ' . __METHOD__ . ' is not allowed'); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * Returns a list of functions to add to the existing list. |
42 | 42 | * |
43 | 43 | * @return array An array of functions |
44 | - */ |
|
44 | + */ |
|
45 | 45 | public function getFunctions() |
46 | 46 | { |
47 | 47 | return array( |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | * @param string $packageName The name of the asset package to use |
60 | 60 | * |
61 | 61 | * @return string A public path which takes into account the base path and URL path |
62 | - */ |
|
62 | + */ |
|
63 | 63 | public function getAssetUrl($path, $packageName = null) |
64 | 64 | { |
65 | 65 | return $this->assetsHelper->getUrl($path, $packageName); |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | * @param string $packageName |
72 | 72 | * |
73 | 73 | * @return integer |
74 | - */ |
|
74 | + */ |
|
75 | 75 | public function getAssetsVersion($packageName = null) |
76 | 76 | { |
77 | 77 | return $this->assetsHelper->getVersion($packageName); |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | * Returns the name of the extension. |
82 | 82 | * |
83 | 83 | * @return string The extension name |
84 | - */ |
|
84 | + */ |
|
85 | 85 | public function getName() |
86 | 86 | { |
87 | 87 | return 'assets'; |
@@ -31,7 +31,7 @@ |
||
31 | 31 | * |
32 | 32 | * @param UrlGeneratorInterface $generator |
33 | 33 | * |
34 | - * @return void |
|
34 | + * @return \Twig_ExtensionInterface |
|
35 | 35 | */ |
36 | 36 | public function __construct(UrlGeneratorInterface $generator) |
37 | 37 | { |
@@ -68,9 +68,9 @@ |
||
68 | 68 | { |
69 | 69 | $controller = str_replace('\\', '/', $this->get('controller')); |
70 | 70 | |
71 | - $path = (empty($controller) ? '' : $controller.'/').$this->get('name').'.'.$this->get('format').'.'.$this->get('engine'); |
|
71 | + $path = (empty($controller) ? '' : $controller . '/') . $this->get('name') . '.' . $this->get('format') . '.' . $this->get('engine'); |
|
72 | 72 | |
73 | - return empty($this->parameters['module']) ? self::APP_VIEWS_DIRECTORY.'/'.$path : '@'.$this->get('module').'/'.self::MODULE_VIEWS_DIRECTORY.'/'.$path; |
|
73 | + return empty($this->parameters['module']) ? self::APP_VIEWS_DIRECTORY . '/' . $path : '@' . $this->get('module') . '/' . self::MODULE_VIEWS_DIRECTORY . '/' . $path; |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
@@ -6,17 +6,17 @@ |
||
6 | 6 | * @license http://opensource.org/licenses/mit-license.php MIT |
7 | 7 | * @link http://www.ppi.io |
8 | 8 | */ |
9 | - namespace PPI\Templating\Smarty\Extension; |
|
9 | + namespace PPI\Templating\Smarty\Extension; |
|
10 | 10 | |
11 | - use NoiseLabs\Bundle\SmartyBundle\Extension\RoutingExtension as BaseRoutingExtension; |
|
11 | + use NoiseLabs\Bundle\SmartyBundle\Extension\RoutingExtension as BaseRoutingExtension; |
|
12 | 12 | |
13 | - /** |
|
14 | - * Provides integration of the Routing component with Smarty[Bundle]. |
|
15 | - * |
|
16 | - * @author Vítor Brandão <[email protected]> |
|
17 | - * @package PPI |
|
18 | - * @subpackage Templating |
|
19 | - */ |
|
20 | - class RouterExtension extends BaseRoutingExtension |
|
21 | - { |
|
22 | - } |
|
13 | + /** |
|
14 | + * Provides integration of the Routing component with Smarty[Bundle]. |
|
15 | + * |
|
16 | + * @author Vítor Brandão <[email protected]> |
|
17 | + * @package PPI |
|
18 | + * @subpackage Templating |
|
19 | + */ |
|
20 | + class RouterExtension extends BaseRoutingExtension |
|
21 | + { |
|
22 | + } |
@@ -9,19 +9,19 @@ |
||
9 | 9 | namespace PPI\Tests\Exception; |
10 | 10 | |
11 | 11 | use PPI\Test\Unit, |
12 | - PPI\Exception\Log; |
|
12 | + PPI\Exception\Log; |
|
13 | 13 | |
14 | 14 | class LogTest extends Unit { |
15 | 15 | |
16 | - public $logger; |
|
16 | + public $logger; |
|
17 | 17 | |
18 | - public function setUp() { |
|
19 | - $this->logger = new Log(); |
|
20 | - } |
|
18 | + public function setUp() { |
|
19 | + $this->logger = new Log(); |
|
20 | + } |
|
21 | 21 | |
22 | - public function testSetLogFile() { |
|
23 | - $this->logger->setLogFile('foobar'); |
|
24 | - $this->assertAttributeContains('foobar', '_logFile', $this->logger); |
|
25 | - } |
|
22 | + public function testSetLogFile() { |
|
23 | + $this->logger->setLogFile('foobar'); |
|
24 | + $this->assertAttributeContains('foobar', '_logFile', $this->logger); |
|
25 | + } |
|
26 | 26 | |
27 | 27 | } |
28 | 28 | \ No newline at end of file |