Skip to content

Commit 8fdbfed

Browse files
committed
Merge pull request #1320 from FriendsOfSymfony/BUGFIX2
Fix a typo in the RestActionLoader
2 parents 078a032 + da1d180 commit 8fdbfed

File tree

5 files changed

+27
-5
lines changed

5 files changed

+27
-5
lines changed

Routing/Loader/Reader/RestActionReader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,9 +350,9 @@ private function getMethodArguments(\ReflectionMethod $method)
350350

351351
$argumentClass = $argument->getClass();
352352
if ($argumentClass) {
353+
$className = $argumentClass->getName();
353354
foreach ($ignoreClasses as $class) {
354-
$className = $argumentClass->getName();
355-
if ($className === $class || is_subclass_of($argumentClass, $className)) {
355+
if ($className === $class || is_subclass_of($className, $class)) {
356356
continue 2;
357357
}
358358
}

Tests/Fixtures/Controller/AnnotatedConditionalUsersController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
use FOS\RestBundle\Controller\Annotations\Options;
2424
use FOS\RestBundle\Controller\Annotations\Link;
2525
use FOS\RestBundle\Controller\Annotations\Unlink;
26+
use FOS\RestBundle\Tests\Fixtures\User;
2627

2728
class AnnotatedConditionalUsersController extends Controller
2829
{
@@ -50,7 +51,7 @@ public function getUsersAction()
5051
/**
5152
* @Route(requirements={"slug" = "[a-z]+"})
5253
*/
53-
public function getUserAction($slug)
54+
public function getUserAction(User $slug)
5455
{
5556
}
5657

Tests/Fixtures/Controller/AnnotatedPrefixedController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace FOS\RestBundle\Tests\Fixtures\Controller;
1313

1414
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
15+
use Symfony\Component\HttpFoundation\Request;
1516
use FOS\RestBundle\Controller\Annotations\Prefix;
1617

1718
/**
@@ -20,7 +21,7 @@
2021
*/
2122
class AnnotatedPrefixedController extends Controller
2223
{
23-
public function getSomethingAction()
24+
public function getSomethingAction(Request $request)
2425
{
2526
}
2627

Tests/Fixtures/Controller/ArticleController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use FOS\RestBundle\Routing\ClassResourceInterface;
1515
use FOS\RestBundle\Controller\FOSRestController;
1616
use Symfony\Component\HttpFoundation\Request;
17+
use Symfony\Component\Validator\ConstraintViolationList;
1718

1819
class ArticleController extends FosRestController implements ClassResourceInterface
1920
{
@@ -23,7 +24,7 @@ public function optionsAction()
2324

2425
// [OPTIONS] /articles
2526

26-
public function cgetAction()
27+
public function cgetAction(ConstraintViolationList $errors)
2728
{
2829
}
2930

Tests/Fixtures/User.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the FOSRestBundle package.
5+
*
6+
* (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace FOS\RestBundle\Tests\Fixtures;
13+
14+
/**
15+
* @author Ener-Getick <[email protected]>
16+
*/
17+
class User
18+
{
19+
}

0 commit comments

Comments
 (0)