Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
Silex
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
Silex
Commits
8bd96879
Commit
8bd96879
authored
Aug 04, 2015
by
Fabien Potencier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed CS
parent
f4863ded
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
34 additions
and
34 deletions
+34
-34
src/Silex/Application.php
src/Silex/Application.php
+1
-1
tests/Silex/Tests/Application/SecurityTraitTest.php
tests/Silex/Tests/Application/SecurityTraitTest.php
+1
-1
tests/Silex/Tests/EventListener/LogListenerTest.php
tests/Silex/Tests/EventListener/LogListenerTest.php
+2
-2
tests/Silex/Tests/ExceptionHandlerTest.php
tests/Silex/Tests/ExceptionHandlerTest.php
+5
-5
tests/Silex/Tests/LazyUrlMatcherTest.php
tests/Silex/Tests/LazyUrlMatcherTest.php
+1
-1
tests/Silex/Tests/MiddlewareTest.php
tests/Silex/Tests/MiddlewareTest.php
+14
-14
tests/Silex/Tests/Provider/HttpFragmentServiceProviderTest.php
.../Silex/Tests/Provider/HttpFragmentServiceProviderTest.php
+1
-1
tests/Silex/Tests/Provider/SecurityServiceProviderTest.php
tests/Silex/Tests/Provider/SecurityServiceProviderTest.php
+2
-2
tests/Silex/Tests/Provider/TwigServiceProviderTest.php
tests/Silex/Tests/Provider/TwigServiceProviderTest.php
+4
-4
tests/Silex/Tests/Provider/ValidatorServiceProviderTest.php
tests/Silex/Tests/Provider/ValidatorServiceProviderTest.php
+1
-1
tests/Silex/Tests/StreamTest.php
tests/Silex/Tests/StreamTest.php
+1
-1
tests/Silex/Tests/WebTestCaseTest.php
tests/Silex/Tests/WebTestCaseTest.php
+1
-1
No files found.
src/Silex/Application.php
View file @
8bd96879
...
@@ -89,7 +89,7 @@ class Application extends \Pimple implements HttpKernelInterface, TerminableInte
...
@@ -89,7 +89,7 @@ class Application extends \Pimple implements HttpKernelInterface, TerminableInte
$this
[
'dispatcher_class'
]
=
'Symfony\\Component\\EventDispatcher\\EventDispatcher'
;
$this
[
'dispatcher_class'
]
=
'Symfony\\Component\\EventDispatcher\\EventDispatcher'
;
$this
[
'dispatcher'
]
=
$this
->
share
(
function
()
use
(
$app
)
{
$this
[
'dispatcher'
]
=
$this
->
share
(
function
()
use
(
$app
)
{
/*
*
/*
* @var EventDispatcherInterface
* @var EventDispatcherInterface
*/
*/
$dispatcher
=
new
$app
[
'dispatcher_class'
]();
$dispatcher
=
new
$app
[
'dispatcher_class'
]();
...
...
tests/Silex/Tests/Application/SecurityTraitTest.php
View file @
8bd96879
...
@@ -92,7 +92,7 @@ class SecurityTraitTest extends \PHPUnit_Framework_TestCase
...
@@ -92,7 +92,7 @@ class SecurityTraitTest extends \PHPUnit_Framework_TestCase
$request
=
Request
::
create
(
'/'
);
$request
=
Request
::
create
(
'/'
);
$app
=
$this
->
createApplication
(
array
(
$app
=
$this
->
createApplication
(
array
(
'fabien'
=>
array
(
'ROLE_ADMIN'
,
'5FZ2Z8QIkA7UTZ4BYkoC+GsReLf569mSKDsfods6LYQ8t+a8EW9oaircfMpmaLbPBh4FOBiiFyLfuZmTSUwzZg=='
),
'fabien'
=>
array
(
'ROLE_ADMIN'
,
'5FZ2Z8QIkA7UTZ4BYkoC+GsReLf569mSKDsfods6LYQ8t+a8EW9oaircfMpmaLbPBh4FOBiiFyLfuZmTSUwzZg=='
),
'monique'
=>
array
(
'ROLE_USER'
,
'5FZ2Z8QIkA7UTZ4BYkoC+GsReLf569mSKDsfods6LYQ8t+a8EW9oaircfMpmaLbPBh4FOBiiFyLfuZmTSUwzZg=='
),
'monique'
=>
array
(
'ROLE_USER'
,
'5FZ2Z8QIkA7UTZ4BYkoC+GsReLf569mSKDsfods6LYQ8t+a8EW9oaircfMpmaLbPBh4FOBiiFyLfuZmTSUwzZg=='
),
));
));
$app
->
get
(
'/'
,
function
()
{
return
'foo'
;
});
$app
->
get
(
'/'
,
function
()
{
return
'foo'
;
});
...
...
tests/Silex/Tests/EventListener/LogListenerTest.php
View file @
8bd96879
...
@@ -73,13 +73,13 @@ class LogListenerTest extends \PHPUnit_Framework_TestCase
...
@@ -73,13 +73,13 @@ class LogListenerTest extends \PHPUnit_Framework_TestCase
$logger
$logger
->
expects
(
$this
->
once
())
->
expects
(
$this
->
once
())
->
method
(
'critical'
)
->
method
(
'critical'
)
->
with
(
$this
->
equalTo
(
'RuntimeException: Fatal error (uncaught exception) at '
.
__FILE__
.
' line '
.
(
__LINE__
+
14
)))
->
with
(
$this
->
equalTo
(
'RuntimeException: Fatal error (uncaught exception) at '
.
__FILE__
.
' line '
.
(
__LINE__
+
14
)))
;
;
$logger
$logger
->
expects
(
$this
->
once
())
->
expects
(
$this
->
once
())
->
method
(
'error'
)
->
method
(
'error'
)
->
with
(
$this
->
equalTo
(
'Symfony\Component\HttpKernel\Exception\HttpException: Http error (uncaught exception) at '
.
__FILE__
.
' line '
.
(
__LINE__
+
10
)))
->
with
(
$this
->
equalTo
(
'Symfony\Component\HttpKernel\Exception\HttpException: Http error (uncaught exception) at '
.
__FILE__
.
' line '
.
(
__LINE__
+
10
)))
;
;
$dispatcher
=
new
EventDispatcher
();
$dispatcher
=
new
EventDispatcher
();
...
...
tests/Silex/Tests/ExceptionHandlerTest.php
View file @
8bd96879
...
@@ -162,22 +162,22 @@ class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase
...
@@ -162,22 +162,22 @@ class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase
$errors
=
0
;
$errors
=
0
;
$app
->
error
(
function
(
$e
)
use
(
&
$errors
)
{
$app
->
error
(
function
(
$e
)
use
(
&
$errors
)
{
$errors
++
;
++
$errors
;
});
});
$app
->
error
(
function
(
$e
)
use
(
&
$errors
)
{
$app
->
error
(
function
(
$e
)
use
(
&
$errors
)
{
$errors
++
;
++
$errors
;
});
});
$app
->
error
(
function
(
$e
)
use
(
&
$errors
)
{
$app
->
error
(
function
(
$e
)
use
(
&
$errors
)
{
$errors
++
;
++
$errors
;
return
new
Response
(
'foo exception handler'
);
return
new
Response
(
'foo exception handler'
);
});
});
$app
->
error
(
function
(
$e
)
use
(
&
$errors
)
{
$app
->
error
(
function
(
$e
)
use
(
&
$errors
)
{
// should not execute
// should not execute
$errors
++
;
++
$errors
;
});
});
$request
=
Request
::
create
(
'/foo'
);
$request
=
Request
::
create
(
'/foo'
);
...
@@ -198,7 +198,7 @@ class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase
...
@@ -198,7 +198,7 @@ class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase
$errors
=
0
;
$errors
=
0
;
$app
->
error
(
function
(
$e
)
use
(
&
$errors
)
{
$app
->
error
(
function
(
$e
)
use
(
&
$errors
)
{
$errors
++
;
++
$errors
;
});
});
try
{
try
{
...
...
tests/Silex/Tests/LazyUrlMatcherTest.php
View file @
8bd96879
...
@@ -29,7 +29,7 @@ class LazyUrlMatcherTest extends \PHPUnit_Framework_TestCase
...
@@ -29,7 +29,7 @@ class LazyUrlMatcherTest extends \PHPUnit_Framework_TestCase
$urlMatcher
=
$this
->
getMock
(
'Symfony\Component\Routing\Matcher\UrlMatcherInterface'
);
$urlMatcher
=
$this
->
getMock
(
'Symfony\Component\Routing\Matcher\UrlMatcherInterface'
);
$matcher
=
new
LazyUrlMatcher
(
function
()
use
(
$urlMatcher
,
&
$callCounter
)
{
$matcher
=
new
LazyUrlMatcher
(
function
()
use
(
$urlMatcher
,
&
$callCounter
)
{
$callCounter
++
;
++
$callCounter
;
return
$urlMatcher
;
return
$urlMatcher
;
});
});
...
...
tests/Silex/Tests/MiddlewareTest.php
View file @
8bd96879
...
@@ -31,17 +31,17 @@ class MiddlewareTest extends \PHPUnit_Framework_TestCase
...
@@ -31,17 +31,17 @@ class MiddlewareTest extends \PHPUnit_Framework_TestCase
$app
->
before
(
function
()
use
(
&
$i
,
$test
)
{
$app
->
before
(
function
()
use
(
&
$i
,
$test
)
{
$test
->
assertEquals
(
0
,
$i
);
$test
->
assertEquals
(
0
,
$i
);
$i
++
;
++
$i
;
});
});
$app
->
match
(
'/foo'
,
function
()
use
(
&
$i
,
$test
)
{
$app
->
match
(
'/foo'
,
function
()
use
(
&
$i
,
$test
)
{
$test
->
assertEquals
(
1
,
$i
);
$test
->
assertEquals
(
1
,
$i
);
$i
++
;
++
$i
;
});
});
$app
->
after
(
function
()
use
(
&
$i
,
$test
)
{
$app
->
after
(
function
()
use
(
&
$i
,
$test
)
{
$test
->
assertEquals
(
2
,
$i
);
$test
->
assertEquals
(
2
,
$i
);
$i
++
;
++
$i
;
});
});
$request
=
Request
::
create
(
'/foo'
);
$request
=
Request
::
create
(
'/foo'
);
...
@@ -57,13 +57,13 @@ class MiddlewareTest extends \PHPUnit_Framework_TestCase
...
@@ -57,13 +57,13 @@ class MiddlewareTest extends \PHPUnit_Framework_TestCase
$app
=
new
Application
();
$app
=
new
Application
();
$app
->
match
(
'/foo'
,
function
()
use
(
&
$i
)
{
$app
->
match
(
'/foo'
,
function
()
use
(
&
$i
)
{
$i
++
;
++
$i
;
return
new
Response
(
'foo'
);
return
new
Response
(
'foo'
);
});
});
$app
->
after
(
function
()
use
(
&
$i
)
{
$app
->
after
(
function
()
use
(
&
$i
)
{
$i
++
;
++
$i
;
});
});
$request
=
Request
::
create
(
'/foo'
);
$request
=
Request
::
create
(
'/foo'
);
...
@@ -81,27 +81,27 @@ class MiddlewareTest extends \PHPUnit_Framework_TestCase
...
@@ -81,27 +81,27 @@ class MiddlewareTest extends \PHPUnit_Framework_TestCase
$app
->
before
(
function
()
use
(
&
$i
,
$test
)
{
$app
->
before
(
function
()
use
(
&
$i
,
$test
)
{
$test
->
assertEquals
(
0
,
$i
);
$test
->
assertEquals
(
0
,
$i
);
$i
++
;
++
$i
;
});
});
$app
->
before
(
function
()
use
(
&
$i
,
$test
)
{
$app
->
before
(
function
()
use
(
&
$i
,
$test
)
{
$test
->
assertEquals
(
1
,
$i
);
$test
->
assertEquals
(
1
,
$i
);
$i
++
;
++
$i
;
});
});
$app
->
match
(
'/foo'
,
function
()
use
(
&
$i
,
$test
)
{
$app
->
match
(
'/foo'
,
function
()
use
(
&
$i
,
$test
)
{
$test
->
assertEquals
(
2
,
$i
);
$test
->
assertEquals
(
2
,
$i
);
$i
++
;
++
$i
;
});
});
$app
->
after
(
function
()
use
(
&
$i
,
$test
)
{
$app
->
after
(
function
()
use
(
&
$i
,
$test
)
{
$test
->
assertEquals
(
3
,
$i
);
$test
->
assertEquals
(
3
,
$i
);
$i
++
;
++
$i
;
});
});
$app
->
after
(
function
()
use
(
&
$i
,
$test
)
{
$app
->
after
(
function
()
use
(
&
$i
,
$test
)
{
$test
->
assertEquals
(
4
,
$i
);
$test
->
assertEquals
(
4
,
$i
);
$i
++
;
++
$i
;
});
});
$request
=
Request
::
create
(
'/foo'
);
$request
=
Request
::
create
(
'/foo'
);
...
@@ -117,7 +117,7 @@ class MiddlewareTest extends \PHPUnit_Framework_TestCase
...
@@ -117,7 +117,7 @@ class MiddlewareTest extends \PHPUnit_Framework_TestCase
$app
=
new
Application
();
$app
=
new
Application
();
$app
->
before
(
function
()
use
(
&
$i
)
{
$app
->
before
(
function
()
use
(
&
$i
)
{
$i
++
;
++
$i
;
});
});
$app
->
match
(
'/foo'
,
function
()
{
$app
->
match
(
'/foo'
,
function
()
{
...
@@ -125,7 +125,7 @@ class MiddlewareTest extends \PHPUnit_Framework_TestCase
...
@@ -125,7 +125,7 @@ class MiddlewareTest extends \PHPUnit_Framework_TestCase
});
});
$app
->
after
(
function
()
use
(
&
$i
)
{
$app
->
after
(
function
()
use
(
&
$i
)
{
$i
++
;
++
$i
;
});
});
$app
->
error
(
function
()
{
$app
->
error
(
function
()
{
...
@@ -145,11 +145,11 @@ class MiddlewareTest extends \PHPUnit_Framework_TestCase
...
@@ -145,11 +145,11 @@ class MiddlewareTest extends \PHPUnit_Framework_TestCase
$app
=
new
Application
();
$app
=
new
Application
();
$app
->
before
(
function
()
use
(
&
$i
)
{
$app
->
before
(
function
()
use
(
&
$i
)
{
$i
++
;
++
$i
;
},
Application
::
EARLY_EVENT
);
},
Application
::
EARLY_EVENT
);
$app
->
after
(
function
()
use
(
&
$i
)
{
$app
->
after
(
function
()
use
(
&
$i
)
{
$i
++
;
++
$i
;
});
});
$app
->
error
(
function
()
{
$app
->
error
(
function
()
{
...
...
tests/Silex/Tests/Provider/HttpFragmentServiceProviderTest.php
View file @
8bd96879
...
@@ -32,7 +32,7 @@ class HttpFragmentServiceProviderTest extends \PHPUnit_Framework_TestCase
...
@@ -32,7 +32,7 @@ class HttpFragmentServiceProviderTest extends \PHPUnit_Framework_TestCase
$app
->
register
(
new
TwigServiceProvider
(),
array
(
$app
->
register
(
new
TwigServiceProvider
(),
array
(
'twig.templates'
=>
array
(
'twig.templates'
=>
array
(
'hello'
=>
'{{ render("/foo") }}{{ render_esi("/foo") }}{{ render_hinclude("/foo") }}'
,
'hello'
=>
'{{ render("/foo") }}{{ render_esi("/foo") }}{{ render_hinclude("/foo") }}'
,
'foo'
=>
'foo'
,
'foo'
=>
'foo'
,
),
),
));
));
...
...
tests/Silex/Tests/Provider/SecurityServiceProviderTest.php
View file @
8bd96879
...
@@ -205,7 +205,7 @@ class SecurityServiceProviderTest extends WebTestCase
...
@@ -205,7 +205,7 @@ class SecurityServiceProviderTest extends WebTestCase
'users'
=>
array
(
'users'
=>
array
(
// password is foo
// password is foo
'fabien'
=>
array
(
'ROLE_USER'
,
'5FZ2Z8QIkA7UTZ4BYkoC+GsReLf569mSKDsfods6LYQ8t+a8EW9oaircfMpmaLbPBh4FOBiiFyLfuZmTSUwzZg=='
),
'fabien'
=>
array
(
'ROLE_USER'
,
'5FZ2Z8QIkA7UTZ4BYkoC+GsReLf569mSKDsfods6LYQ8t+a8EW9oaircfMpmaLbPBh4FOBiiFyLfuZmTSUwzZg=='
),
'admin'
=>
array
(
'ROLE_ADMIN'
,
'5FZ2Z8QIkA7UTZ4BYkoC+GsReLf569mSKDsfods6LYQ8t+a8EW9oaircfMpmaLbPBh4FOBiiFyLfuZmTSUwzZg=='
),
'admin'
=>
array
(
'ROLE_ADMIN'
,
'5FZ2Z8QIkA7UTZ4BYkoC+GsReLf569mSKDsfods6LYQ8t+a8EW9oaircfMpmaLbPBh4FOBiiFyLfuZmTSUwzZg=='
),
),
),
),
),
),
),
...
@@ -256,7 +256,7 @@ class SecurityServiceProviderTest extends WebTestCase
...
@@ -256,7 +256,7 @@ class SecurityServiceProviderTest extends WebTestCase
'users'
=>
array
(
'users'
=>
array
(
// password is foo
// password is foo
'dennis'
=>
array
(
'ROLE_USER'
,
'5FZ2Z8QIkA7UTZ4BYkoC+GsReLf569mSKDsfods6LYQ8t+a8EW9oaircfMpmaLbPBh4FOBiiFyLfuZmTSUwzZg=='
),
'dennis'
=>
array
(
'ROLE_USER'
,
'5FZ2Z8QIkA7UTZ4BYkoC+GsReLf569mSKDsfods6LYQ8t+a8EW9oaircfMpmaLbPBh4FOBiiFyLfuZmTSUwzZg=='
),
'admin'
=>
array
(
'ROLE_ADMIN'
,
'5FZ2Z8QIkA7UTZ4BYkoC+GsReLf569mSKDsfods6LYQ8t+a8EW9oaircfMpmaLbPBh4FOBiiFyLfuZmTSUwzZg=='
),
'admin'
=>
array
(
'ROLE_ADMIN'
,
'5FZ2Z8QIkA7UTZ4BYkoC+GsReLf569mSKDsfods6LYQ8t+a8EW9oaircfMpmaLbPBh4FOBiiFyLfuZmTSUwzZg=='
),
),
),
),
),
),
),
...
...
tests/Silex/Tests/Provider/TwigServiceProviderTest.php
View file @
8bd96879
...
@@ -28,7 +28,7 @@ class TwigServiceProviderTest extends \PHPUnit_Framework_TestCase
...
@@ -28,7 +28,7 @@ class TwigServiceProviderTest extends \PHPUnit_Framework_TestCase
$app
=
new
Application
();
$app
=
new
Application
();
$app
->
register
(
new
TwigServiceProvider
(),
array
(
$app
->
register
(
new
TwigServiceProvider
(),
array
(
'twig.templates'
=>
array
(
'hello'
=>
'Hello {{ name }}!'
),
'twig.templates'
=>
array
(
'hello'
=>
'Hello {{ name }}!'
),
));
));
$app
->
get
(
'/hello/{name}'
,
function
(
$name
)
use
(
$app
)
{
$app
->
get
(
'/hello/{name}'
,
function
(
$name
)
use
(
$app
)
{
...
@@ -50,9 +50,9 @@ class TwigServiceProviderTest extends \PHPUnit_Framework_TestCase
...
@@ -50,9 +50,9 @@ class TwigServiceProviderTest extends \PHPUnit_Framework_TestCase
$app
->
register
(
new
HttpFragmentServiceProvider
());
$app
->
register
(
new
HttpFragmentServiceProvider
());
$app
->
register
(
new
TwigServiceProvider
(),
array
(
$app
->
register
(
new
TwigServiceProvider
(),
array
(
'twig.templates'
=>
array
(
'twig.templates'
=>
array
(
'hello'
=>
'{{ render("/foo") }}'
,
'hello'
=>
'{{ render("/foo") }}'
,
'foo'
=>
'foo'
,
'foo'
=>
'foo'
,
),
),
));
));
...
@@ -73,7 +73,7 @@ class TwigServiceProviderTest extends \PHPUnit_Framework_TestCase
...
@@ -73,7 +73,7 @@ class TwigServiceProviderTest extends \PHPUnit_Framework_TestCase
{
{
$app
=
new
Application
();
$app
=
new
Application
();
$app
->
register
(
new
TwigServiceProvider
(),
array
(
$app
->
register
(
new
TwigServiceProvider
(),
array
(
'twig.templates'
=>
array
(
'foo'
=>
'foo'
),
'twig.templates'
=>
array
(
'foo'
=>
'foo'
),
));
));
$loader
=
$this
->
getMock
(
'\Twig_LoaderInterface'
);
$loader
=
$this
->
getMock
(
'\Twig_LoaderInterface'
);
$loader
->
expects
(
$this
->
never
())
->
method
(
'getSource'
);
$loader
->
expects
(
$this
->
never
())
->
method
(
'getSource'
);
...
...
tests/Silex/Tests/Provider/ValidatorServiceProviderTest.php
View file @
8bd96879
...
@@ -89,7 +89,7 @@ class ValidatorServiceProviderTest extends \PHPUnit_Framework_TestCase
...
@@ -89,7 +89,7 @@ class ValidatorServiceProviderTest extends \PHPUnit_Framework_TestCase
));
));
$builder
=
$app
[
'form.factory'
]
->
createBuilder
(
'form'
,
array
(),
array
(
$builder
=
$app
[
'form.factory'
]
->
createBuilder
(
'form'
,
array
(),
array
(
'constraints'
=>
$constraints
,
'constraints'
=>
$constraints
,
'csrf_protection'
=>
false
,
'csrf_protection'
=>
false
,
));
));
...
...
tests/Silex/Tests/StreamTest.php
View file @
8bd96879
...
@@ -35,7 +35,7 @@ class StreamTest extends \PHPUnit_Framework_TestCase
...
@@ -35,7 +35,7 @@ class StreamTest extends \PHPUnit_Framework_TestCase
$i
=
0
;
$i
=
0
;
$stream
=
function
()
use
(
&
$i
)
{
$stream
=
function
()
use
(
&
$i
)
{
$i
++
;
++
$i
;
};
};
$app
=
new
Application
();
$app
=
new
Application
();
...
...
tests/Silex/Tests/WebTestCaseTest.php
View file @
8bd96879
...
@@ -68,7 +68,7 @@ class WebTestCaseTest extends WebTestCase
...
@@ -68,7 +68,7 @@ class WebTestCaseTest extends WebTestCase
$client
=
$this
->
createClient
(
array
(
$client
=
$this
->
createClient
(
array
(
'PHP_AUTH_USER'
=>
$user
,
'PHP_AUTH_USER'
=>
$user
,
'PHP_AUTH_PW'
=>
$pass
,
'PHP_AUTH_PW'
=>
$pass
,
));
));
$crawler
=
$client
->
request
(
'GET'
,
'/server'
);
$crawler
=
$client
->
request
(
'GET'
,
'/server'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment