This commit is contained in:
Fabien Potencier 2012-07-09 14:50:58 +02:00
parent d15faad7cd
commit d100ffaf76
393 changed files with 996 additions and 1088 deletions

View File

@ -23,7 +23,7 @@ interface EntityLoaderInterface
* *
* @return array The entities. * @return array The entities.
*/ */
function getEntities(); public function getEntities();
/** /**
* Returns an array of entities matching the given identifiers. * Returns an array of entities matching the given identifiers.
@ -35,5 +35,5 @@ interface EntityLoaderInterface
* *
* @return array The entities. * @return array The entities.
*/ */
function getEntitiesByIds($identifier, array $values); public function getEntitiesByIds($identifier, array $values);
} }

View File

@ -26,7 +26,7 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface;
*/ */
class MergeDoctrineCollectionListener implements EventSubscriberInterface class MergeDoctrineCollectionListener implements EventSubscriberInterface
{ {
static public function getSubscribedEvents() public static function getSubscribedEvents()
{ {
// Higher priority than core MergeCollectionListener so that this one // Higher priority than core MergeCollectionListener so that this one
// is called before // is called before

View File

@ -26,7 +26,7 @@ interface RegistryInterface extends ManagerRegistryInterface
* *
* @return string The default entity manager name * @return string The default entity manager name
*/ */
function getDefaultEntityManagerName(); public function getDefaultEntityManagerName();
/** /**
* Gets a named entity manager. * Gets a named entity manager.
@ -35,14 +35,14 @@ interface RegistryInterface extends ManagerRegistryInterface
* *
* @return EntityManager * @return EntityManager
*/ */
function getEntityManager($name = null); public function getEntityManager($name = null);
/** /**
* Gets an array of all registered entity managers * Gets an array of all registered entity managers
* *
* @return array An array of EntityManager instances * @return array An array of EntityManager instances
*/ */
function getEntityManagers(); public function getEntityManagers();
/** /**
* Resets a named entity manager. * Resets a named entity manager.
@ -61,7 +61,7 @@ interface RegistryInterface extends ManagerRegistryInterface
* *
* @return EntityManager * @return EntityManager
*/ */
function resetEntityManager($name = null); public function resetEntityManager($name = null);
/** /**
* Resolves a registered namespace alias to the full namespace. * Resolves a registered namespace alias to the full namespace.
@ -74,14 +74,14 @@ interface RegistryInterface extends ManagerRegistryInterface
* *
* @see Configuration::getEntityNamespace * @see Configuration::getEntityNamespace
*/ */
function getEntityNamespace($alias); public function getEntityNamespace($alias);
/** /**
* Gets all connection names. * Gets all connection names.
* *
* @return array An array of connection names * @return array An array of connection names
*/ */
function getEntityManagerNames(); public function getEntityManagerNames();
/** /**
* Gets the entity manager associated with a given class. * Gets the entity manager associated with a given class.
@ -90,5 +90,5 @@ interface RegistryInterface extends ManagerRegistryInterface
* *
* @return EntityManager|null * @return EntityManager|null
*/ */
function getEntityManagerForClass($class); public function getEntityManagerForClass($class);
} }

View File

@ -35,7 +35,7 @@ abstract class DoctrineOrmTestCase extends \PHPUnit_Framework_TestCase
/** /**
* @return EntityManager * @return EntityManager
*/ */
static public function createTestEntityManager($paths = array()) public static function createTestEntityManager($paths = array())
{ {
if (!class_exists('PDO') || !in_array('sqlite', \PDO::getAvailableDrivers())) { if (!class_exists('PDO') || !in_array('sqlite', \PDO::getAvailableDrivers())) {
self::markTestSkipped('This test requires SQLite support in your environment'); self::markTestSkipped('This test requires SQLite support in your environment');

View File

@ -32,6 +32,6 @@ class SingleIdentEntity
public function __toString() public function __toString()
{ {
return (string)$this->name; return (string) $this->name;
} }
} }

View File

@ -105,7 +105,7 @@ class PropelTypeGuesserTest extends Propel1TestCase
$this->assertEquals($confidence, $value->getConfidence()); $this->assertEquals($confidence, $value->getConfidence());
} }
static public function dataProviderForGuessType() public static function dataProviderForGuessType()
{ {
return array( return array(
array('is_active', 'checkbox', Guess::HIGH_CONFIDENCE), array('is_active', 'checkbox', Guess::HIGH_CONFIDENCE),

View File

@ -98,32 +98,32 @@ class FormExtensionDivLayoutTest extends AbstractDivLayoutTest
protected function renderEnctype(FormView $view) protected function renderEnctype(FormView $view)
{ {
return (string)$this->extension->renderEnctype($view); return (string) $this->extension->renderEnctype($view);
} }
protected function renderLabel(FormView $view, $label = null, array $vars = array()) protected function renderLabel(FormView $view, $label = null, array $vars = array())
{ {
return (string)$this->extension->renderLabel($view, $label, $vars); return (string) $this->extension->renderLabel($view, $label, $vars);
} }
protected function renderErrors(FormView $view) protected function renderErrors(FormView $view)
{ {
return (string)$this->extension->renderErrors($view); return (string) $this->extension->renderErrors($view);
} }
protected function renderWidget(FormView $view, array $vars = array()) protected function renderWidget(FormView $view, array $vars = array())
{ {
return (string)$this->extension->renderWidget($view, $vars); return (string) $this->extension->renderWidget($view, $vars);
} }
protected function renderRow(FormView $view, array $vars = array()) protected function renderRow(FormView $view, array $vars = array())
{ {
return (string)$this->extension->renderRow($view, $vars); return (string) $this->extension->renderRow($view, $vars);
} }
protected function renderRest(FormView $view, array $vars = array()) protected function renderRest(FormView $view, array $vars = array())
{ {
return (string)$this->extension->renderRest($view, $vars); return (string) $this->extension->renderRest($view, $vars);
} }
protected function setTheme(FormView $view, array $themes) protected function setTheme(FormView $view, array $themes)
@ -131,14 +131,14 @@ class FormExtensionDivLayoutTest extends AbstractDivLayoutTest
$this->extension->setTheme($view, $themes); $this->extension->setTheme($view, $themes);
} }
static public function themeBlockInheritanceProvider() public static function themeBlockInheritanceProvider()
{ {
return array( return array(
array(array('theme.html.twig')) array(array('theme.html.twig'))
); );
} }
static public function themeInheritanceProvider() public static function themeInheritanceProvider()
{ {
return array( return array(
array(array('parent_label.html.twig'), array('child_label.html.twig')) array(array('parent_label.html.twig'), array('child_label.html.twig'))

View File

@ -68,32 +68,32 @@ class FormExtensionTableLayoutTest extends AbstractTableLayoutTest
protected function renderEnctype(FormView $view) protected function renderEnctype(FormView $view)
{ {
return (string)$this->extension->renderEnctype($view); return (string) $this->extension->renderEnctype($view);
} }
protected function renderLabel(FormView $view, $label = null, array $vars = array()) protected function renderLabel(FormView $view, $label = null, array $vars = array())
{ {
return (string)$this->extension->renderLabel($view, $label, $vars); return (string) $this->extension->renderLabel($view, $label, $vars);
} }
protected function renderErrors(FormView $view) protected function renderErrors(FormView $view)
{ {
return (string)$this->extension->renderErrors($view); return (string) $this->extension->renderErrors($view);
} }
protected function renderWidget(FormView $view, array $vars = array()) protected function renderWidget(FormView $view, array $vars = array())
{ {
return (string)$this->extension->renderWidget($view, $vars); return (string) $this->extension->renderWidget($view, $vars);
} }
protected function renderRow(FormView $view, array $vars = array()) protected function renderRow(FormView $view, array $vars = array())
{ {
return (string)$this->extension->renderRow($view, $vars); return (string) $this->extension->renderRow($view, $vars);
} }
protected function renderRest(FormView $view, array $vars = array()) protected function renderRest(FormView $view, array $vars = array())
{ {
return (string)$this->extension->renderRest($view, $vars); return (string) $this->extension->renderRest($view, $vars);
} }
protected function setTheme(FormView $view, array $themes) protected function setTheme(FormView $view, array $themes)

View File

@ -11,7 +11,6 @@
namespace Symfony\Bundle\FrameworkBundle\CacheWarmer; namespace Symfony\Bundle\FrameworkBundle\CacheWarmer;
/** /**
* Interface for finding all the templates. * Interface for finding all the templates.
* *
@ -24,5 +23,5 @@ interface TemplateFinderInterface
* *
* @return array An array of templates of type TemplateReferenceInterface * @return array An array of templates of type TemplateReferenceInterface
*/ */
function findAllTemplates(); public function findAllTemplates();
} }

View File

@ -24,7 +24,7 @@ class CompilerDebugDumpPass implements CompilerPassInterface
$cache->write(implode("\n", $container->getCompiler()->getLog())); $cache->write(implode("\n", $container->getCompiler()->getLog()));
} }
static public function getCompilerLogFilename(ContainerInterface $container) public static function getCompilerLogFilename(ContainerInterface $container)
{ {
$class = $container->getParameter('kernel.container_class'); $class = $container->getParameter('kernel.container_class');

View File

@ -11,7 +11,6 @@
namespace Symfony\Bundle\FrameworkBundle\DependencyInjection; namespace Symfony\Bundle\FrameworkBundle\DependencyInjection;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\DefinitionDecorator; use Symfony\Component\DependencyInjection\DefinitionDecorator;
use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\DependencyInjection\Reference;

View File

@ -52,7 +52,7 @@ class SessionListener implements EventSubscriberInterface
$request->setSession($this->container->get('session')); $request->setSession($this->container->get('session'));
} }
static public function getSubscribedEvents() public static function getSubscribedEvents()
{ {
return array( return array(
KernelEvents::REQUEST => array('onKernelRequest', 128), KernelEvents::REQUEST => array('onKernelRequest', 128),

View File

@ -49,7 +49,7 @@ class TestSessionListener implements EventSubscriberInterface
$session = $this->container->get('session'); $session = $this->container->get('session');
$cookies = $event->getRequest()->cookies; $cookies = $event->getRequest()->cookies;
if ($cookies->has($session->getName())) { if ($cookies->has($session->getName())) {
$session->setId($cookies->get($session->getName())); $session->setId($cookies->get($session->getName()));
} else { } else {
@ -78,7 +78,7 @@ class TestSessionListener implements EventSubscriberInterface
} }
} }
static public function getSubscribedEvents() public static function getSubscribedEvents()
{ {
return array( return array(
KernelEvents::REQUEST => array('onKernelRequest', 192), KernelEvents::REQUEST => array('onKernelRequest', 192),

View File

@ -48,4 +48,4 @@
</td> </td>
</tr> </tr>
<?php endif; ?> <?php endif; ?>
<?php endif; ?> <?php endif;

View File

@ -3,4 +3,3 @@
<?php echo $view['form']->widget($form) ?> <?php echo $view['form']->widget($form) ?>
</td> </td>
</tr> </tr>

View File

@ -30,5 +30,5 @@ interface EngineInterface extends BaseEngineInterface
* *
* @return Response A Response instance * @return Response A Response instance
*/ */
function renderResponse($view, array $parameters = array(), Response $response = null); public function renderResponse($view, array $parameters = array(), Response $response = null);
} }

View File

@ -201,7 +201,7 @@ class CodeHelper extends Helper
return 'code'; return 'code';
} }
static protected function fixCodeMarkup($line) protected static function fixCodeMarkup($line)
{ {
// </span> ending tag from previous line // </span> ending tag from previous line
$opening = strpos($line, '<span'); $opening = strpos($line, '<span');

View File

@ -22,8 +22,8 @@ use Symfony\Component\HttpKernel\HttpKernelInterface;
*/ */
abstract class WebTestCase extends \PHPUnit_Framework_TestCase abstract class WebTestCase extends \PHPUnit_Framework_TestCase
{ {
static protected $class; protected static $class;
static protected $kernel; protected static $kernel;
/** /**
* Creates a Client. * Creates a Client.
@ -33,7 +33,7 @@ abstract class WebTestCase extends \PHPUnit_Framework_TestCase
* *
* @return Client A Client instance * @return Client A Client instance
*/ */
static protected function createClient(array $options = array(), array $server = array()) protected static function createClient(array $options = array(), array $server = array())
{ {
if (null !== static::$kernel) { if (null !== static::$kernel) {
static::$kernel->shutdown(); static::$kernel->shutdown();
@ -56,7 +56,7 @@ abstract class WebTestCase extends \PHPUnit_Framework_TestCase
* *
* @return string The directory where phpunit.xml(.dist) is stored * @return string The directory where phpunit.xml(.dist) is stored
*/ */
static protected function getPhpUnitXmlDir() protected static function getPhpUnitXmlDir()
{ {
if (!isset($_SERVER['argv']) || false === strpos($_SERVER['argv'][0], 'phpunit')) { if (!isset($_SERVER['argv']) || false === strpos($_SERVER['argv'][0], 'phpunit')) {
throw new \RuntimeException('You must override the WebTestCase::createKernel() method.'); throw new \RuntimeException('You must override the WebTestCase::createKernel() method.');
@ -89,7 +89,7 @@ abstract class WebTestCase extends \PHPUnit_Framework_TestCase
* *
* @return string The value of the phpunit cli configuration option * @return string The value of the phpunit cli configuration option
*/ */
static private function getPhpUnitCliConfigArgument() private static function getPhpUnitCliConfigArgument()
{ {
$dir = null; $dir = null;
$reversedArgs = array_reverse($_SERVER['argv']); $reversedArgs = array_reverse($_SERVER['argv']);
@ -114,7 +114,7 @@ abstract class WebTestCase extends \PHPUnit_Framework_TestCase
* *
* @return string The Kernel class name * @return string The Kernel class name
*/ */
static protected function getKernelClass() protected static function getKernelClass()
{ {
$dir = isset($_SERVER['KERNEL_DIR']) ? $_SERVER['KERNEL_DIR'] : static::getPhpUnitXmlDir(); $dir = isset($_SERVER['KERNEL_DIR']) ? $_SERVER['KERNEL_DIR'] : static::getPhpUnitXmlDir();
@ -145,7 +145,7 @@ abstract class WebTestCase extends \PHPUnit_Framework_TestCase
* *
* @return HttpKernelInterface A HttpKernelInterface instance * @return HttpKernelInterface A HttpKernelInterface instance
*/ */
static protected function createKernel(array $options = array()) protected static function createKernel(array $options = array())
{ {
if (null === static::$class) { if (null === static::$class) {
static::$class = static::getKernelClass(); static::$class = static::getKernelClass();

View File

@ -16,7 +16,6 @@ use Symfony\Bundle\FrameworkBundle\Templating\TemplateFilenameParser;
use Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplateFinder; use Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplateFinder;
use Symfony\Bundle\FrameworkBundle\Tests\Fixtures\BaseBundle\BaseBundle; use Symfony\Bundle\FrameworkBundle\Tests\Fixtures\BaseBundle\BaseBundle;
class TemplateFinderTest extends TestCase class TemplateFinderTest extends TestCase
{ {
public function testFindAllTemplates() public function testFindAllTemplates()

View File

@ -68,7 +68,6 @@ class RedirectControllerTest extends TestCase
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
$container $container
->expects($this->at(0)) ->expects($this->at(0))
->method('get') ->method('get')

View File

@ -85,5 +85,5 @@ class RegisterKernelListenersPassTest extends \PHPUnit_Framework_TestCase
class SubscriberService implements \Symfony\Component\EventDispatcher\EventSubscriberInterface class SubscriberService implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
{ {
static function getSubscribedEvents() {} public static function getSubscribedEvents() {}
} }

View File

@ -18,4 +18,3 @@ $container->loadFromExtension('framework', array(
'cookie_httponly' => true, 'cookie_httponly' => true,
), ),
)); ));

View File

@ -15,4 +15,3 @@ $container->loadFromExtension('framework', array(
'cookie_httponly' => true, 'cookie_httponly' => true,
), ),
)); ));

View File

@ -17,4 +17,3 @@ session_setflash:
session_showflash: session_showflash:
pattern: /session_showflash pattern: /session_showflash
defaults: { _controller: TestBundle:Session:showFlash} defaults: { _controller: TestBundle:Session:showFlash}

View File

@ -17,7 +17,7 @@ use Symfony\Component\HttpKernel\Kernel;
class WebTestCase extends BaseWebTestCase class WebTestCase extends BaseWebTestCase
{ {
static public function assertRedirect($response, $location) public static function assertRedirect($response, $location)
{ {
self::assertTrue($response->isRedirect(), 'Response is not a redirect, got status code: '.$response->getStatusCode()); self::assertTrue($response->isRedirect(), 'Response is not a redirect, got status code: '.$response->getStatusCode());
self::assertEquals('http://localhost'.$location, $response->headers->get('Location')); self::assertEquals('http://localhost'.$location, $response->headers->get('Location'));
@ -42,14 +42,14 @@ class WebTestCase extends BaseWebTestCase
$fs->remove($dir); $fs->remove($dir);
} }
static protected function getKernelClass() protected static function getKernelClass()
{ {
require_once __DIR__.'/app/AppKernel.php'; require_once __DIR__.'/app/AppKernel.php';
return 'Symfony\Bundle\FrameworkBundle\Tests\Functional\AppKernel'; return 'Symfony\Bundle\FrameworkBundle\Tests\Functional\AppKernel';
} }
static protected function createKernel(array $options = array()) protected static function createKernel(array $options = array())
{ {
$class = self::getKernelClass(); $class = self::getKernelClass();

View File

@ -1,3 +1,2 @@
imports: imports:
- { resource: ./../config/default.yml } - { resource: ./../config/default.yml }

View File

@ -48,7 +48,7 @@ class HttpKernelTest extends \PHPUnit_Framework_TestCase
$resolver = $this->getMock('Symfony\\Component\\HttpKernel\\Controller\\ControllerResolverInterface'); $resolver = $this->getMock('Symfony\\Component\\HttpKernel\\Controller\\ControllerResolverInterface');
$kernel = new HttpKernel($dispatcher, $container, $resolver); $kernel = new HttpKernel($dispatcher, $container, $resolver);
$controller = function() use($expected) { $controller = function() use ($expected) {
return $expected; return $expected;
}; };

View File

@ -17,7 +17,7 @@ class CodeHelperTest extends \PHPUnit_Framework_TestCase
{ {
protected static $helper; protected static $helper;
static public function setUpBeforeClass() public static function setUpBeforeClass()
{ {
self::$helper = new CodeHelper('txmt://open?url=file://%f&line=%l', '/root', 'UTF-8'); self::$helper = new CodeHelper('txmt://open?url=file://%f&line=%l', '/root', 'UTF-8');
} }

View File

@ -82,14 +82,14 @@ class FormHelperDivLayoutTest extends AbstractDivLayoutTest
$this->helper->setTheme($view, $themes); $this->helper->setTheme($view, $themes);
} }
static public function themeBlockInheritanceProvider() public static function themeBlockInheritanceProvider()
{ {
return array( return array(
array(array('TestBundle:Parent')) array(array('TestBundle:Parent'))
); );
} }
static public function themeInheritanceProvider() public static function themeInheritanceProvider()
{ {
return array( return array(
array(array('TestBundle:Parent'), array('TestBundle:Child')) array(array('TestBundle:Parent'), array('TestBundle:Child'))

View File

@ -277,7 +277,7 @@ class MainConfiguration implements ConfigurationInterface
->ifTrue(function($v) { ->ifTrue(function($v) {
return true === $v['security'] && isset($v['pattern']) && !isset($v['request_matcher']); return true === $v['security'] && isset($v['pattern']) && !isset($v['request_matcher']);
}) })
->then(function($firewall) use($abstractFactoryKeys) { ->then(function($firewall) use ($abstractFactoryKeys) {
foreach ($abstractFactoryKeys as $k) { foreach ($abstractFactoryKeys as $k) {
if (!isset($firewall[$k]['check_path'])) { if (!isset($firewall[$k]['check_path'])) {
continue; continue;

View File

@ -80,7 +80,7 @@ abstract class AbstractFactory implements SecurityFactoryInterface
} }
} }
public final function addOption($name, $default = null) final public function addOption($name, $default = null)
{ {
$this->options[$name] = $default; $this->options[$name] = $default;
} }

View File

@ -21,11 +21,11 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
*/ */
interface SecurityFactoryInterface interface SecurityFactoryInterface
{ {
function create(ContainerBuilder $container, $id, $config, $userProvider, $defaultEntryPoint); public function create(ContainerBuilder $container, $id, $config, $userProvider, $defaultEntryPoint);
function getPosition(); public function getPosition();
function getKey(); public function getKey();
function addConfiguration(NodeDefinition $builder); public function addConfiguration(NodeDefinition $builder);
} }

View File

@ -22,9 +22,9 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
*/ */
interface UserProviderFactoryInterface interface UserProviderFactoryInterface
{ {
function create(ContainerBuilder $container, $id, $config); public function create(ContainerBuilder $container, $id, $config);
function getKey(); public function getKey();
function addConfiguration(NodeDefinition $builder); public function addConfiguration(NodeDefinition $builder);
} }

View File

@ -625,4 +625,3 @@ class SecurityExtension extends Extension
return new MainConfiguration($this->factories, $this->userProviderFactories); return new MainConfiguration($this->factories, $this->userProviderFactories);
} }
} }

View File

@ -17,7 +17,7 @@ use Symfony\Component\HttpKernel\Kernel;
class WebTestCase extends BaseWebTestCase class WebTestCase extends BaseWebTestCase
{ {
static public function assertRedirect($response, $location) public static function assertRedirect($response, $location)
{ {
self::assertTrue($response->isRedirect(), 'Response is not a redirect, got status code: '.substr($response, 0, 2000)); self::assertTrue($response->isRedirect(), 'Response is not a redirect, got status code: '.substr($response, 0, 2000));
self::assertEquals('http://localhost'.$location, $response->headers->get('Location')); self::assertEquals('http://localhost'.$location, $response->headers->get('Location'));
@ -42,14 +42,14 @@ class WebTestCase extends BaseWebTestCase
$fs->remove($dir); $fs->remove($dir);
} }
static protected function getKernelClass() protected static function getKernelClass()
{ {
require_once __DIR__.'/app/AppKernel.php'; require_once __DIR__.'/app/AppKernel.php';
return 'Symfony\Bundle\SecurityBundle\Tests\Functional\AppKernel'; return 'Symfony\Bundle\SecurityBundle\Tests\Functional\AppKernel';
} }
static protected function createKernel(array $options = array()) protected static function createKernel(array $options = array())
{ {
$class = self::getKernelClass(); $class = self::getKernelClass();

View File

@ -55,7 +55,7 @@
.sf-toolbar-block .sf-toolbar-info-piece:last-child { .sf-toolbar-block .sf-toolbar-info-piece:last-child {
padding-bottom: 0; padding-bottom: 0;
} }
.sf-toolbar-block .sf-toolbar-info-piece a, .sf-toolbar-block .sf-toolbar-info-piece a,
.sf-toolbar-block .sf-toolbar-info-piece abbr { .sf-toolbar-block .sf-toolbar-info-piece abbr {
color: #2f2f2f; color: #2f2f2f;

View File

@ -28,7 +28,7 @@ class WebProfilerExtensionTest extends TestCase
*/ */
private $container; private $container;
static public function assertSaneContainer(Container $container, $message = '') public static function assertSaneContainer(Container $container, $message = '')
{ {
$errors = array(); $errors = array();
foreach ($container->getServiceIds() as $id) { foreach ($container->getServiceIds() as $id) {

View File

@ -117,7 +117,7 @@ class Cookie
* *
* @api * @api
*/ */
static public function fromString($cookie, $url = null) public static function fromString($cookie, $url = null)
{ {
$parts = explode(';', $cookie); $parts = explode(';', $cookie);

View File

@ -18,8 +18,8 @@ namespace Symfony\Component\ClassLoader;
*/ */
class ClassCollectionLoader class ClassCollectionLoader
{ {
static private $loaded; private static $loaded;
static private $seen; private static $seen;
/** /**
* Loads a list of classes and caches them in one big file. * Loads a list of classes and caches them in one big file.
@ -33,7 +33,7 @@ class ClassCollectionLoader
* *
* @throws \InvalidArgumentException When class can't be loaded * @throws \InvalidArgumentException When class can't be loaded
*/ */
static public function load($classes, $cacheDir, $name, $autoReload, $adaptive = false, $extension = '.php') public static function load($classes, $cacheDir, $name, $autoReload, $adaptive = false, $extension = '.php')
{ {
// each $name can only be loaded once per PHP process // each $name can only be loaded once per PHP process
if (isset(self::$loaded[$name])) { if (isset(self::$loaded[$name])) {
@ -133,7 +133,7 @@ class ClassCollectionLoader
* *
* @return string Namespaces with brackets * @return string Namespaces with brackets
*/ */
static public function fixNamespaceDeclarations($source) public static function fixNamespaceDeclarations($source)
{ {
if (!function_exists('token_get_all')) { if (!function_exists('token_get_all')) {
return $source; return $source;
@ -188,7 +188,7 @@ class ClassCollectionLoader
* *
* @throws \RuntimeException when a cache file cannot be written * @throws \RuntimeException when a cache file cannot be written
*/ */
static private function writeCacheFile($file, $content) private static function writeCacheFile($file, $content)
{ {
$tmpFile = tempnam(dirname($file), basename($file)); $tmpFile = tempnam(dirname($file), basename($file));
if (false !== @file_put_contents($tmpFile, $content) && @rename($tmpFile, $file)) { if (false !== @file_put_contents($tmpFile, $content) && @rename($tmpFile, $file)) {
@ -210,7 +210,7 @@ class ClassCollectionLoader
* *
* @return string The PHP string with the comments removed * @return string The PHP string with the comments removed
*/ */
static private function stripComments($source) private static function stripComments($source)
{ {
if (!function_exists('token_get_all')) { if (!function_exists('token_get_all')) {
return $source; return $source;
@ -240,7 +240,7 @@ class ClassCollectionLoader
* *
* @throws \InvalidArgumentException When a class can't be loaded * @throws \InvalidArgumentException When a class can't be loaded
*/ */
static private function getOrderedClasses(array $classes) private static function getOrderedClasses(array $classes)
{ {
$map = array(); $map = array();
self::$seen = array(); self::$seen = array();
@ -257,7 +257,7 @@ class ClassCollectionLoader
return $map; return $map;
} }
static private function getClassHierarchy(\ReflectionClass $class) private static function getClassHierarchy(\ReflectionClass $class)
{ {
if (isset(self::$seen[$class->getName()])) { if (isset(self::$seen[$class->getName()])) {
return array(); return array();
@ -294,7 +294,7 @@ class ClassCollectionLoader
return $classes; return $classes;
} }
static private function getTraits(\ReflectionClass $class) private static function getTraits(\ReflectionClass $class)
{ {
$traits = $class->getTraits(); $traits = $class->getTraits();
$classes = array(); $classes = array();

View File

@ -24,7 +24,7 @@ class ClassMapGenerator
* @param array|string $dirs Directories or a single path to search in * @param array|string $dirs Directories or a single path to search in
* @param string $file The name of the class map file * @param string $file The name of the class map file
*/ */
static public function dump($dirs, $file) public static function dump($dirs, $file)
{ {
$dirs = (array) $dirs; $dirs = (array) $dirs;
$maps = array(); $maps = array();
@ -43,7 +43,7 @@ class ClassMapGenerator
* *
* @return array A class map array * @return array A class map array
*/ */
static public function createMap($dir) public static function createMap($dir)
{ {
if (is_string($dir)) { if (is_string($dir)) {
$dir = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($dir)); $dir = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($dir));
@ -80,7 +80,7 @@ class ClassMapGenerator
* *
* @return array The found classes * @return array The found classes
*/ */
static private function findClasses($path) private static function findClasses($path)
{ {
$contents = file_get_contents($path); $contents = file_get_contents($path);
$tokens = token_get_all($contents); $tokens = token_get_all($contents);

View File

@ -42,7 +42,7 @@ class DebugClassLoader
/** /**
* Replaces all autoloaders implementing a findFile method by a DebugClassLoader wrapper. * Replaces all autoloaders implementing a findFile method by a DebugClassLoader wrapper.
*/ */
static public function enable() public static function enable()
{ {
if (!is_array($functions = spl_autoload_functions())) { if (!is_array($functions = spl_autoload_functions())) {
return; return;

View File

@ -21,7 +21,7 @@ class DebugUniversalClassLoader extends UniversalClassLoader
/** /**
* Replaces all regular UniversalClassLoader instances by a DebugUniversalClassLoader ones. * Replaces all regular UniversalClassLoader instances by a DebugUniversalClassLoader ones.
*/ */
static public function enable() public static function enable()
{ {
if (!is_array($functions = spl_autoload_functions())) { if (!is_array($functions = spl_autoload_functions())) {
return; return;

View File

@ -1,7 +1,7 @@
<?php <?php
namespace { namespace {
trait TFoo { trait TFoo
{
} }
class CFoo class CFoo
@ -11,16 +11,16 @@ namespace {
} }
namespace Foo { namespace Foo {
trait TBar { trait TBar
{
} }
interface IBar { interface IBar
{
} }
trait TFooBar { trait TFooBar
{
} }
class CBar implements IBar class CBar implements IBar

View File

@ -11,7 +11,6 @@
namespace Symfony\Component\Config\Definition; namespace Symfony\Component\Config\Definition;
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException; use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
use Symfony\Component\Config\Definition\Exception\InvalidTypeException; use Symfony\Component\Config\Definition\Exception\InvalidTypeException;
use Symfony\Component\Config\Definition\Exception\UnsetKeyException; use Symfony\Component\Config\Definition\Exception\UnsetKeyException;

View File

@ -221,7 +221,7 @@ abstract class BaseNode implements NodeInterface
* *
* @throws ForbiddenOverwriteException * @throws ForbiddenOverwriteException
*/ */
public final function merge($leftSide, $rightSide) final public function merge($leftSide, $rightSide)
{ {
if (!$this->allowOverwrite) { if (!$this->allowOverwrite) {
throw new ForbiddenOverwriteException(sprintf( throw new ForbiddenOverwriteException(sprintf(
@ -245,7 +245,7 @@ abstract class BaseNode implements NodeInterface
* *
* @return mixed The normalized value. * @return mixed The normalized value.
*/ */
public final function normalize($value) final public function normalize($value)
{ {
// run custom normalization closures // run custom normalization closures
foreach ($this->normalizationClosures as $closure) { foreach ($this->normalizationClosures as $closure) {
@ -273,7 +273,7 @@ abstract class BaseNode implements NodeInterface
* *
* @return mixed The finalized value * @return mixed The finalized value
*/ */
public final function finalize($value) final public function finalize($value)
{ {
$this->validateType($value); $this->validateType($value);

View File

@ -12,30 +12,30 @@ use Symfony\Component\Config\Definition\Builder\ScalarNodeDefinition;
*/ */
class EnumNodeDefinition extends ScalarNodeDefinition class EnumNodeDefinition extends ScalarNodeDefinition
{ {
private $values; private $values;
public function values(array $values)
{
$values = array_unique($values);
if (count($values) <= 1) {
throw new \InvalidArgumentException('->values() must be called with at least two distinct values.');
}
$this->values = $values;
}
/** public function values(array $values)
* Instantiate a Node {
* $values = array_unique($values);
* @return EnumNode The node
*/ if (count($values) <= 1) {
protected function instantiateNode() throw new \InvalidArgumentException('->values() must be called with at least two distinct values.');
}
$this->values = $values;
}
/**
* Instantiate a Node
*
* @return EnumNode The node
*/
protected function instantiateNode()
{ {
if (null === $this->values) { if (null === $this->values) {
throw new \RuntimeException('You must call ->values() on enum nodes.'); throw new \RuntimeException('You must call ->values() on enum nodes.');
} }
return new EnumNode($this->name, $this->parent, $this->values); return new EnumNode($this->name, $this->parent, $this->values);
} }
} }

View File

@ -214,11 +214,11 @@ class ExprBuilder
* *
* @return array * @return array
*/ */
static public function buildExpressions(array $expressions) public static function buildExpressions(array $expressions)
{ {
foreach ($expressions as $k => $expr) { foreach ($expressions as $k => $expr) {
if ($expr instanceof ExprBuilder) { if ($expr instanceof ExprBuilder) {
$expressions[$k] = function($v) use($expr) { $expressions[$k] = function($v) use ($expr) {
return call_user_func($expr->ifPart, $v) ? call_user_func($expr->thenPart, $v) : $v; return call_user_func($expr->ifPart, $v) ? call_user_func($expr->thenPart, $v) : $v;
}; };
} }

View File

@ -18,9 +18,9 @@ namespace Symfony\Component\Config\Definition\Builder;
*/ */
interface ParentNodeDefinitionInterface interface ParentNodeDefinitionInterface
{ {
function children(); public function children();
function append(NodeDefinition $node); public function append(NodeDefinition $node);
function setBuilder(NodeBuilder $builder); public function setBuilder(NodeBuilder $builder);
} }

View File

@ -23,5 +23,5 @@ interface ConfigurationInterface
* *
* @return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder * @return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder
*/ */
function getConfigTreeBuilder(); public function getConfigTreeBuilder();
} }

View File

@ -47,4 +47,4 @@ class EnumNode extends ScalarNode
return $value; return $value;
} }
} }

View File

@ -26,28 +26,28 @@ interface NodeInterface
* *
* @return string The name of the node * @return string The name of the node
*/ */
function getName(); public function getName();
/** /**
* Returns the path of the node. * Returns the path of the node.
* *
* @return string The node path * @return string The node path
*/ */
function getPath(); public function getPath();
/** /**
* Returns true when the node is required. * Returns true when the node is required.
* *
* @return Boolean If the node is required * @return Boolean If the node is required
*/ */
function isRequired(); public function isRequired();
/** /**
* Returns true when the node has a default value. * Returns true when the node has a default value.
* *
* @return Boolean If the node has a default value * @return Boolean If the node has a default value
*/ */
function hasDefaultValue(); public function hasDefaultValue();
/** /**
* Returns the default value of the node. * Returns the default value of the node.
@ -55,7 +55,7 @@ interface NodeInterface
* @return mixed The default value * @return mixed The default value
* @throws \RuntimeException if the node has no default value * @throws \RuntimeException if the node has no default value
*/ */
function getDefaultValue(); public function getDefaultValue();
/** /**
* Normalizes the supplied value. * Normalizes the supplied value.
@ -64,7 +64,7 @@ interface NodeInterface
* *
* @return mixed The normalized value * @return mixed The normalized value
*/ */
function normalize($value); public function normalize($value);
/** /**
* Merges two values together. * Merges two values together.
@ -74,7 +74,7 @@ interface NodeInterface
* *
* @return mixed The merged values * @return mixed The merged values
*/ */
function merge($leftSide, $rightSide); public function merge($leftSide, $rightSide);
/** /**
* Finalizes a value. * Finalizes a value.
@ -83,5 +83,5 @@ interface NodeInterface
* *
* @return mixed The finalized value * @return mixed The finalized value
*/ */
function finalize($value); public function finalize($value);
} }

View File

@ -65,7 +65,7 @@ class Processor
* *
* @return array the config with normalized keys * @return array the config with normalized keys
*/ */
static public function normalizeKeys(array $config) public static function normalizeKeys(array $config)
{ {
foreach ($config as $key => $value) { foreach ($config as $key => $value) {
if (is_array($value)) { if (is_array($value)) {
@ -104,7 +104,7 @@ class Processor
* *
* @return array * @return array
*/ */
static public function normalizeConfig($config, $key, $plural = null) public static function normalizeConfig($config, $key, $plural = null)
{ {
if (null === $plural) { if (null === $plural) {
$plural = $key.'s'; $plural = $key.'s';

View File

@ -23,5 +23,5 @@ interface PrototypeNodeInterface extends NodeInterface
* *
* @param string $name The name of the node * @param string $name The name of the node
*/ */
function setName($name); public function setName($name);
} }

View File

@ -27,5 +27,5 @@ interface FileLocatorInterface
* *
* @throws \InvalidArgumentException When file is not found * @throws \InvalidArgumentException When file is not found
*/ */
function locate($name, $currentPath = null, $first = true); public function locate($name, $currentPath = null, $first = true);
} }

View File

@ -22,7 +22,7 @@ use Symfony\Component\Config\Exception\FileLoaderImportCircularReferenceExceptio
*/ */
abstract class FileLoader extends Loader abstract class FileLoader extends Loader
{ {
static protected $loading = array(); protected static $loading = array();
protected $locator; protected $locator;

View File

@ -24,7 +24,7 @@ interface LoaderInterface
* @param mixed $resource The resource * @param mixed $resource The resource
* @param string $type The resource type * @param string $type The resource type
*/ */
function load($resource, $type = null); public function load($resource, $type = null);
/** /**
* Returns true if this class supports the given resource. * Returns true if this class supports the given resource.
@ -34,20 +34,20 @@ interface LoaderInterface
* *
* @return Boolean true if this class supports the given resource, false otherwise * @return Boolean true if this class supports the given resource, false otherwise
*/ */
function supports($resource, $type = null); public function supports($resource, $type = null);
/** /**
* Gets the loader resolver. * Gets the loader resolver.
* *
* @return LoaderResolverInterface A LoaderResolverInterface instance * @return LoaderResolverInterface A LoaderResolverInterface instance
*/ */
function getResolver(); public function getResolver();
/** /**
* Sets the loader resolver. * Sets the loader resolver.
* *
* @param LoaderResolverInterface $resolver A LoaderResolverInterface instance * @param LoaderResolverInterface $resolver A LoaderResolverInterface instance
*/ */
function setResolver(LoaderResolverInterface $resolver); public function setResolver(LoaderResolverInterface $resolver);
} }

View File

@ -26,5 +26,5 @@ interface LoaderResolverInterface
* *
* @return LoaderInterface A LoaderInterface instance * @return LoaderInterface A LoaderInterface instance
*/ */
function resolve($resource, $type = null); public function resolve($resource, $type = null);
} }

View File

@ -23,7 +23,7 @@ interface ResourceInterface
* *
* @return string A string representation of the Resource * @return string A string representation of the Resource
*/ */
function __toString(); public function __toString();
/** /**
* Returns true if the resource has not been updated since the given timestamp. * Returns true if the resource has not been updated since the given timestamp.
@ -32,12 +32,12 @@ interface ResourceInterface
* *
* @return Boolean true if the resource has not been updated, false otherwise * @return Boolean true if the resource has not been updated, false otherwise
*/ */
function isFresh($timestamp); public function isFresh($timestamp);
/** /**
* Returns the resource tied to this Resource. * Returns the resource tied to this Resource.
* *
* @return mixed The resource * @return mixed The resource
*/ */
function getResource(); public function getResource();
} }

View File

@ -58,4 +58,3 @@ class BooleanNodeTest extends \PHPUnit_Framework_TestCase
); );
} }
} }

View File

@ -34,4 +34,4 @@ class EnumNodeDefinitionTest extends \PHPUnit_Framework_TestCase
$node = $def->getNode(); $node = $def->getNode();
$this->assertEquals(array('foo', 'bar'), $node->getValues()); $this->assertEquals(array('foo', 'bar'), $node->getValues());
} }
} }

View File

@ -13,7 +13,6 @@ namespace Symfony\Component\Config\Tests\Definition\Builder;
use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\Builder\TreeBuilder;
class ExprBuilderTest extends \PHPUnit_Framework_TestCase class ExprBuilderTest extends \PHPUnit_Framework_TestCase
{ {
@ -160,6 +159,7 @@ class ExprBuilderTest extends \PHPUnit_Framework_TestCase
protected function getTestBuilder() protected function getTestBuilder()
{ {
$builder = new TreeBuilder(); $builder = new TreeBuilder();
return $builder return $builder
->root('test') ->root('test')
->children() ->children()
@ -191,7 +191,8 @@ class ExprBuilderTest extends \PHPUnit_Framework_TestCase
* @param $val The value that the closure must return * @param $val The value that the closure must return
* @return Closure * @return Closure
*/ */
protected function returnClosure($val) { protected function returnClosure($val)
{
return function($v) use ($val) { return function($v) use ($val) {
return $val; return $val;
}; };

View File

@ -38,4 +38,4 @@ class EnumNodeTest extends \PHPUnit_Framework_TestCase
$node = new EnumNode('foo', null, array('foo', 'bar')); $node = new EnumNode('foo', null, array('foo', 'bar'));
$node->finalize('foobar'); $node->finalize('foobar');
} }
} }

View File

@ -619,7 +619,7 @@ class Application
* *
* @return array An array of abbreviations * @return array An array of abbreviations
*/ */
static public function getAbbreviations($names) public static function getAbbreviations($names)
{ {
$abbrevs = array(); $abbrevs = array();
foreach ($names as $name) { foreach ($names as $name) {

View File

@ -27,7 +27,7 @@ interface OutputFormatterInterface
* *
* @api * @api
*/ */
function setDecorated($decorated); public function setDecorated($decorated);
/** /**
* Gets the decorated flag. * Gets the decorated flag.
@ -36,7 +36,7 @@ interface OutputFormatterInterface
* *
* @api * @api
*/ */
function isDecorated(); public function isDecorated();
/** /**
* Sets a new style. * Sets a new style.
@ -46,7 +46,7 @@ interface OutputFormatterInterface
* *
* @api * @api
*/ */
function setStyle($name, OutputFormatterStyleInterface $style); public function setStyle($name, OutputFormatterStyleInterface $style);
/** /**
* Checks if output formatter has style with specified name. * Checks if output formatter has style with specified name.
@ -57,7 +57,7 @@ interface OutputFormatterInterface
* *
* @api * @api
*/ */
function hasStyle($name); public function hasStyle($name);
/** /**
* Gets style options from style with specified name. * Gets style options from style with specified name.
@ -68,7 +68,7 @@ interface OutputFormatterInterface
* *
* @api * @api
*/ */
function getStyle($name); public function getStyle($name);
/** /**
* Formats a message according to the given styles. * Formats a message according to the given styles.
@ -79,5 +79,5 @@ interface OutputFormatterInterface
* *
* @api * @api
*/ */
function format($message); public function format($message);
} }

View File

@ -20,7 +20,7 @@ namespace Symfony\Component\Console\Formatter;
*/ */
class OutputFormatterStyle implements OutputFormatterStyleInterface class OutputFormatterStyle implements OutputFormatterStyleInterface
{ {
static private $availableForegroundColors = array( private static $availableForegroundColors = array(
'black' => 30, 'black' => 30,
'red' => 31, 'red' => 31,
'green' => 32, 'green' => 32,
@ -30,7 +30,7 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
'cyan' => 36, 'cyan' => 36,
'white' => 37 'white' => 37
); );
static private $availableBackgroundColors = array( private static $availableBackgroundColors = array(
'black' => 40, 'black' => 40,
'red' => 41, 'red' => 41,
'green' => 42, 'green' => 42,
@ -40,7 +40,7 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
'cyan' => 46, 'cyan' => 46,
'white' => 47 'white' => 47
); );
static private $availableOptions = array( private static $availableOptions = array(
'bold' => 1, 'bold' => 1,
'underscore' => 4, 'underscore' => 4,
'blink' => 5, 'blink' => 5,

View File

@ -27,7 +27,7 @@ interface OutputFormatterStyleInterface
* *
* @api * @api
*/ */
function setForeground($color = null); public function setForeground($color = null);
/** /**
* Sets style background color. * Sets style background color.
@ -36,7 +36,7 @@ interface OutputFormatterStyleInterface
* *
* @api * @api
*/ */
function setBackground($color = null); public function setBackground($color = null);
/** /**
* Sets some specific style option. * Sets some specific style option.
@ -45,21 +45,21 @@ interface OutputFormatterStyleInterface
* *
* @api * @api
*/ */
function setOption($option); public function setOption($option);
/** /**
* Unsets some specific style option. * Unsets some specific style option.
* *
* @param string $option Theoption name * @param string $option Theoption name
*/ */
function unsetOption($option); public function unsetOption($option);
/** /**
* Sets multiple style options at once. * Sets multiple style options at once.
* *
* @param array $options * @param array $options
*/ */
function setOptions(array $options); public function setOptions(array $options);
/** /**
* Applies the style to a given text. * Applies the style to a given text.
@ -68,5 +68,5 @@ interface OutputFormatterStyleInterface
* *
* @return string * @return string
*/ */
function apply($text); public function apply($text);
} }

View File

@ -27,7 +27,7 @@ interface HelperInterface
* *
* @api * @api
*/ */
function setHelperSet(HelperSet $helperSet = null); public function setHelperSet(HelperSet $helperSet = null);
/** /**
* Gets the helper set associated with this helper. * Gets the helper set associated with this helper.
@ -36,7 +36,7 @@ interface HelperInterface
* *
* @api * @api
*/ */
function getHelperSet(); public function getHelperSet();
/** /**
* Returns the canonical name of this helper. * Returns the canonical name of this helper.
@ -45,5 +45,5 @@ interface HelperInterface
* *
* @api * @api
*/ */
function getName(); public function getName();
} }

View File

@ -23,7 +23,7 @@ interface InputInterface
* *
* @return string The value of the first argument or null otherwise * @return string The value of the first argument or null otherwise
*/ */
function getFirstArgument(); public function getFirstArgument();
/** /**
* Returns true if the raw parameters (not parsed) contain a value. * Returns true if the raw parameters (not parsed) contain a value.
@ -35,7 +35,7 @@ interface InputInterface
* *
* @return Boolean true if the value is contained in the raw parameters * @return Boolean true if the value is contained in the raw parameters
*/ */
function hasParameterOption($values); public function hasParameterOption($values);
/** /**
* Returns the value of a raw option (not parsed). * Returns the value of a raw option (not parsed).
@ -48,14 +48,14 @@ interface InputInterface
* *
* @return mixed The option value * @return mixed The option value
*/ */
function getParameterOption($values, $default = false); public function getParameterOption($values, $default = false);
/** /**
* Binds the current Input instance with the given arguments and options. * Binds the current Input instance with the given arguments and options.
* *
* @param InputDefinition $definition A InputDefinition instance * @param InputDefinition $definition A InputDefinition instance
*/ */
function bind(InputDefinition $definition); public function bind(InputDefinition $definition);
/** /**
* Validates if arguments given are correct. * Validates if arguments given are correct.
@ -64,14 +64,14 @@ interface InputInterface
* *
* @throws \RuntimeException * @throws \RuntimeException
*/ */
function validate(); public function validate();
/** /**
* Returns all the given arguments merged with the default values. * Returns all the given arguments merged with the default values.
* *
* @return array * @return array
*/ */
function getArguments(); public function getArguments();
/** /**
* Gets argument by name. * Gets argument by name.
@ -80,7 +80,7 @@ interface InputInterface
* *
* @return mixed * @return mixed
*/ */
function getArgument($name); public function getArgument($name);
/** /**
* Sets an argument value by name. * Sets an argument value by name.
@ -90,7 +90,7 @@ interface InputInterface
* *
* @throws \InvalidArgumentException When argument given doesn't exist * @throws \InvalidArgumentException When argument given doesn't exist
*/ */
function setArgument($name, $value); public function setArgument($name, $value);
/** /**
* Returns true if an InputArgument object exists by name or position. * Returns true if an InputArgument object exists by name or position.
@ -99,14 +99,14 @@ interface InputInterface
* *
* @return Boolean true if the InputArgument object exists, false otherwise * @return Boolean true if the InputArgument object exists, false otherwise
*/ */
function hasArgument($name); public function hasArgument($name);
/** /**
* Returns all the given options merged with the default values. * Returns all the given options merged with the default values.
* *
* @return array * @return array
*/ */
function getOptions(); public function getOptions();
/** /**
* Gets an option by name. * Gets an option by name.
@ -115,7 +115,7 @@ interface InputInterface
* *
* @return mixed * @return mixed
*/ */
function getOption($name); public function getOption($name);
/** /**
* Sets an option value by name. * Sets an option value by name.
@ -125,7 +125,7 @@ interface InputInterface
* *
* @throws \InvalidArgumentException When option given doesn't exist * @throws \InvalidArgumentException When option given doesn't exist
*/ */
function setOption($name, $value); public function setOption($name, $value);
/** /**
* Returns true if an InputOption object exists by name. * Returns true if an InputOption object exists by name.
@ -134,19 +134,19 @@ interface InputInterface
* *
* @return Boolean true if the InputOption object exists, false otherwise * @return Boolean true if the InputOption object exists, false otherwise
*/ */
function hasOption($name); public function hasOption($name);
/** /**
* Is this input means interactive? * Is this input means interactive?
* *
* @return Boolean * @return Boolean
*/ */
function isInteractive(); public function isInteractive();
/** /**
* Sets the input interactivity. * Sets the input interactivity.
* *
* @param Boolean $interactive If the input should be interactive * @param Boolean $interactive If the input should be interactive
*/ */
function setInteractive($interactive); public function setInteractive($interactive);
} }

View File

@ -41,7 +41,7 @@ interface OutputInterface
* *
* @api * @api
*/ */
function write($messages, $newline = false, $type = 0); public function write($messages, $newline = false, $type = 0);
/** /**
* Writes a message to the output and adds a newline at the end. * Writes a message to the output and adds a newline at the end.
@ -51,7 +51,7 @@ interface OutputInterface
* *
* @api * @api
*/ */
function writeln($messages, $type = 0); public function writeln($messages, $type = 0);
/** /**
* Sets the verbosity of the output. * Sets the verbosity of the output.
@ -60,7 +60,7 @@ interface OutputInterface
* *
* @api * @api
*/ */
function setVerbosity($level); public function setVerbosity($level);
/** /**
* Gets the current verbosity of the output. * Gets the current verbosity of the output.
@ -69,7 +69,7 @@ interface OutputInterface
* *
* @api * @api
*/ */
function getVerbosity(); public function getVerbosity();
/** /**
* Sets the decorated flag. * Sets the decorated flag.
@ -78,7 +78,7 @@ interface OutputInterface
* *
* @api * @api
*/ */
function setDecorated($decorated); public function setDecorated($decorated);
/** /**
* Gets the decorated flag. * Gets the decorated flag.
@ -87,7 +87,7 @@ interface OutputInterface
* *
* @api * @api
*/ */
function isDecorated(); public function isDecorated();
/** /**
* Sets output formatter. * Sets output formatter.
@ -96,7 +96,7 @@ interface OutputInterface
* *
* @api * @api
*/ */
function setFormatter(OutputFormatterInterface $formatter); public function setFormatter(OutputFormatterInterface $formatter);
/** /**
* Returns current output formatter instance. * Returns current output formatter instance.
@ -105,5 +105,5 @@ interface OutputInterface
* *
* @api * @api
*/ */
function getFormatter(); public function getFormatter();
} }

View File

@ -21,9 +21,9 @@ use Symfony\Component\Console\Tester\ApplicationTester;
class ApplicationTest extends \PHPUnit_Framework_TestCase class ApplicationTest extends \PHPUnit_Framework_TestCase
{ {
static protected $fixturesPath; protected static $fixturesPath;
static public function setUpBeforeClass() public static function setUpBeforeClass()
{ {
self::$fixturesPath = realpath(__DIR__.'/Fixtures/'); self::$fixturesPath = realpath(__DIR__.'/Fixtures/');
require_once self::$fixturesPath.'/FooCommand.php'; require_once self::$fixturesPath.'/FooCommand.php';

View File

@ -25,9 +25,9 @@ use Symfony\Component\Console\Tester\CommandTester;
class CommandTest extends \PHPUnit_Framework_TestCase class CommandTest extends \PHPUnit_Framework_TestCase
{ {
static protected $fixturesPath; protected static $fixturesPath;
static public function setUpBeforeClass() public static function setUpBeforeClass()
{ {
self::$fixturesPath = __DIR__.'/../Fixtures/'; self::$fixturesPath = __DIR__.'/../Fixtures/';
require_once self::$fixturesPath.'/TestCommand.php'; require_once self::$fixturesPath.'/TestCommand.php';

View File

@ -17,11 +17,11 @@ use Symfony\Component\Console\Input\InputOption;
class InputDefinitionTest extends \PHPUnit_Framework_TestCase class InputDefinitionTest extends \PHPUnit_Framework_TestCase
{ {
static protected $fixtures; protected static $fixtures;
protected $foo, $bar, $foo1, $foo2; protected $foo, $bar, $foo1, $foo2;
static public function setUpBeforeClass() public static function setUpBeforeClass()
{ {
self::$fixtures = __DIR__.'/../Fixtures/'; self::$fixtures = __DIR__.'/../Fixtures/';
} }
@ -97,7 +97,6 @@ class InputDefinitionTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('Cannot add an argument after an array argument.', $e->getMessage()); $this->assertEquals('Cannot add an argument after an array argument.', $e->getMessage());
} }
// cannot add a required argument after an optional one // cannot add a required argument after an optional one
$definition = new InputDefinition(); $definition = new InputDefinition();
$definition->addArgument($this->foo); $definition->addArgument($this->foo);

View File

@ -42,7 +42,7 @@ class CssSelector
* *
* @api * @api
*/ */
static public function toXPath($cssExpr, $prefix = 'descendant-or-self::') public static function toXPath($cssExpr, $prefix = 'descendant-or-self::')
{ {
if (is_string($cssExpr)) { if (is_string($cssExpr)) {
if (!$cssExpr) { if (!$cssExpr) {

View File

@ -23,7 +23,7 @@ use Symfony\Component\CssSelector\Exception\ParseException;
*/ */
class CombinedSelectorNode implements NodeInterface class CombinedSelectorNode implements NodeInterface
{ {
static protected $methodMapping = array( protected static $methodMapping = array(
' ' => 'descendant', ' ' => 'descendant',
'>' => 'child', '>' => 'child',
'+' => 'direct_adjacent', '+' => 'direct_adjacent',

View File

@ -24,7 +24,7 @@ use Symfony\Component\CssSelector\XPathExpr;
*/ */
class FunctionNode implements NodeInterface class FunctionNode implements NodeInterface
{ {
static protected $unsupported = array('target', 'lang', 'enabled', 'disabled'); protected static $unsupported = array('target', 'lang', 'enabled', 'disabled');
protected $selector; protected $selector;
protected $type; protected $type;

View File

@ -26,12 +26,12 @@ interface NodeInterface
* *
* @return string The string representation * @return string The string representation
*/ */
function __toString(); public function __toString();
/** /**
* @return XPathExpr The XPath expression * @return XPathExpr The XPath expression
* *
* @throws ParseException When unknown operator is found * @throws ParseException When unknown operator is found
*/ */
function toXpath(); public function toXpath();
} }

View File

@ -23,7 +23,7 @@ use Symfony\Component\CssSelector\Exception\ParseException;
*/ */
class PseudoNode implements NodeInterface class PseudoNode implements NodeInterface
{ {
static protected $unsupported = array( protected static $unsupported = array(
'indeterminate', 'first-line', 'first-letter', 'indeterminate', 'first-line', 'first-letter',
'selection', 'before', 'after', 'link', 'visited', 'selection', 'before', 'after', 'link', 'visited',
'active', 'focus', 'hover', 'active', 'focus', 'hover',

View File

@ -219,7 +219,7 @@ class XPathExpr
* *
* @return string * @return string
*/ */
static public function xpathLiteral($s) public static function xpathLiteral($s)
{ {
if ($s instanceof Node\ElementNode) { if ($s instanceof Node\ElementNode) {
// This is probably a symbol that looks like an expression... // This is probably a symbol that looks like an expression...

View File

@ -29,5 +29,5 @@ interface CompilerPassInterface
* *
* @api * @api
*/ */
function process(ContainerBuilder $container); public function process(ContainerBuilder $container);
} }

View File

@ -11,7 +11,6 @@
namespace Symfony\Component\DependencyInjection\Compiler; namespace Symfony\Component\DependencyInjection\Compiler;
/** /**
* Used to format logging messages during the compilation. * Used to format logging messages during the compilation.
* *

View File

@ -24,5 +24,5 @@ interface RepeatablePassInterface extends CompilerPassInterface
* *
* @param RepeatedPass $repeatedPass * @param RepeatedPass $repeatedPass
*/ */
function setRepeatedPass(RepeatedPass $repeatedPass); public function setRepeatedPass(RepeatedPass $repeatedPass);
} }

View File

@ -448,7 +448,7 @@ class Container implements IntrospectableContainerInterface
* *
* @return string The camelized string * @return string The camelized string
*/ */
static public function camelize($id) public static function camelize($id)
{ {
return preg_replace_callback('/(^|_|\.)+(.)/', function ($match) { return ('.' === $match[1] ? '_' : '').strtoupper($match[2]); }, $id); return preg_replace_callback('/(^|_|\.)+(.)/', function ($match) { return ('.' === $match[1] ? '_' : '').strtoupper($match[2]); }, $id);
} }
@ -460,7 +460,7 @@ class Container implements IntrospectableContainerInterface
* *
* @return string The underscored string * @return string The underscored string
*/ */
static public function underscore($id) public static function underscore($id)
{ {
return strtolower(preg_replace(array('/([A-Z]+)([A-Z][a-z])/', '/([a-z\d])([A-Z])/'), array('\\1_\\2', '\\1_\\2'), strtr($id, '_', '.'))); return strtolower(preg_replace(array('/([A-Z]+)([A-Z][a-z])/', '/([a-z\d])([A-Z])/'), array('\\1_\\2', '\\1_\\2'), strtr($id, '_', '.')));
} }

View File

@ -27,5 +27,5 @@ interface ContainerAwareInterface
* *
* @api * @api
*/ */
function setContainer(ContainerInterface $container = null); public function setContainer(ContainerInterface $container = null);
} }

View File

@ -854,7 +854,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
* *
* @return array An array of Service conditionals * @return array An array of Service conditionals
*/ */
static public function getServiceConditionals($value) public static function getServiceConditionals($value)
{ {
$services = array(); $services = array();

View File

@ -38,7 +38,7 @@ interface ContainerInterface
* *
* @api * @api
*/ */
function set($id, $service, $scope = self::SCOPE_CONTAINER); public function set($id, $service, $scope = self::SCOPE_CONTAINER);
/** /**
* Gets a service. * Gets a service.
@ -54,7 +54,7 @@ interface ContainerInterface
* *
* @api * @api
*/ */
function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE); public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE);
/** /**
* Returns true if the given service is defined. * Returns true if the given service is defined.
@ -65,7 +65,7 @@ interface ContainerInterface
* *
* @api * @api
*/ */
function has($id); public function has($id);
/** /**
* Gets a parameter. * Gets a parameter.
@ -78,7 +78,7 @@ interface ContainerInterface
* *
* @api * @api
*/ */
function getParameter($name); public function getParameter($name);
/** /**
* Checks if a parameter exists. * Checks if a parameter exists.
@ -89,7 +89,7 @@ interface ContainerInterface
* *
* @api * @api
*/ */
function hasParameter($name); public function hasParameter($name);
/** /**
* Sets a parameter. * Sets a parameter.
@ -99,7 +99,7 @@ interface ContainerInterface
* *
* @api * @api
*/ */
function setParameter($name, $value); public function setParameter($name, $value);
/** /**
* Enters the given scope * Enters the given scope
@ -108,7 +108,7 @@ interface ContainerInterface
* *
* @api * @api
*/ */
function enterScope($name); public function enterScope($name);
/** /**
* Leaves the current scope, and re-enters the parent scope * Leaves the current scope, and re-enters the parent scope
@ -117,7 +117,7 @@ interface ContainerInterface
* *
* @api * @api
*/ */
function leaveScope($name); public function leaveScope($name);
/** /**
* Adds a scope to the container * Adds a scope to the container
@ -126,7 +126,7 @@ interface ContainerInterface
* *
* @api * @api
*/ */
function addScope(ScopeInterface $scope); public function addScope(ScopeInterface $scope);
/** /**
* Whether this container has the given scope * Whether this container has the given scope
@ -137,7 +137,7 @@ interface ContainerInterface
* *
* @api * @api
*/ */
function hasScope($name); public function hasScope($name);
/** /**
* Determines whether the given scope is currently active. * Determines whether the given scope is currently active.
@ -150,5 +150,5 @@ interface ContainerInterface
* *
* @api * @api
*/ */
function isScopeActive($name); public function isScopeActive($name);
} }

View File

@ -29,5 +29,5 @@ interface DumperInterface
* *
* @api * @api
*/ */
function dump(array $options = array()); public function dump(array $options = array());
} }

View File

@ -281,7 +281,7 @@ class XmlDumper extends Dumper
* *
* @param mixed $value Value to convert * @param mixed $value Value to convert
*/ */
static public function phpToXml($value) public static function phpToXml($value)
{ {
switch (true) { switch (true) {
case null === $value: case null === $value:

View File

@ -28,5 +28,5 @@ interface ConfigurationExtensionInterface
* *
* @return ConfigurationInterface|null The configuration or null * @return ConfigurationInterface|null The configuration or null
*/ */
function getConfiguration(array $config, ContainerBuilder $container); public function getConfiguration(array $config, ContainerBuilder $container);
} }

View File

@ -32,7 +32,7 @@ interface ExtensionInterface
* *
* @api * @api
*/ */
function load(array $config, ContainerBuilder $container); public function load(array $config, ContainerBuilder $container);
/** /**
* Returns the namespace to be used for this extension (XML namespace). * Returns the namespace to be used for this extension (XML namespace).
@ -41,7 +41,7 @@ interface ExtensionInterface
* *
* @api * @api
*/ */
function getNamespace(); public function getNamespace();
/** /**
* Returns the base path for the XSD files. * Returns the base path for the XSD files.
@ -50,7 +50,7 @@ interface ExtensionInterface
* *
* @api * @api
*/ */
function getXsdValidationBasePath(); public function getXsdValidationBasePath();
/** /**
* Returns the recommended alias to use in XML. * Returns the recommended alias to use in XML.
@ -61,5 +61,5 @@ interface ExtensionInterface
* *
* @api * @api
*/ */
function getAlias(); public function getAlias();
} }

View File

@ -28,6 +28,6 @@ interface IntrospectableContainerInterface extends ContainerInterface
* @return Boolean true if the service has been initialized, false otherwise * @return Boolean true if the service has been initialized, false otherwise
* *
*/ */
function initialized($id); public function initialized($id);
} }

View File

@ -448,7 +448,7 @@ EOF
* *
* @return array A PHP array * @return array A PHP array
*/ */
static public function convertDomElementToArray(\DomElement $element) public static function convertDomElementToArray(\DomElement $element)
{ {
$empty = true; $empty = true;
$config = array(); $config = array();

View File

@ -27,7 +27,7 @@ interface ParameterBagInterface
* *
* @api * @api
*/ */
function clear(); public function clear();
/** /**
* Adds parameters to the service container parameters. * Adds parameters to the service container parameters.
@ -36,7 +36,7 @@ interface ParameterBagInterface
* *
* @api * @api
*/ */
function add(array $parameters); public function add(array $parameters);
/** /**
* Gets the service container parameters. * Gets the service container parameters.
@ -45,7 +45,7 @@ interface ParameterBagInterface
* *
* @api * @api
*/ */
function all(); public function all();
/** /**
* Gets a service container parameter. * Gets a service container parameter.
@ -58,7 +58,7 @@ interface ParameterBagInterface
* *
* @api * @api
*/ */
function get($name); public function get($name);
/** /**
* Sets a service container parameter. * Sets a service container parameter.
@ -68,7 +68,7 @@ interface ParameterBagInterface
* *
* @api * @api
*/ */
function set($name, $value); public function set($name, $value);
/** /**
* Returns true if a parameter name is defined. * Returns true if a parameter name is defined.
@ -79,12 +79,12 @@ interface ParameterBagInterface
* *
* @api * @api
*/ */
function has($name); public function has($name);
/** /**
* Replaces parameter placeholders (%name%) by their values for all parameters. * Replaces parameter placeholders (%name%) by their values for all parameters.
*/ */
function resolve(); public function resolve();
/** /**
* Replaces parameter placeholders (%name%) by their values. * Replaces parameter placeholders (%name%) by their values.
@ -93,7 +93,7 @@ interface ParameterBagInterface
* *
* @throws ParameterNotFoundException if a placeholder references a parameter that does not exist * @throws ParameterNotFoundException if a placeholder references a parameter that does not exist
*/ */
function resolveValue($value); public function resolveValue($value);
/** /**
* Escape parameter placeholders % * Escape parameter placeholders %
@ -102,7 +102,7 @@ interface ParameterBagInterface
* *
* @return mixed * @return mixed
*/ */
function escapeValue($value); public function escapeValue($value);
/** /**
* Unescape parameter placeholders % * Unescape parameter placeholders %
@ -111,5 +111,5 @@ interface ParameterBagInterface
* *
* @return mixed * @return mixed
*/ */
function unescapeValue($value); public function unescapeValue($value);
} }

View File

@ -23,10 +23,10 @@ interface ScopeInterface
/** /**
* @api * @api
*/ */
function getName(); public function getName();
/** /**
* @api * @api
*/ */
function getParentName(); public function getParentName();
} }

View File

@ -99,7 +99,7 @@ class SimpleXMLElement extends \SimpleXMLElement
* *
* @return mixed * @return mixed
*/ */
static public function phpize($value) public static function phpize($value)
{ {
$value = (string) $value; $value = (string) $value;
$lowercaseValue = strtolower($value); $lowercaseValue = strtolower($value);

View File

@ -29,5 +29,5 @@ interface TaggedContainerInterface extends ContainerInterface
* *
* @api * @api
*/ */
function findTaggedServiceIds($name); public function findTaggedServiceIds($name);
} }

View File

@ -550,5 +550,4 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
} }
} }
class FooClass {} class FooClass {}

View File

@ -16,7 +16,7 @@ use Symfony\Component\Config\FileLocator;
class CrossCheckTest extends \PHPUnit_Framework_TestCase class CrossCheckTest extends \PHPUnit_Framework_TestCase
{ {
static protected $fixturesPath; protected static $fixturesPath;
protected function setUp() protected function setUp()
{ {
@ -25,7 +25,7 @@ class CrossCheckTest extends \PHPUnit_Framework_TestCase
} }
} }
static public function setUpBeforeClass() public static function setUpBeforeClass()
{ {
self::$fixturesPath = __DIR__.'/Fixtures/'; self::$fixturesPath = __DIR__.'/Fixtures/';

View File

@ -16,7 +16,7 @@ use Symfony\Component\DependencyInjection\Dumper\GraphvizDumper;
class GraphvizDumperTest extends \PHPUnit_Framework_TestCase class GraphvizDumperTest extends \PHPUnit_Framework_TestCase
{ {
static protected $fixturesPath; protected static $fixturesPath;
protected function setUp() protected function setUp()
{ {
@ -25,7 +25,7 @@ class GraphvizDumperTest extends \PHPUnit_Framework_TestCase
} }
} }
static public function setUpBeforeClass() public static function setUpBeforeClass()
{ {
self::$fixturesPath = __DIR__.'/../Fixtures/'; self::$fixturesPath = __DIR__.'/../Fixtures/';
} }

View File

@ -19,7 +19,7 @@ use Symfony\Component\DependencyInjection\Definition;
class PhpDumperTest extends \PHPUnit_Framework_TestCase class PhpDumperTest extends \PHPUnit_Framework_TestCase
{ {
static protected $fixturesPath; protected static $fixturesPath;
protected function setUp() protected function setUp()
{ {
@ -28,7 +28,7 @@ class PhpDumperTest extends \PHPUnit_Framework_TestCase
} }
} }
static public function setUpBeforeClass() public static function setUpBeforeClass()
{ {
self::$fixturesPath = realpath(__DIR__.'/../Fixtures/'); self::$fixturesPath = realpath(__DIR__.'/../Fixtures/');
} }

View File

@ -16,7 +16,7 @@ use Symfony\Component\DependencyInjection\Dumper\XmlDumper;
class XmlDumperTest extends \PHPUnit_Framework_TestCase class XmlDumperTest extends \PHPUnit_Framework_TestCase
{ {
static protected $fixturesPath; protected static $fixturesPath;
protected function setUp() protected function setUp()
{ {
@ -25,7 +25,7 @@ class XmlDumperTest extends \PHPUnit_Framework_TestCase
} }
} }
static public function setUpBeforeClass() public static function setUpBeforeClass()
{ {
self::$fixturesPath = realpath(__DIR__.'/../Fixtures/'); self::$fixturesPath = realpath(__DIR__.'/../Fixtures/');
} }

Some files were not shown because too many files have changed in this diff Show More