@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | $path = str_replace('{action}', $action->getName(), $path); |
94 | 94 | // by default, generic controller |
95 | 95 | $defaults = [ |
96 | - '_controller' => $admin->getConfiguration()->getControllerName().':'.$action->getName(), |
|
96 | + '_controller' => $admin->getConfiguration()->getControllerName() . ':' . $action->getName(), |
|
97 | 97 | '_admin' => $admin->getName(), |
98 | 98 | '_action' => $action->getName(), |
99 | 99 | ]; |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | { |
136 | 136 | $array = explode('\\', $namespace); |
137 | 137 | $path = array_pop($array); |
138 | - $path = strtolower(substr($path, 0, 1)).substr($path, 1); |
|
138 | + $path = strtolower(substr($path, 0, 1)) . substr($path, 1); |
|
139 | 139 | |
140 | 140 | return $path; |
141 | 141 | } |
@@ -81,7 +81,7 @@ |
||
81 | 81 | // test with no configuration |
82 | 82 | $adminFactory = $this->mockAdminFactory(); |
83 | 83 | // unknow admin not exists, it should throw an exception |
84 | - $this->assertExceptionRaised('Exception', function () use ($adminFactory) { |
|
84 | + $this->assertExceptionRaised('Exception', function() use ($adminFactory) { |
|
85 | 85 | $adminFactory->getAdmin('unknown_admin'); |
86 | 86 | }); |
87 | 87 | // test with configurations samples |
@@ -259,7 +259,7 @@ |
||
259 | 259 | $repository = $this->mockEntityRepository(); |
260 | 260 | $repository |
261 | 261 | ->method('getEntityPersister') |
262 | - ->willReturn( $this |
|
262 | + ->willReturn($this |
|
263 | 263 | ->getMockBuilder('Doctrine\ORM\Persisters\Entity\BasicEntityPersister') |
264 | 264 | ->disableOriginalConstructor() |
265 | 265 | ->getMock()); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | /** |
78 | 78 | * Assert that an exception is raised in the given code. |
79 | 79 | * |
80 | - * @param $exceptionClass |
|
80 | + * @param string $exceptionClass |
|
81 | 81 | * @param Closure $closure |
82 | 82 | */ |
83 | 83 | protected function assertExceptionRaised($exceptionClass, Closure $closure) |
@@ -124,8 +124,8 @@ discard block |
||
124 | 124 | } |
125 | 125 | |
126 | 126 | /** |
127 | - * @param $name |
|
128 | - * @param $configuration |
|
127 | + * @param string $name |
|
128 | + * @param \LAG\AdminBundle\Admin\Configuration\AdminConfiguration $configuration |
|
129 | 129 | * @return Admin |
130 | 130 | */ |
131 | 131 | protected function mockAdmin($name, $configuration) |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | |
141 | 141 | /** |
142 | 142 | * @param $name |
143 | - * @return ActionInterface|PHPUnit_Framework_MockObject_MockObject |
|
143 | + * @return ActionInterface |
|
144 | 144 | */ |
145 | 145 | protected function mockAction($name) |
146 | 146 | { |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | /** |
238 | 238 | * Return a mock of an entity repository |
239 | 239 | * |
240 | - * @return RepositoryInterface|PHPUnit_Framework_MockObject_MockObject |
|
240 | + * @return \Doctrine\Common\Persistence\ObjectRepository |
|
241 | 241 | */ |
242 | 242 | protected function mockEntityRepository() |
243 | 243 | { |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | } |
276 | 276 | |
277 | 277 | /** |
278 | - * @return ActionFactory|PHPUnit_Framework_MockObject_MockObject |
|
278 | + * @return ActionFactory |
|
279 | 279 | */ |
280 | 280 | protected function mockActionFactory() |
281 | 281 | { |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | } |
318 | 318 | |
319 | 319 | /** |
320 | - * @return MessageHandlerInterface|PHPUnit_Framework_MockObject_MockObject |
|
320 | + * @return MessageHandlerInterface |
|
321 | 321 | */ |
322 | 322 | protected function mockMessageHandler() |
323 | 323 | { |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | } |
341 | 341 | |
342 | 342 | /** |
343 | - * @return DataProviderInterface|PHPUnit_Framework_MockObject_MockObject |
|
343 | + * @return DataProviderInterface |
|
344 | 344 | */ |
345 | 345 | protected function mockDataProvider() |
346 | 346 | { |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | |
23 | 23 | public function registerContainerConfiguration(LoaderInterface $loader) |
24 | 24 | { |
25 | - $loader->load(__DIR__.'/config/config_test.yml'); |
|
25 | + $loader->load(__DIR__ . '/config/config_test.yml'); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | public function getCacheDir() |
32 | 32 | { |
33 | - $cacheDir = sys_get_temp_dir().'/phpunit/cache'; |
|
33 | + $cacheDir = sys_get_temp_dir() . '/phpunit/cache'; |
|
34 | 34 | |
35 | 35 | if (!is_dir($cacheDir)) { |
36 | 36 | mkdir($cacheDir, 0777, true); |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public function getLogDir() |
46 | 46 | { |
47 | - $logDir = sys_get_temp_dir().'/phpunit/logs'; |
|
47 | + $logDir = sys_get_temp_dir() . '/phpunit/logs'; |
|
48 | 48 | |
49 | 49 | if (!is_dir($logDir)) { |
50 | 50 | mkdir($logDir, 0777, true); |
@@ -4,13 +4,13 @@ discard block |
||
4 | 4 | |
5 | 5 | //use Symfony\Component\HttpFoundation\Request; |
6 | 6 | |
7 | -if (!is_file($loaderFile = __DIR__.'/../vendor/autoload.php') && !is_file($loaderFile = __DIR__.'/../../../../../../vendor/autoload.php')) { |
|
7 | +if (!is_file($loaderFile = __DIR__ . '/../vendor/autoload.php') && !is_file($loaderFile = __DIR__ . '/../../../../../../vendor/autoload.php')) { |
|
8 | 8 | throw new LogicException('Could not find autoload.php in vendor/. Did you run "composer install --dev"?'); |
9 | 9 | } |
10 | 10 | |
11 | 11 | /** @var \Composer\Autoload\ClassLoader $loader */ |
12 | 12 | $loader = require $loaderFile; |
13 | -$loader->add('', __DIR__.'/src/'); |
|
13 | +$loader->add('', __DIR__ . '/src/'); |
|
14 | 14 | $loader->register(); |
15 | 15 | |
16 | 16 | //require_once __DIR__ . '/src/Entity/TestEntity.php'; |
@@ -30,4 +30,4 @@ discard block |
||
30 | 30 | //$loader = require_once __DIR__.'/app/bootstrap.php.cache'; |
31 | 31 | |
32 | 32 | //require_once __DIR__ . '/src/Test/TestBundle/TestTestBundle.php'; |
33 | -require_once __DIR__.'/app/AppKernel.php'; |
|
33 | +require_once __DIR__ . '/app/AppKernel.php'; |
@@ -358,7 +358,7 @@ |
||
358 | 358 | } |
359 | 359 | |
360 | 360 | /** |
361 | - * @return array |
|
361 | + * @return integer[] |
|
362 | 362 | */ |
363 | 363 | public function getActionNames() |
364 | 364 | { |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | $hooks = []; |
250 | 250 | |
251 | 251 | foreach ($fields as $fieldName) { |
252 | - $exporter->addHook(function ($fieldValue) { |
|
252 | + $exporter->addHook(function($fieldValue) { |
|
253 | 253 | // if field is an array |
254 | 254 | if (is_array($fieldValue)) { |
255 | 255 | $value = recursiveImplode(', ', $fieldValue); |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | $this->forward404Unless( |
295 | 295 | $admin->isActionGranted($admin->getCurrentAction()->getName(), $roles), |
296 | 296 | sprintf('User with roles %s not allowed for action "%s"', |
297 | - implode(', ', array_map(function (Role $role) { |
|
297 | + implode(', ', array_map(function(Role $role) { |
|
298 | 298 | return $role->getRole(); |
299 | 299 | }, $roles)), |
300 | 300 | $admin->getCurrentAction()->getName() |
@@ -27,7 +27,7 @@ |
||
27 | 27 | public function render($value) |
28 | 28 | { |
29 | 29 | if (!is_array($value) && !($value instanceof Traversable)) { |
30 | - throw new Exception('Value should be an array instead of '.gettype($value)); |
|
30 | + throw new Exception('Value should be an array instead of ' . gettype($value)); |
|
31 | 31 | } |
32 | 32 | if ($value instanceof Collection) { |
33 | 33 | $value = $value->toArray(); |
@@ -83,7 +83,7 @@ |
||
83 | 83 | */ |
84 | 84 | public function setOptions(array $options) |
85 | 85 | { |
86 | - $this->length = (int)$options['length']; |
|
86 | + $this->length = (int) $options['length']; |
|
87 | 87 | $this->replace = $options['replace']; |
88 | 88 | $this->translation = $options['translation']; |
89 | 89 | } |