Merge branch 'rename-execute' into experimental

Conflicts:
	src/Symfony/Component/Form/FileField.php
	src/Symfony/Component/Form/Resources/config/validation.xml
This commit is contained in:
Bernhard Schussek 2011-03-25 01:38:49 +01:00
commit 729438fdea
122 changed files with 1111 additions and 248 deletions

View File

@ -10,9 +10,10 @@
*/
namespace Symfony\Bundle\FrameworkBundle\Tests\Templating\Helper;
use Symfony\Bundle\FrameworkBundle\Templating\Helper\CodeHelper;
class TemplateTest extends \PHPUnit_Framework_TestCase
class CodeHelperTest extends \PHPUnit_Framework_TestCase
{
protected static $helper;
@ -54,5 +55,4 @@ class TemplateTest extends \PHPUnit_Framework_TestCase
array('Method', '<abbr title="Method">Method</abbr>()')
);
}
}

View File

@ -28,6 +28,8 @@ use Symfony\Component\BrowserKit\Client;
* you need to also implement the getScript() method.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
*/
abstract class Client
{
@ -47,6 +49,8 @@ abstract class Client
* @param array $server The server parameters (equivalent of $_SERVER)
* @param History $history A History instance to store the browser history
* @param CookieJar $cookieJar A CookieJar instance to store the cookies
*
* @api
*/
public function __construct(array $server = array(), History $history = null, CookieJar $cookieJar = null)
{
@ -61,6 +65,8 @@ abstract class Client
* Sets whether to automatically follow redirects or not.
*
* @param Boolean $followRedirect Whether to follow redirects
*
* @api
*/
public function followRedirects($followRedirect = true)
{
@ -73,6 +79,8 @@ abstract class Client
* @param Boolean $insulated Whether to insulate the requests or not
*
* @throws \RuntimeException When Symfony Process Component is not installed
*
* @api
*/
public function insulate($insulated = true)
{
@ -89,6 +97,8 @@ abstract class Client
* Sets server parameters.
*
* @param array $server An array of server parameters
*
* @api
*/
public function setServerParameters(array $server)
{
@ -102,6 +112,8 @@ abstract class Client
* Returns the History instance.
*
* @return History A History instance
*
* @api
*/
public function getHistory()
{
@ -112,6 +124,8 @@ abstract class Client
* Returns the CookieJar instance.
*
* @return CookieJar A CookieJar instance
*
* @api
*/
public function getCookieJar()
{
@ -122,6 +136,8 @@ abstract class Client
* Returns the current Crawler instance.
*
* @return Crawler A Crawler instance
*
* @api
*/
public function getCrawler()
{
@ -132,6 +148,8 @@ abstract class Client
* Returns the current Response instance.
*
* @return Response A Response instance
*
* @api
*/
public function getResponse()
{
@ -142,6 +160,8 @@ abstract class Client
* Returns the current Request instance.
*
* @return Request A Request instance
*
* @api
*/
public function getRequest()
{
@ -152,6 +172,8 @@ abstract class Client
* Clicks on a given link.
*
* @param Link $link A Link instance
*
* @api
*/
public function click(Link $link)
{
@ -163,6 +185,8 @@ abstract class Client
*
* @param Form $form A Form instance
* @param array $values An array of form field values
*
* @api
*/
public function submit(Form $form, array $values = array())
{
@ -183,6 +207,8 @@ abstract class Client
* @param Boolean $changeHistory Whether to update the history or not (only used internally for back(), forward(), and reload())
*
* @return Crawler
*
* @api
*/
public function request($method, $uri, array $parameters = array(), array $files = array(), array $server = array(), $content = null, $changeHistory = true)
{
@ -195,7 +221,7 @@ abstract class Client
$server['HTTP_HOST'] = parse_url($uri, PHP_URL_HOST);
$server['HTTPS'] = 'https' == parse_url($uri, PHP_URL_SCHEME);
$request = new Request($uri, $method, $parameters, $files, $this->cookieJar->getValues($uri), $server, $content);
$request = new Request($uri, $method, $parameters, $files, $this->cookieJar->allValues($uri), $server, $content);
$this->request = $this->filterRequest($request);
@ -311,6 +337,8 @@ abstract class Client
* Goes back in the browser history.
*
* @return Crawler
*
* @api
*/
public function back()
{
@ -321,6 +349,8 @@ abstract class Client
* Goes forward in the browser history.
*
* @return Crawler
*
* @api
*/
public function forward()
{
@ -331,6 +361,8 @@ abstract class Client
* Reloads the current browser.
*
* @return Crawler
*
* @api
*/
public function reload()
{
@ -343,6 +375,8 @@ abstract class Client
* @return Crawler
*
* @throws \LogicException If request was not a redirect
*
* @api
*/
public function followRedirect()
{
@ -357,6 +391,8 @@ abstract class Client
* Restarts the client.
*
* It flushes all cookies.
*
* @api
*/
public function restart()
{

View File

@ -15,6 +15,8 @@ namespace Symfony\Component\BrowserKit;
* Cookie represents an HTTP cookie.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
*/
class Cookie
{
@ -38,6 +40,8 @@ class Cookie
* @param string $domain The domain that the cookie is available
* @param bool $secure Indicates that the cookie should only be transmitted over a secure HTTPS connection from the client
* @param bool $httponly The cookie httponly flag
*
* @api
*/
public function __construct($name, $value, $expires = null, $path = '/', $domain = '', $secure = false, $httponly = false)
{
@ -54,6 +58,8 @@ class Cookie
* Returns the HTTP representation of the Cookie.
*
* @return string The HTTP representation of the Cookie
*
* @api
*/
public function __toString()
{
@ -89,6 +95,8 @@ class Cookie
* @param string $url The base URL
*
* @return Cookie A Cookie instance
*
* @api
*/
static public function fromString($cookie, $url = null)
{
@ -162,6 +170,8 @@ class Cookie
* Gets the name of the cookie.
*
* @return string The cookie name
*
* @api
*/
public function getName()
{
@ -172,6 +182,8 @@ class Cookie
* Gets the value of the cookie.
*
* @return string The cookie value
*
* @api
*/
public function getValue()
{
@ -182,6 +194,8 @@ class Cookie
* Gets the expires time of the cookie.
*
* @return string The cookie expires time
*
* @api
*/
public function getExpiresTime()
{
@ -192,6 +206,8 @@ class Cookie
* Gets the path of the cookie.
*
* @return string The cookie path
*
* @api
*/
public function getPath()
{
@ -202,6 +218,8 @@ class Cookie
* Gets the domain of the cookie.
*
* @return string The cookie domain
*
* @api
*/
public function getDomain()
{
@ -212,6 +230,8 @@ class Cookie
* Returns the secure flag of the cookie.
*
* @return Boolean The cookie secure flag
*
* @api
*/
public function isSecure()
{
@ -222,6 +242,8 @@ class Cookie
* Returns the httponly flag of the cookie.
*
* @return Boolean The cookie httponly flag
*
* @api
*/
public function isHttpOnly()
{
@ -232,6 +254,8 @@ class Cookie
* Returns true if the cookie has expired.
*
* @return Boolean true if the cookie has expired, false otherwise
*
* @api
*/
public function isExpired()
{

View File

@ -15,6 +15,8 @@ namespace Symfony\Component\BrowserKit;
* CookieJar.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
*/
class CookieJar
{
@ -24,6 +26,8 @@ class CookieJar
* Sets a cookie.
*
* @param Cookie $cookie A Cookie instance
*
* @api
*/
public function set(Cookie $cookie)
{
@ -36,6 +40,8 @@ class CookieJar
* @param string $name The cookie name
*
* @return Cookie|null A Cookie instance or null if the cookie does not exist
*
* @api
*/
public function get($name)
{
@ -48,6 +54,8 @@ class CookieJar
* Removes a cookie by name.
*
* @param string $name The cookie name
*
* @api
*/
public function expire($name)
{
@ -56,6 +64,8 @@ class CookieJar
/**
* Removes all the cookies from the jar.
*
* @api
*/
public function clear()
{
@ -94,7 +104,7 @@ class CookieJar
*
* @return array An array of cookie values
*/
public function getValues($uri)
public function allValues($uri)
{
$this->flushExpiredCookies();

View File

@ -15,6 +15,8 @@ namespace Symfony\Component\BrowserKit;
* Request object.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
*/
class Request
{
@ -36,6 +38,8 @@ class Request
* @param array $cookies An array of cookies
* @param array $server An array of server parameters
* @param string $content The raw body data
*
* @api
*/
public function __construct($uri, $method, array $parameters = array(), array $files = array(), array $cookies = array(), array $server = array(), $content = null)
{
@ -52,6 +56,8 @@ class Request
* Gets the request URI.
*
* @return string The request URI
*
* @api
*/
public function getUri()
{
@ -62,6 +68,8 @@ class Request
* Gets the request HTTP method.
*
* @return string The request HTTP method
*
* @api
*/
public function getMethod()
{
@ -72,6 +80,8 @@ class Request
* Gets the request parameters.
*
* @return array The request parameters
*
* @api
*/
public function getParameters()
{
@ -82,6 +92,8 @@ class Request
* Gets the request server files.
*
* @return array The request files
*
* @api
*/
public function getFiles()
{
@ -92,6 +104,8 @@ class Request
* Gets the request cookies.
*
* @return array The request cookies
*
* @api
*/
public function getCookies()
{
@ -102,6 +116,8 @@ class Request
* Gets the request server parameters.
*
* @return array The request server parameters
*
* @api
*/
public function getServer()
{
@ -112,6 +128,8 @@ class Request
* Gets the request raw body data.
*
* @return string The request raw body data.
*
* @api
*/
public function getContent()
{

View File

@ -15,6 +15,8 @@ namespace Symfony\Component\BrowserKit;
* Response object.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
*/
class Response
{
@ -31,6 +33,8 @@ class Response
* @param string $content The content of the response
* @param integer $status The response status code
* @param array $headers An array of headers
*
* @api
*/
public function __construct($content = '', $status = 200, array $headers = array())
{
@ -48,7 +52,6 @@ class Response
{
$headers = '';
foreach ($this->headers as $name => $value) {
if (is_string($value)) {
$headers .= $this->buildHeader($name, $value);
} else {
@ -78,6 +81,8 @@ class Response
* Gets the response content.
*
* @return string The response content
*
* @api
*/
public function getContent()
{
@ -88,6 +93,8 @@ class Response
* Gets the response status code.
*
* @return integer The response status code
*
* @api
*/
public function getStatus()
{
@ -98,6 +105,8 @@ class Response
* Gets the response headers.
*
* @return array The response headers
*
* @api
*/
public function getHeaders()
{
@ -126,4 +135,4 @@ class Response
return $first ? null : array();
}
}
}

View File

@ -17,6 +17,8 @@ require_once __DIR__.'/UniversalClassLoader.php';
* Class loader utilizing APC to remember where files are.
*
* @author Kris Wallsmith <kris.wallsmith@symfony.com>
*
* @api
*/
class ApcUniversalClassLoader extends UniversalClassLoader
{
@ -26,6 +28,8 @@ class ApcUniversalClassLoader extends UniversalClassLoader
* Constructor.
*
* @param string $prefix A prefix to create a namespace in APC
*
* @api
*/
public function __construct($prefix)
{

View File

@ -15,6 +15,8 @@ namespace Symfony\Component\ClassLoader;
* A class loader that uses a mapping file to look up paths.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
*/
class MapFileClassLoader
{
@ -24,6 +26,8 @@ class MapFileClassLoader
* Constructor.
*
* @param string $file Path to class mapping file
*
* @api
*/
public function __construct($file)
{
@ -34,6 +38,8 @@ class MapFileClassLoader
* Registers this instance as an autoloader.
*
* @param Boolean $prepend Whether to prepend the autoloader or not
*
* @api
*/
public function register($prepend = false)
{

View File

@ -51,6 +51,8 @@ namespace Symfony\Component\ClassLoader;
* found before giving up.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
*/
class UniversalClassLoader
{
@ -103,6 +105,8 @@ class UniversalClassLoader
* Registers the directory to use as a fallback for namespaces.
*
* @param string|array $dirs A directory path or an array of directories
*
* @api
*/
public function registerNamespaceFallback($dirs)
{
@ -113,6 +117,8 @@ class UniversalClassLoader
* Registers the directory to use as a fallback for class prefixes.
*
* @param string|array $dirs A directory path or an array of directories
*
* @api
*/
public function registerPrefixFallback($dirs)
{
@ -123,6 +129,8 @@ class UniversalClassLoader
* Registers an array of namespaces
*
* @param array $namespaces An array of namespaces (namespaces as keys and locations as values)
*
* @api
*/
public function registerNamespaces(array $namespaces)
{
@ -136,6 +144,8 @@ class UniversalClassLoader
*
* @param string $namespace The namespace
* @param array|string $paths The location(s) of the namespace
*
* @api
*/
public function registerNamespace($namespace, $paths)
{
@ -146,6 +156,8 @@ class UniversalClassLoader
* Registers an array of classes using the PEAR naming convention.
*
* @param array $classes An array of classes (prefixes as keys and locations as values)
*
* @api
*/
public function registerPrefixes(array $classes)
{
@ -159,6 +171,8 @@ class UniversalClassLoader
*
* @param string $prefix The classes prefix
* @param array|string $paths The location(s) of the classes
*
* @api
*/
public function registerPrefix($prefix, $paths)
{
@ -169,6 +183,8 @@ class UniversalClassLoader
* Registers this instance as an autoloader.
*
* @param Boolean $prepend Whether to prepend the autoloader or not
*
* @api
*/
public function register($prepend = false)
{

View File

@ -21,8 +21,8 @@ namespace Symfony\Component\Config;
*/
class ConfigCache
{
protected $debug;
protected $file;
private $debug;
private $file;
/**
* Constructor.

View File

@ -85,7 +85,7 @@ class FileLocator implements FileLocatorInterface
*
* @return Boolean
*/
protected function isAbsolutePath($file)
private function isAbsolutePath($file)
{
if ($file[0] == '/' || $file[0] == '\\'
|| (strlen($file) > 3 && ctype_alpha($file[0])

View File

@ -21,7 +21,8 @@ use Symfony\Component\Config\FileLocatorInterface;
abstract class FileLoader extends Loader
{
protected $locator;
protected $currentDir;
private $currentDir;
/**
* Constructor.
@ -31,6 +32,11 @@ abstract class FileLoader extends Loader
$this->locator = $locator;
}
public function setCurrentDir($dir)
{
$this->currentDir = $dir;
}
public function getLocator()
{
return $this->locator;

View File

@ -24,7 +24,7 @@ class LoaderResolver implements LoaderResolverInterface
/**
* @var LoaderInterface[] An array of LoaderInterface objects
*/
protected $loaders;
private $loaders;
/**
* Constructor.

View File

@ -18,8 +18,8 @@ namespace Symfony\Component\Config\Resource;
*/
class DirectoryResource implements ResourceInterface
{
protected $resource;
protected $filterRegexList;
private $resource;
private $filterRegexList;
/**
* Constructor.

View File

@ -18,7 +18,7 @@ namespace Symfony\Component\Config\Resource;
*/
class FileResource implements ResourceInterface
{
protected $resource;
private $resource;
/**
* Constructor.

View File

@ -41,6 +41,8 @@ use Symfony\Component\Console\Helper\DialogHelper;
* $app->run();
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
*/
class Application
{
@ -60,6 +62,8 @@ class Application
*
* @param string $name The name of the application
* @param string $version The version of the application
*
* @api
*/
public function __construct($name = 'UNKNOWN', $version = 'UNKNOWN')
{
@ -98,6 +102,8 @@ class Application
* @return integer 0 if everything went fine, or an error code
*
* @throws \Exception When doRun returns Exception
*
* @api
*/
public function run(InputInterface $input = null, OutputInterface $output = null)
{
@ -194,6 +200,8 @@ class Application
* Set a helper set to be used with the command.
*
* @param HelperSet $helperSet The helper set
*
* @api
*/
public function setHelperSet(HelperSet $helperSet)
{
@ -204,6 +212,8 @@ class Application
* Get the helper set associated with the command.
*
* @return HelperSet The HelperSet instance associated with this command
*
* @api
*/
public function getHelperSet()
{
@ -250,6 +260,8 @@ class Application
* Sets whether to catch exceptions or not during commands execution.
*
* @param Boolean $boolean Whether to catch exceptions or not during commands execution
*
* @api
*/
public function setCatchExceptions($boolean)
{
@ -260,6 +272,8 @@ class Application
* Sets whether to automatically exit after a command execution or not.
*
* @param Boolean $boolean Whether to automatically exit after a command execution or not
*
* @api
*/
public function setAutoExit($boolean)
{
@ -270,6 +284,8 @@ class Application
* Gets the name of the application.
*
* @return string The application name
*
* @api
*/
public function getName()
{
@ -280,6 +296,8 @@ class Application
* Sets the application name.
*
* @param string $name The application name
*
* @api
*/
public function setName($name)
{
@ -290,6 +308,8 @@ class Application
* Gets the application version.
*
* @return string The application version
*
* @api
*/
public function getVersion()
{
@ -300,6 +320,8 @@ class Application
* Sets the application version.
*
* @param string $version The application version
*
* @api
*/
public function setVersion($version)
{
@ -310,6 +332,8 @@ class Application
* Returns the long version of the application.
*
* @return string The long application version
*
* @api
*/
public function getLongVersion()
{
@ -326,6 +350,8 @@ class Application
* @param string $name The command name
*
* @return Command The newly created command
*
* @api
*/
public function register($name)
{
@ -336,6 +362,8 @@ class Application
* Adds an array of command objects.
*
* @param Command[] $commands An array of commands
*
* @api
*/
public function addCommands(array $commands)
{
@ -352,6 +380,8 @@ class Application
* @param Command $command A Command object
*
* @return Command The registered command
*
* @api
*/
public function add(Command $command)
{
@ -374,6 +404,8 @@ class Application
* @return Command A Command object
*
* @throws \InvalidArgumentException When command name given does not exist
*
* @api
*/
public function get($name)
{
@ -401,6 +433,8 @@ class Application
* @param string $name The command name or alias
*
* @return Boolean true if the command exists, false otherwise
*
* @api
*/
public function has($name)
{
@ -461,6 +495,8 @@ class Application
* @return Command A Command instance
*
* @throws \InvalidArgumentException When command name is incorrect or ambiguous
*
* @api
*/
public function find($name)
{
@ -513,6 +549,8 @@ class Application
* @param string $namespace A namespace name
*
* @return array An array of Command instances
*
* @api
*/
public function all($namespace = null)
{

View File

@ -22,6 +22,8 @@ use Symfony\Component\Console\Application;
* Base class for all commands.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
*/
class Command
{
@ -43,6 +45,8 @@ class Command
* @param string $name The name of the command
*
* @throws \LogicException When the command name is empty
*
* @api
*/
public function __construct($name = null)
{
@ -66,6 +70,8 @@ class Command
* Sets the application instance for this command.
*
* @param Application $application An Application instance
*
* @api
*/
public function setApplication(Application $application = null)
{
@ -76,6 +82,8 @@ class Command
* Gets the application instance for this command.
*
* @return Application An Application instance
*
* @api
*/
public function getApplication()
{
@ -145,6 +153,8 @@ class Command
*
* @see setCode()
* @see execute()
*
* @api
*/
public function run(InputInterface $input, OutputInterface $output)
{
@ -189,6 +199,8 @@ class Command
* @return Command The current instance
*
* @see execute()
*
* @api
*/
public function setCode(\Closure $code)
{
@ -222,6 +234,8 @@ class Command
* @param array|Definition $definition An array of argument and option instances or a definition instance
*
* @return Command The current instance
*
* @api
*/
public function setDefinition($definition)
{
@ -240,6 +254,8 @@ class Command
* Gets the InputDefinition attached to this Command.
*
* @return InputDefinition An InputDefinition instance
*
* @api
*/
public function getDefinition()
{
@ -255,6 +271,8 @@ class Command
* @param mixed $default The default value (for InputArgument::OPTIONAL mode only)
*
* @return Command The current instance
*
* @api
*/
public function addArgument($name, $mode = null, $description = '', $default = null)
{
@ -273,6 +291,8 @@ class Command
* @param mixed $default The default value (must be null for InputOption::VALUE_REQUIRED or self::VALUE_NONE)
*
* @return Command The current instance
*
* @api
*/
public function addOption($name, $shortcut = null, $mode = null, $description = '', $default = null)
{
@ -294,6 +314,8 @@ class Command
* @return Command The current instance
*
* @throws \InvalidArgumentException When command name given is empty
*
* @api
*/
public function setName($name)
{
@ -318,6 +340,8 @@ class Command
* Returns the command namespace.
*
* @return string The command namespace
*
* @api
*/
public function getNamespace()
{
@ -328,6 +352,8 @@ class Command
* Returns the command name
*
* @return string The command name
*
* @api
*/
public function getName()
{
@ -338,6 +364,8 @@ class Command
* Returns the fully qualified command name.
*
* @return string The fully qualified command name
*
* @api
*/
public function getFullName()
{
@ -350,6 +378,8 @@ class Command
* @param string $description The description for the command
*
* @return Command The current instance
*
* @api
*/
public function setDescription($description)
{
@ -362,6 +392,8 @@ class Command
* Returns the description for the command.
*
* @return string The description for the command
*
* @api
*/
public function getDescription()
{
@ -374,6 +406,8 @@ class Command
* @param string $help The help for the command
*
* @return Command The current instance
*
* @api
*/
public function setHelp($help)
{
@ -386,6 +420,8 @@ class Command
* Returns the help for the command.
*
* @return string The help for the command
*
* @api
*/
public function getHelp()
{
@ -420,6 +456,8 @@ class Command
* @param array $aliases An array of aliases for the command
*
* @return Command The current instance
*
* @api
*/
public function setAliases($aliases)
{
@ -432,6 +470,8 @@ class Command
* Returns the aliases for the command.
*
* @return array An array of aliases for the command
*
* @api
*/
public function getAliases()
{
@ -460,6 +500,8 @@ class Command
* @return mixed The helper value
*
* @throws \InvalidArgumentException if the helper is not defined
*
* @api
*/
public function getHelper($name)
{

View File

@ -15,6 +15,8 @@ namespace Symfony\Component\Console\Formatter;
* Formatter class for console output.
*
* @author Konstantin Kudryashov <ever.zet@gmail.com>
*
* @api
*/
class OutputFormatter implements OutputFormatterInterface
{
@ -26,6 +28,8 @@ class OutputFormatter implements OutputFormatterInterface
*
* @param boolean $decorated Whether this formatter should actually decorate strings
* @param array $styles Array of "name => FormatterStyle" instance
*
* @api
*/
public function __construct($decorated = null, array $styles = array())
{
@ -45,6 +49,8 @@ class OutputFormatter implements OutputFormatterInterface
* Sets the decorated flag.
*
* @param Boolean $decorated Whether to decorated the messages or not
*
* @api
*/
public function setDecorated($decorated)
{
@ -55,6 +61,8 @@ class OutputFormatter implements OutputFormatterInterface
* Gets the decorated flag.
*
* @return Boolean true if the output will decorate messages, false otherwise
*
* @api
*/
public function isDecorated()
{
@ -66,6 +74,8 @@ class OutputFormatter implements OutputFormatterInterface
*
* @param string $name The style name
* @param OutputFormatterStyleInterface $options The style instance
*
* @api
*/
public function setStyle($name, OutputFormatterStyleInterface $style)
{
@ -78,6 +88,8 @@ class OutputFormatter implements OutputFormatterInterface
* @param string $name
*
* @return boolean
*
* @api
*/
public function hasStyle($name)
{
@ -90,6 +102,8 @@ class OutputFormatter implements OutputFormatterInterface
* @param string $name
*
* @return OutputFormatterStyleInterface
*
* @api
*/
public function getStyle($name)
{
@ -106,6 +120,8 @@ class OutputFormatter implements OutputFormatterInterface
* @param string $message The message to style
*
* @return string The styled message
*
* @api
*/
public function format($message)
{
@ -179,7 +195,11 @@ class OutputFormatter implements OutputFormatterInterface
return '';
}
if ('style' == $match[1]) {
if (!isset($match[1])) {
$match[1] = '';
}
if ('' == $match[1]) {
$style = new OutputFormatterStyle();
} else {
if (!isset($this->styles[strtolower($match[1])])) {

View File

@ -15,6 +15,8 @@ namespace Symfony\Component\Console\Formatter;
* Formatter interface for console output.
*
* @author Konstantin Kudryashov <ever.zet@gmail.com>
*
* @api
*/
interface OutputFormatterInterface
{
@ -22,6 +24,8 @@ interface OutputFormatterInterface
* Sets the decorated flag.
*
* @param Boolean $decorated Whether to decorated the messages or not
*
* @api
*/
function setDecorated($decorated);
@ -29,6 +33,8 @@ interface OutputFormatterInterface
* Gets the decorated flag.
*
* @return Boolean true if the output will decorate messages, false otherwise
*
* @api
*/
function isDecorated();
@ -37,6 +43,8 @@ interface OutputFormatterInterface
*
* @param string $name The style name
* @param OutputFormatterStyleInterface $options The style instance
*
* @api
*/
function setStyle($name, OutputFormatterStyleInterface $style);
@ -46,6 +54,8 @@ interface OutputFormatterInterface
* @param string $name
*
* @return boolean
*
* @api
*/
function hasStyle($name);
@ -55,6 +65,8 @@ interface OutputFormatterInterface
* @param string $name
*
* @return OutputFormatterStyleInterface
*
* @api
*/
function getStyle($name);
@ -64,6 +76,8 @@ interface OutputFormatterInterface
* @param string $message The message to style
*
* @return string The styled message
*
* @api
*/
function format($message);
}

View File

@ -15,6 +15,8 @@ namespace Symfony\Component\Console\Formatter;
* Formatter style class for defining styles.
*
* @author Konstantin Kudryashov <ever.zet@gmail.com>
*
* @api
*/
class OutputFormatterStyle implements OutputFormatterStyleInterface
{
@ -56,6 +58,8 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
* @param string $foreground style foreground color name
* @param string $background style background color name
* @param array $options style options
*
* @api
*/
public function __construct($foreground = null, $background = null, array $options = array())
{
@ -74,6 +78,8 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
* Sets style foreground color.
*
* @param string $color color name
*
* @api
*/
public function setForeground($color = null)
{
@ -98,6 +104,8 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
* Sets style background color.
*
* @param string $color color name
*
* @api
*/
public function setBackground($color = null)
{
@ -122,6 +130,8 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
* Sets some specific style option.
*
* @param string $option option name
*
* @api
*/
public function setOption($option)
{

View File

@ -15,6 +15,8 @@ namespace Symfony\Component\Console\Formatter;
* Formatter style interface for defining styles.
*
* @author Konstantin Kudryashov <ever.zet@gmail.com>
*
* @api
*/
interface OutputFormatterStyleInterface
{
@ -22,6 +24,8 @@ interface OutputFormatterStyleInterface
* Sets style foreground color.
*
* @param string $color color name
*
* @api
*/
function setForeground($color = null);
@ -29,6 +33,8 @@ interface OutputFormatterStyleInterface
* Sets style background color.
*
* @param string $color color name
*
* @api
*/
function setBackground($color = null);
@ -36,6 +42,8 @@ interface OutputFormatterStyleInterface
* Sets some specific style option.
*
* @param string $option option name
*
* @api
*/
function setOption($option);

View File

@ -15,6 +15,8 @@ namespace Symfony\Component\Console\Helper;
* HelperInterface is the interface all helpers must implement.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
*/
interface HelperInterface
{
@ -22,6 +24,8 @@ interface HelperInterface
* Sets the helper set associated with this helper.
*
* @param HelperSet $helperSet A HelperSet instance
*
* @api
*/
function setHelperSet(HelperSet $helperSet = null);
@ -29,6 +33,8 @@ interface HelperInterface
* Gets the helper set associated with this helper.
*
* @return HelperSet A HelperSet instance
*
* @api
*/
function getHelperSet();
@ -36,6 +42,8 @@ interface HelperInterface
* Returns the canonical name of this helper.
*
* @return string The canonical name
*
* @api
*/
function getName();
}

View File

@ -35,6 +35,8 @@ namespace Symfony\Component\Console\Input;
*
* @see http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html
* @see http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html#tag_12_02
*
* @api
*/
class ArgvInput extends Input
{
@ -46,6 +48,8 @@ class ArgvInput extends Input
*
* @param array $argv An array of parameters from the CLI (in the argv format)
* @param InputDefinition $definition A InputDefinition instance
*
* @api
*/
public function __construct(array $argv = null, InputDefinition $definition = null)
{

View File

@ -19,6 +19,8 @@ namespace Symfony\Component\Console\Input;
* $input = new ArrayInput(array('name' => 'foo', '--bar' => 'foobar'));
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
*/
class ArrayInput extends Input
{
@ -29,6 +31,8 @@ class ArrayInput extends Input
*
* @param array $param An array of parameters
* @param InputDefinition $definition A InputDefinition instance
*
* @api
*/
public function __construct(array $parameters, InputDefinition $definition = null)
{

View File

@ -15,6 +15,8 @@ namespace Symfony\Component\Console\Input;
* Represents a command line argument.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
*/
class InputArgument
{
@ -36,6 +38,8 @@ class InputArgument
* @param mixed $default The default value (for self::OPTIONAL mode only)
*
* @throws \InvalidArgumentException When argument mode is not valid
*
* @api
*/
public function __construct($name, $mode = null, $description = '', $default = null)
{

View File

@ -22,6 +22,8 @@ namespace Symfony\Component\Console\Input;
* ));
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
*/
class InputDefinition
{
@ -36,6 +38,8 @@ class InputDefinition
* Constructor.
*
* @param array $definition An array of InputArgument and InputOption instance
*
* @api
*/
public function __construct(array $definition = array())
{
@ -46,6 +50,8 @@ class InputDefinition
* Sets the definition of the input.
*
* @param array $definition The definition array
*
* @api
*/
public function setDefinition(array $definition)
{
@ -67,6 +73,8 @@ class InputDefinition
* Sets the InputArgument objects.
*
* @param array $arguments An array of InputArgument objects
*
* @api
*/
public function setArguments($arguments = array())
{
@ -81,6 +89,8 @@ class InputDefinition
* Add an array of InputArgument objects.
*
* @param InputArgument[] $arguments An array of InputArgument objects
*
* @api
*/
public function addArguments($arguments = array())
{
@ -97,6 +107,8 @@ class InputDefinition
* @param InputArgument $argument An InputArgument object
*
* @throws \LogicException When incorrect argument is given
*
* @api
*/
public function addArgument(InputArgument $argument)
{
@ -133,6 +145,8 @@ class InputDefinition
* @return InputArgument An InputArgument object
*
* @throws \InvalidArgumentException When argument given doesn't exist
*
* @api
*/
public function getArgument($name)
{
@ -151,6 +165,8 @@ class InputDefinition
* @param string|integer $name The InputArgument name or position
*
* @return Boolean true if the InputArgument object exists, false otherwise
*
* @api
*/
public function hasArgument($name)
{
@ -163,6 +179,8 @@ class InputDefinition
* Gets the array of InputArgument objects.
*
* @return array An array of InputArgument objects
*
* @api
*/
public function getArguments()
{
@ -208,6 +226,8 @@ class InputDefinition
* Sets the InputOption objects.
*
* @param array $options An array of InputOption objects
*
* @api
*/
public function setOptions($options = array())
{
@ -220,6 +240,8 @@ class InputDefinition
* Add an array of InputOption objects.
*
* @param InputOption[] $options An array of InputOption objects
*
* @api
*/
public function addOptions($options = array())
{
@ -234,6 +256,8 @@ class InputDefinition
* @param InputOption $option An InputOption object
*
* @throws \LogicException When option given already exist
*
* @api
*/
public function addOption(InputOption $option)
{
@ -255,6 +279,8 @@ class InputDefinition
* @param string $name The InputOption name
*
* @return InputOption A InputOption object
*
* @api
*/
public function getOption($name)
{
@ -271,6 +297,8 @@ class InputDefinition
* @param string $name The InputOption name
*
* @return Boolean true if the InputOption object exists, false otherwise
*
* @api
*/
public function hasOption($name)
{
@ -281,6 +309,8 @@ class InputDefinition
* Gets the array of InputOption objects.
*
* @return array An array of InputOption objects
*
* @api
*/
public function getOptions()
{

View File

@ -15,6 +15,8 @@ namespace Symfony\Component\Console\Input;
* Represents a command line option.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
*/
class InputOption
{
@ -39,6 +41,8 @@ class InputOption
* @param mixed $default The default value (must be null for self::VALUE_REQUIRED or self::VALUE_NONE)
*
* @throws \InvalidArgumentException If option mode is invalid or incompatible
*
* @api
*/
public function __construct($name, $shortcut = null, $mode = null, $description = '', $default = null)
{

View File

@ -19,6 +19,8 @@ namespace Symfony\Component\Console\Input;
* $input = new StringInput('foo --bar="foobar"');
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
*/
class StringInput extends ArgvInput
{
@ -30,6 +32,8 @@ class StringInput extends ArgvInput
*
* @param string $input An array of parameters from the CLI (in the argv format)
* @param InputDefinition $definition A InputDefinition instance
*
* @api
*/
public function __construct($input, InputDefinition $definition = null)
{

View File

@ -25,6 +25,8 @@ use Symfony\Component\Console\Formatter\OutputFormatter;
* $output = new StreamOutput(fopen('php://stdout', 'w'));
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
*/
class ConsoleOutput extends StreamOutput
{
@ -34,6 +36,8 @@ class ConsoleOutput extends StreamOutput
* @param integer $verbosity The verbosity level (self::VERBOSITY_QUIET, self::VERBOSITY_NORMAL, self::VERBOSITY_VERBOSE)
* @param Boolean $decorated Whether to decorate messages or not (null for auto-guessing)
* @param OutputFormatter $formatter Output formatter instance
*
* @api
*/
public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatter $formatter = null)
{

View File

@ -17,6 +17,8 @@ namespace Symfony\Component\Console\Output;
* $output = new NullOutput();
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
*/
class NullOutput extends Output
{

View File

@ -24,6 +24,8 @@ use Symfony\Component\Console\Formatter\OutputFormatter;
* * quiet: -q (no output)
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
*/
abstract class Output implements OutputInterface
{
@ -44,6 +46,8 @@ abstract class Output implements OutputInterface
* @param integer $verbosity The verbosity level (self::VERBOSITY_QUIET, self::VERBOSITY_NORMAL, self::VERBOSITY_VERBOSE)
* @param Boolean $decorated Whether to decorate messages or not (null for auto-guessing)
* @param OutputFormatterInterface $formatter Output formatter instance
*
* @api
*/
public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatterInterface $formatter = null)
{
@ -60,6 +64,8 @@ abstract class Output implements OutputInterface
* Sets output formatter.
*
* @param OutputFormatterInterface $formatter
*
* @api
*/
public function setFormatter(OutputFormatterInterface $formatter)
{
@ -70,6 +76,8 @@ abstract class Output implements OutputInterface
* Returns current output formatter instance.
*
* @return OutputFormatterInterface
*
* @api
*/
public function getFormatter()
{
@ -80,6 +88,8 @@ abstract class Output implements OutputInterface
* Sets the decorated flag.
*
* @param Boolean $decorated Whether to decorated the messages or not
*
* @api
*/
public function setDecorated($decorated)
{
@ -90,6 +100,8 @@ abstract class Output implements OutputInterface
* Gets the decorated flag.
*
* @return Boolean true if the output will decorate messages, false otherwise
*
* @api
*/
public function isDecorated()
{
@ -100,6 +112,8 @@ abstract class Output implements OutputInterface
* Sets the verbosity of the output.
*
* @param integer $level The level of verbosity
*
* @api
*/
public function setVerbosity($level)
{
@ -110,6 +124,8 @@ abstract class Output implements OutputInterface
* Gets the current verbosity of the output.
*
* @return integer The current level of verbosity
*
* @api
*/
public function getVerbosity()
{
@ -121,6 +137,8 @@ abstract class Output implements OutputInterface
*
* @param string|array $messages The message as an array of lines of a single string
* @param integer $type The type of output
*
* @api
*/
public function writeln($messages, $type = 0)
{
@ -135,6 +153,8 @@ abstract class Output implements OutputInterface
* @param integer $type The type of output
*
* @throws \InvalidArgumentException When unknown output type is given
*
* @api
*/
public function write($messages, $newline = false, $type = 0)
{

View File

@ -17,6 +17,8 @@ use Symfony\Component\Console\Formatter\OutputFormatterInterface;
* OutputInterface is the interface implemented by all Output classes.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
*/
interface OutputInterface
{
@ -28,6 +30,8 @@ interface OutputInterface
* @param integer $type The type of output
*
* @throws \InvalidArgumentException When unknown output type is given
*
* @api
*/
function write($messages, $newline = false, $type = 0);
@ -36,6 +40,8 @@ interface OutputInterface
*
* @param string|array $messages The message as an array of lines of a single string
* @param integer $type The type of output
*
* @api
*/
function writeln($messages, $type = 0);
@ -43,20 +49,42 @@ interface OutputInterface
* Sets the verbosity of the output.
*
* @param integer $level The level of verbosity
*
* @api
*/
function setVerbosity($level);
/**
* Gets the current verbosity of the output.
*
* @return integer The current level of verbosity
*/
function getVerbosity();
/**
* Sets the decorated flag.
*
* @param Boolean $decorated Whether to decorated the messages or not
*
* @api
*/
function setDecorated($decorated);
/**
* Gets the decorated flag.
*
* @return Boolean true if the output will decorate messages, false otherwise
*
* @api
*/
function isDecorated();
/**
* Sets output formatter.
*
* @param OutputFormatterInterface $formatter
*
* @api
*/
function setFormatter(OutputFormatterInterface $formatter);
@ -64,6 +92,8 @@ interface OutputInterface
* Returns current output formatter instance.
*
* @return OutputFormatterInterface
*
* @api
*/
function getFormatter();
}

View File

@ -25,6 +25,8 @@ use Symfony\Component\Console\Formatter\OutputFormatter;
* $output = new StreamOutput(fopen('/path/to/output.log', 'a', false));
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
*/
class StreamOutput extends Output
{
@ -39,6 +41,8 @@ class StreamOutput extends Output
* @param OutputFormatter $formatter Output formatter instance
*
* @throws \InvalidArgumentException When first argument is not a real stream
*
* @api
*/
public function __construct($stream, $verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatter $formatter = null)
{

View File

@ -21,6 +21,8 @@ namespace Symfony\Component\CssSelector;
* which is copyright Infrae and distributed under the BSD license.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
*/
class Parser
{
@ -29,12 +31,14 @@ class Parser
* Optionally, a prefix can be added to the resulting XPath
* expression with the $prefix parameter.
*
* @throws SyntaxError When got None for xpath expression
*
* @param mixed $cssExpr The CSS expression.
* @param string $prefix An optional prefix for the XPath expression.
*
* @return string
*
* @throws SyntaxError When got None for xpath expression
*
* @api
*/
static public function cssToXpath($cssExpr, $prefix = 'descendant-or-self::')
{
@ -103,7 +107,7 @@ class Parser
*
* @return Node\NodeInterface
*/
protected function parseSelectorGroup($stream)
private function parseSelectorGroup($stream)
{
$result = array();
while (true) {
@ -132,7 +136,7 @@ class Parser
*
* @return Node\NodeInterface
*/
protected function parseSelector($stream)
private function parseSelector($stream)
{
$result = $this->parseSimpleSelector($stream);
@ -168,7 +172,7 @@ class Parser
*
* @return Node\NodeInterface
*/
protected function parseSimpleSelector($stream)
private function parseSimpleSelector($stream)
{
$peek = $stream->peek();
if ('*' != $peek && !$peek->isType('Symbol')) {
@ -277,7 +281,7 @@ class Parser
*
* @return Node\AttribNode
*/
protected function parseAttrib($selector, $stream)
private function parseAttrib($selector, $stream)
{
$attrib = $stream->next();
if ($stream->peek() == '|') {

View File

@ -21,9 +21,9 @@ namespace Symfony\Component\CssSelector;
*/
class Token
{
protected $type;
protected $value;
protected $position;
private $type;
private $value;
private $position;
/**
* Constructor.

View File

@ -21,11 +21,11 @@ namespace Symfony\Component\CssSelector;
*/
class TokenStream
{
protected $used;
protected $tokens;
protected $source;
protected $peeked;
protected $peeking;
private $used;
private $tokens;
private $source;
private $peeked;
private $peeking;
/**
* Constructor.

View File

@ -114,7 +114,7 @@ class Tokenizer
*
* @return array
*/
protected function tokenizeEscapedString($s, $pos)
private function tokenizeEscapedString($s, $pos)
{
$quote = $s[$pos];
@ -150,7 +150,7 @@ class Tokenizer
*
* @return string
*/
protected function unescapeStringLiteral($literal)
private function unescapeStringLiteral($literal)
{
return preg_replace_callback('#(\\\\(?:[A-Fa-f0-9]{1,6}(?:\r\n|\s)?|[^A-Fa-f0-9]))#', function ($matches) use ($literal)
{
@ -177,7 +177,7 @@ class Tokenizer
*
* @return array
*/
protected function tokenizeSymbol($s, $pos)
private function tokenizeSymbol($s, $pos)
{
$start = $pos;

View File

@ -21,11 +21,11 @@ namespace Symfony\Component\CssSelector;
*/
class XPathExpr
{
protected $prefix;
protected $path;
protected $element;
protected $condition;
protected $starPrefix;
private $prefix;
private $path;
private $element;
private $condition;
private $starPrefix;
/**
* Constructor.

View File

@ -36,7 +36,7 @@ class PhpFileLoader extends FileLoader
$loader = $this;
$path = $this->locator->locate($file);
$this->currentDir = dirname($path);
$this->setCurrentDir(dirname($path));
$this->container->addResource(new FileResource($path));
include $path;

View File

@ -106,7 +106,7 @@ class XmlFileLoader extends FileLoader
}
foreach ($imports as $import) {
$this->currentDir = dirname($file);
$this->setCurrentDir(dirname($file));
$this->import((string) $import['resource'], (Boolean) $import->getAttributeAsPhp('ignore-errors'));
}
}

View File

@ -96,7 +96,7 @@ class YamlFileLoader extends FileLoader
}
foreach ($content['imports'] as $import) {
$this->currentDir = dirname($file);
$this->setCurrentDir(dirname($file));
$this->import($import['resource'], isset($import['ignore_errors']) ? (Boolean) $import['ignore_errors'] : false);
}
}

View File

@ -17,6 +17,8 @@ use Symfony\Component\CssSelector\Parser as CssParser;
* Crawler eases navigation of a list of \DOMNode objects.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
*/
class Crawler extends \SplObjectStorage
{
@ -32,6 +34,8 @@ class Crawler extends \SplObjectStorage
* @param string $uri The base URI to use for absolute links or form actions
* @param string $base An optional base href for generating the uris for Form and Link.
* This will be autodetected if $node has a <base> tag.
*
* @api
*/
public function __construct($node = null, $uri = null, $base = null)
{
@ -48,6 +52,8 @@ class Crawler extends \SplObjectStorage
/**
* Removes all the nodes.
*
* @api
*/
public function clear()
{
@ -61,6 +67,8 @@ class Crawler extends \SplObjectStorage
* on the type of the argument.
*
* @param null|\DOMNodeList|array|\DOMNode $node A node
*
* @api
*/
public function add($node)
{
@ -75,6 +83,12 @@ class Crawler extends \SplObjectStorage
}
}
/**
* Adds HTML/XML content.
*
* @param string $content A string to parse as HTML/XML
* @param string $type The content type of the string
*/
public function addContent($content, $type = null)
{
if (empty($type)) {
@ -103,6 +117,8 @@ class Crawler extends \SplObjectStorage
*
* @param string $content The HTML content
* @param string $charset The charset
*
* @api
*/
public function addHtmlContent($content, $charset = 'UTF-8')
{
@ -124,6 +140,8 @@ class Crawler extends \SplObjectStorage
*
* @param string $content The XML content
* @param string $charset The charset
*
* @api
*/
public function addXmlContent($content, $charset = 'UTF-8')
{
@ -139,6 +157,8 @@ class Crawler extends \SplObjectStorage
* Adds a \DOMDocument to the list of nodes.
*
* @param \DOMDocument $dom A \DOMDocument instance
*
* @api
*/
public function addDocument(\DOMDocument $dom)
{
@ -151,6 +171,8 @@ class Crawler extends \SplObjectStorage
* Adds a \DOMNodeList to the list of nodes.
*
* @param \DOMNodeList $nodes A \DOMNodeList instance
*
* @api
*/
public function addNodeList(\DOMNodeList $nodes)
{
@ -163,6 +185,8 @@ class Crawler extends \SplObjectStorage
* Adds an array of \DOMNode instances to the list of nodes.
*
* @param array $nodes An array of \DOMNode instances
*
* @api
*/
public function addNodes(array $nodes)
{
@ -175,6 +199,8 @@ class Crawler extends \SplObjectStorage
* Adds a \DOMNode instance to the list of nodes.
*
* @param \DOMNode $node A \DOMNode instance
*
* @api
*/
public function addNode(\DOMNode $node)
{
@ -191,6 +217,8 @@ class Crawler extends \SplObjectStorage
* @param integer $position The position
*
* @return A new instance of the Crawler with the selected node, or an empty Crawler if it does not exist.
*
* @api
*/
public function eq($position)
{
@ -218,6 +246,8 @@ class Crawler extends \SplObjectStorage
* @param \Closure $closure An anonymous function
*
* @return array An array of values returned by the anonymous function
*
* @api
*/
public function each(\Closure $closure)
{
@ -237,6 +267,8 @@ class Crawler extends \SplObjectStorage
* @param \Closure $closure An anonymous function
*
* @return Crawler A Crawler instance with the selected nodes.
*
* @api
*/
public function reduce(\Closure $closure)
{
@ -254,6 +286,8 @@ class Crawler extends \SplObjectStorage
* Returns the first node of the current selection
*
* @return Crawler A Crawler instance with the first selected node
*
* @api
*/
public function first()
{
@ -264,6 +298,8 @@ class Crawler extends \SplObjectStorage
* Returns the last node of the current selection
*
* @return Crawler A Crawler instance with the last selected node
*
* @api
*/
public function last()
{
@ -276,6 +312,8 @@ class Crawler extends \SplObjectStorage
* @return Crawler A Crawler instance with the sibling nodes
*
* @throws \InvalidArgumentException When current node is empty
*
* @api
*/
public function siblings()
{
@ -292,6 +330,8 @@ class Crawler extends \SplObjectStorage
* @return Crawler A Crawler instance with the next sibling nodes
*
* @throws \InvalidArgumentException When current node is empty
*
* @api
*/
public function nextAll()
{
@ -306,6 +346,8 @@ class Crawler extends \SplObjectStorage
* Returns the previous sibling nodes of the current selection
*
* @return Crawler A Crawler instance with the previous sibling nodes
*
* @api
*/
public function previousAll()
{
@ -322,6 +364,8 @@ class Crawler extends \SplObjectStorage
* @return Crawler A Crawler instance with the parents nodes of the current selection
*
* @throws \InvalidArgumentException When current node is empty
*
* @api
*/
public function parents()
{
@ -347,6 +391,8 @@ class Crawler extends \SplObjectStorage
* @return Crawler A Crawler instance with the children nodes
*
* @throws \InvalidArgumentException When current node is empty
*
* @api
*/
public function children()
{
@ -365,6 +411,8 @@ class Crawler extends \SplObjectStorage
* @return string The attribute value
*
* @throws \InvalidArgumentException When current node is empty
*
* @api
*/
public function attr($attribute)
{
@ -381,6 +429,8 @@ class Crawler extends \SplObjectStorage
* @return string The node value
*
* @throws \InvalidArgumentException When current node is empty
*
* @api
*/
public function text()
{
@ -403,6 +453,8 @@ class Crawler extends \SplObjectStorage
* @param array $attributes An array of attributes
*
* @return array An array of extracted values
*
* @api
*/
public function extract($attributes)
{
@ -433,6 +485,8 @@ class Crawler extends \SplObjectStorage
* @param string $xpath An XPath expression
*
* @return Crawler A new instance of Crawler with the filtered list of nodes
*
* @api
*/
public function filterXPath($xpath)
{
@ -457,6 +511,8 @@ class Crawler extends \SplObjectStorage
* @return Crawler A new instance of Crawler with the filtered list of nodes
*
* @throws \RuntimeException if the CssSelector Component is not available
*
* @api
*/
public function filter($selector)
{
@ -475,6 +531,8 @@ class Crawler extends \SplObjectStorage
* @param string $value The link text
*
* @return Crawler A new instance of Crawler with the filtered list of nodes
*
* @api
*/
public function selectLink($value)
{
@ -490,6 +548,8 @@ class Crawler extends \SplObjectStorage
* @param string $value The button text
*
* @return Crawler A new instance of Crawler with the filtered list of nodes
*
* @api
*/
public function selectButton($value)
{
@ -508,6 +568,8 @@ class Crawler extends \SplObjectStorage
* @return Link A Link instance
*
* @throws \InvalidArgumentException If the current node list is empty
*
* @api
*/
public function link($method = 'get')
{
@ -524,6 +586,8 @@ class Crawler extends \SplObjectStorage
* Returns an array of Link objects for the nodes in the list.
*
* @return array An array of Link instances
*
* @api
*/
public function links()
{
@ -544,6 +608,8 @@ class Crawler extends \SplObjectStorage
* @return Form A Form instance
*
* @throws \InvalidArgumentException If the current node list is empty
*
* @api
*/
public function form(array $values = null, $method = null)
{

View File

@ -17,6 +17,8 @@ namespace Symfony\Component\DomCrawler\Field;
* It is constructed from a HTML select tag, or a HTML checkbox, or radio inputs.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
*/
class ChoiceFormField extends FormField
{
@ -55,6 +57,8 @@ class ChoiceFormField extends FormField
* Ticks a checkbox.
*
* @throws \InvalidArgumentException When value type provided is not correct
*
* @api
*/
public function tick()
{
@ -69,6 +73,8 @@ class ChoiceFormField extends FormField
* Ticks a checkbox.
*
* @throws \InvalidArgumentException When value type provided is not correct
*
* @api
*/
public function untick()
{

View File

@ -15,6 +15,8 @@ namespace Symfony\Component\DomCrawler\Field;
* FileFormField represents a file form field (an HTML file input tag).
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
*/
class FileFormField extends FormField
{
@ -39,6 +41,8 @@ class FileFormField extends FormField
* Sets the value of the field.
*
* @param string $value The value of the field
*
* @api
*/
public function upload($value)
{

View File

@ -18,6 +18,8 @@ namespace Symfony\Component\DomCrawler\Field;
* specialized classes (cf. FileFormField and ChoiceFormField).
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
*/
class InputFormField extends FormField
{

View File

@ -15,6 +15,8 @@ namespace Symfony\Component\DomCrawler\Field;
* TextareaFormField represents a textarea form field (an HTML textarea tag).
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
*/
class TextareaFormField extends FormField
{

View File

@ -17,6 +17,8 @@ use Symfony\Component\DomCrawler\Field\FormField;
* Form represents an HTML form.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
*/
class Form implements \ArrayAccess
{
@ -39,6 +41,8 @@ class Form implements \ArrayAccess
* @param string $base An optional base href for generating the submit uri
*
* @throws \LogicException if the node is not a button inside a form tag
*
* @api
*/
public function __construct(\DOMNode $node, $method = null, $host = null, $path = '/', $base = null)
{
@ -76,6 +80,8 @@ class Form implements \ArrayAccess
* Sets the value of the fields.
*
* @param array $values An array of field values
*
* @api
*/
public function setValues(array $values)
{
@ -92,6 +98,8 @@ class Form implements \ArrayAccess
* The returned array does not include file fields (@see getFiles).
*
* @return array An array of field values.
*
* @api
*/
public function getValues()
{
@ -109,6 +117,8 @@ class Form implements \ArrayAccess
* Gets the file field values.
*
* @return array An array of file field values.
*
* @api
*/
public function getFiles()
{
@ -133,6 +143,8 @@ class Form implements \ArrayAccess
* (like foo[bar] to arrays) like PHP does.
*
* @return array An array of field values.
*
* @api
*/
public function getPhpValues()
{
@ -149,6 +161,8 @@ class Form implements \ArrayAccess
* (like foo[bar] to arrays) like PHP does.
*
* @return array An array of field values.
*
* @api
*/
public function getPhpFiles()
{
@ -168,6 +182,8 @@ class Form implements \ArrayAccess
* @param Boolean $absolute Whether to return an absolute URI or not (this only works if a base URI has been provided)
*
* @return string The URI
*
* @api
*/
public function getUri($absolute = true)
{
@ -207,6 +223,8 @@ class Form implements \ArrayAccess
* If no method is defined in the form, GET is returned.
*
* @return string The method
*
* @api
*/
public function getMethod()
{
@ -223,6 +241,8 @@ class Form implements \ArrayAccess
* @param string $name The field name
*
* @return Boolean true if the field exists, false otherwise
*
* @api
*/
public function has($name)
{
@ -233,6 +253,8 @@ class Form implements \ArrayAccess
* Removes a field from the form.
*
* @param string $name The field name
*
* @api
*/
public function remove($name)
{
@ -247,6 +269,8 @@ class Form implements \ArrayAccess
* @return FormField The field instance
*
* @throws \InvalidArgumentException When field is not present in this form
*
* @api
*/
public function get($name)
{
@ -263,6 +287,8 @@ class Form implements \ArrayAccess
* @param string $name The field name
*
* @return FormField The field instance
*
* @api
*/
public function set(Field\FormField $field)
{
@ -273,6 +299,8 @@ class Form implements \ArrayAccess
* Gets all fields.
*
* @return array An array of fields
*
* @api
*/
public function all()
{

View File

@ -15,6 +15,8 @@ namespace Symfony\Component\DomCrawler;
* Link represents an HTML link (an HTML a tag).
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
*/
class Link
{
@ -34,6 +36,8 @@ class Link
* @param strin $base An optional base href for generating the uri
*
* @throws \LogicException if the node is not a link
*
* @api
*/
public function __construct(\DOMNode $node, $method = 'get', $host = null, $path = '/', $base = null)
{
@ -64,6 +68,8 @@ class Link
* @param Boolean $absolute Whether to return an absolute URI or not (this only works if a base URI has been provided)
*
* @return string The URI
*
* @api
*/
public function getUri($absolute = true)
{
@ -93,6 +99,8 @@ class Link
* Gets the method associated with this link.
*
* @return string The method
*
* @api
*/
public function getMethod()
{

View File

@ -35,6 +35,8 @@ namespace Symfony\Component\EventDispatcher;
* @author Roman Borschel <roman@code-factory.org>
* @author Bernhard Schussek <bschussek@gmail.com>
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
*/
class EventDispatcher implements EventDispatcherInterface
{
@ -43,6 +45,8 @@ class EventDispatcher implements EventDispatcherInterface
/**
* @see EventDispatcherInterface::dispatch
*
* @api
*/
public function dispatch($eventName, Event $event = null)
{
@ -65,6 +69,8 @@ class EventDispatcher implements EventDispatcherInterface
/**
* @see EventDispatcherInterface::getListeners
*
* @api
*/
public function getListeners($eventName = null)
{
@ -92,6 +98,8 @@ class EventDispatcher implements EventDispatcherInterface
/**
* @see EventDispatcherInterface::hasListeners
*
* @api
*/
public function hasListeners($eventName = null)
{
@ -100,6 +108,8 @@ class EventDispatcher implements EventDispatcherInterface
/**
* @see EventDispatcherInterface::addListener
*
* @api
*/
public function addListener($eventNames, $listener, $priority = 0)
{

View File

@ -17,6 +17,8 @@ namespace Symfony\Component\EventDispatcher;
* manager.
*
* @author Bernhard Schussek <bschussek@gmail.com>
*
* @api
*/
interface EventDispatcherInterface
{
@ -28,6 +30,8 @@ interface EventDispatcherInterface
* invoked on listeners.
* @param Event $event The event to pass to the event handlers/listeners.
* If not supplied, an empty Event instance is created.
*
* @api
*/
function dispatch($eventName, Event $event = null);
@ -39,6 +43,8 @@ interface EventDispatcherInterface
* @param integer $priority The higher this value, the earlier an event
* listener will be triggered in the chain.
* Defaults to 0.
*
* @api
*/
function addListener($eventNames, $listener, $priority = 0);
@ -75,6 +81,8 @@ interface EventDispatcherInterface
*
* @return array The event listeners for the specified event, or all event
* listeners by event name.
*
* @api
*/
function getListeners($eventName = null);
@ -85,6 +93,8 @@ interface EventDispatcherInterface
*
* @return Boolean TRUE if the specified event has any listeners, FALSE
* otherwise.
*
* @api
*/
function hasListeners($eventName = null);
}

View File

@ -24,6 +24,8 @@ namespace Symfony\Component\Finder;
* $finder = $finder->files()->name('*.php')->in(__DIR__);
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
*/
class Finder implements \IteratorAggregate
{
@ -44,6 +46,8 @@ class Finder implements \IteratorAggregate
* Restricts the matching to directories only.
*
* @return Finder The current Finder instance
*
* @api
*/
public function directories()
{
@ -56,6 +60,8 @@ class Finder implements \IteratorAggregate
* Restricts the matching to files only.
*
* @return Finder The current Finder instance
*
* @api
*/
public function files()
{
@ -78,6 +84,8 @@ class Finder implements \IteratorAggregate
*
* @see Symfony\Component\Finder\Iterator\DepthRangeFilterIterator
* @see Symfony\Component\Finder\Comparator\NumberComparator
*
* @api
*/
public function depth($level)
{
@ -103,6 +111,8 @@ class Finder implements \IteratorAggregate
* @see strtotime
* @see Symfony\Component\Finder\Iterator\DateRangeFilterIterator
* @see Symfony\Component\Finder\Comparator\DateComparator
*
* @api
*/
public function date($date)
{
@ -125,6 +135,8 @@ class Finder implements \IteratorAggregate
* @return Finder The current Finder instance
*
* @see Symfony\Component\Finder\Iterator\FilenameFilterIterator
*
* @api
*/
public function name($pattern)
{
@ -141,6 +153,8 @@ class Finder implements \IteratorAggregate
* @return Finder The current Finder instance
*
* @see Symfony\Component\Finder\Iterator\FilenameFilterIterator
*
* @api
*/
public function notName($pattern)
{
@ -162,6 +176,8 @@ class Finder implements \IteratorAggregate
*
* @see Symfony\Component\Finder\Iterator\SizeRangeFilterIterator
* @see Symfony\Component\Finder\Comparator\NumberComparator
*
* @api
*/
public function size($size)
{
@ -178,6 +194,8 @@ class Finder implements \IteratorAggregate
* @return Finder The current Finder instance
*
* @see Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator
*
* @api
*/
public function exclude($dir)
{
@ -192,6 +210,8 @@ class Finder implements \IteratorAggregate
* @return Finder The current Finder instance
*
* @see Symfony\Component\Finder\Iterator\IgnoreVcsFilterIterator
*
* @api
*/
public function ignoreVCS($ignoreVCS)
{
@ -212,6 +232,8 @@ class Finder implements \IteratorAggregate
* @return Finder The current Finder instance
*
* @see Symfony\Component\Finder\Iterator\SortableIterator
*
* @api
*/
public function sort(\Closure $closure)
{
@ -228,6 +250,8 @@ class Finder implements \IteratorAggregate
* @return Finder The current Finder instance
*
* @see Symfony\Component\Finder\Iterator\SortableIterator
*
* @api
*/
public function sortByName()
{
@ -244,6 +268,8 @@ class Finder implements \IteratorAggregate
* @return Finder The current Finder instance
*
* @see Symfony\Component\Finder\Iterator\SortableIterator
*
* @api
*/
public function sortByType()
{
@ -263,6 +289,8 @@ class Finder implements \IteratorAggregate
* @return Finder The current Finder instance
*
* @see Symfony\Component\Finder\Iterator\CustomFilterIterator
*
* @api
*/
public function filter(\Closure $closure)
{
@ -275,6 +303,8 @@ class Finder implements \IteratorAggregate
* Forces the following of symlinks.
*
* @return Finder The current Finder instance
*
* @api
*/
public function followLinks()
{
@ -291,6 +321,8 @@ class Finder implements \IteratorAggregate
* @return Finder The current Finder instance
*
* @throws \InvalidArgumentException if one of the directory does not exist
*
* @api
*/
public function in($dirs)
{

View File

@ -5,7 +5,7 @@
xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd">
<class name="Symfony\Component\Form\Form">
<constraint name="Execute">validateData</constraint>
<constraint name="Callback">validateData</constraint>
<property name="children">
<constraint name="Valid" />
</property>

View File

@ -100,16 +100,16 @@ class RequestMatcher implements RequestMatcherInterface
}
foreach ($this->attributes as $key => $pattern) {
if (!preg_match('#^'.$pattern.'$#', $request->attributes->get($key))) {
if (!preg_match('#'.str_replace('#', '\\#', $pattern).'#', $request->attributes->get($key))) {
return false;
}
}
if (null !== $this->path && !preg_match('#^'.$this->path.'$#', $request->getPathInfo())) {
if (null !== $this->path && !preg_match('#'.str_replace('#', '\\#', $this->path).'#', $request->getPathInfo())) {
return false;
}
if (null !== $this->host && !preg_match('#^'.$this->host.'$#', $request->getHost())) {
if (null !== $this->host && !preg_match('#'.str_replace('#', '\\#', $this->host).'#', $request->getHost())) {
return false;
}

View File

@ -21,7 +21,7 @@ use Symfony\Component\HttpKernel\KernelInterface;
*/
class FileLocator extends BaseFileLocator
{
protected $kernel;
private $kernel;
/**
* Constructor.

View File

@ -25,7 +25,7 @@ use Symfony\Component\HttpFoundation\Request;
*/
class ControllerResolver implements ControllerResolverInterface
{
protected $logger;
private $logger;
/**
* Constructor.

View File

@ -24,7 +24,7 @@ use Symfony\Component\HttpFoundation\Response;
*/
class ConfigDataCollector extends DataCollector
{
protected $kernel;
private $kernel;
/**
* Constructor.

View File

@ -23,7 +23,7 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface;
*/
class EventDataCollector extends DataCollector
{
protected $dispatcher;
private $dispatcher;
public function setEventDispatcher(EventDispatcherInterface $dispatcher)
{

View File

@ -21,7 +21,7 @@ use Symfony\Component\HttpFoundation\Response;
*/
class LoggerDataCollector extends DataCollector
{
protected $logger;
private $logger;
public function __construct($logger = null)
{

View File

@ -122,7 +122,7 @@ class RequestDataCollector extends DataCollector
return 'request';
}
protected function getCookieHeader($name, $value, $expires, $path, $domain, $secure, $httponly)
private function getCookieHeader($name, $value, $expires, $path, $domain, $secure, $httponly)
{
$cookie = sprintf('%s=%s', $name, urlencode($value));

View File

@ -18,7 +18,7 @@ namespace Symfony\Component\HttpKernel\Debug;
*/
class ErrorHandler
{
protected $levels = array(
private $levels = array(
E_WARNING => 'Warning',
E_NOTICE => 'Notice',
E_USER_ERROR => 'User Error',
@ -28,7 +28,7 @@ class ErrorHandler
E_RECOVERABLE_ERROR => 'Catchable Fatal Error',
);
protected $level;
private $level;
/**
* Constructor.

View File

@ -26,8 +26,8 @@ use Symfony\Component\HttpFoundation\Request;
*/
class ExceptionListener
{
protected $controller;
protected $logger;
private $controller;
private $logger;
public function __construct($controller, LoggerInterface $logger = null)
{

View File

@ -22,8 +22,8 @@ use Symfony\Component\DependencyInjection\Container;
*/
abstract class Extension implements ExtensionInterface
{
protected $classes = array();
protected $classMap = array();
private $classes = array();
private $classMap = array();
/**
* Gets the classes to cache.
@ -40,7 +40,7 @@ abstract class Extension implements ExtensionInterface
*
* @param array $classes An array of classes
*/
protected function addClassesToCompile(array $classes)
public function addClassesToCompile(array $classes)
{
$this->classes = array_merge($this->classes, $classes);
}

View File

@ -169,7 +169,7 @@ class FlattenException
}
}
protected function flattenArgs($args)
private function flattenArgs($args)
{
$result = array();
foreach ($args as $key => $value) {

View File

@ -18,8 +18,8 @@ namespace Symfony\Component\HttpKernel\Exception;
*/
class HttpException extends \RuntimeException implements HttpExceptionInterface
{
protected $statusCode;
protected $headers;
private $statusCode;
private $headers;
public function __construct($statusCode, $message = null, \Exception $previous = null, array $headers = array(), $code = 0)
{

View File

@ -28,7 +28,7 @@ use Symfony\Component\HttpKernel\HttpKernelInterface;
*/
class Esi
{
protected $contentTypes;
private $contentTypes;
/**
* Constructor.
@ -212,7 +212,7 @@ class Esi
*
* @return string The response content for the include.
*/
protected function handleEsiIncludeTag($attributes)
private function handleEsiIncludeTag($attributes)
{
$options = array();
preg_match_all('/(src|onerror|alt)="([^"]*?)"/', $attributes[1], $matches, PREG_SET_ORDER);

View File

@ -22,8 +22,8 @@ use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
*/
class EsiListener
{
protected $i;
protected $esi;
private $i;
private $esi;
/**
* Constructor.

View File

@ -28,9 +28,9 @@ use Symfony\Component\HttpFoundation\Response;
*/
class EsiResponseCacheStrategy implements EsiResponseCacheStrategyInterface
{
protected $cacheable = true;
protected $ttls = array();
protected $maxAges = array();
private $cacheable = true;
private $ttls = array();
private $maxAges = array();
/**
* Adds a Response.

View File

@ -26,12 +26,12 @@ use Symfony\Component\HttpFoundation\Response;
*/
class HttpCache implements HttpKernelInterface
{
protected $kernel;
protected $traces;
protected $store;
protected $request;
protected $esi;
protected $esiCacheStrategy;
private $kernel;
private $store;
private $request;
private $esi;
private $esiCacheStrategy;
private $traces;
/**
* Constructor.
@ -519,7 +519,7 @@ class HttpCache implements HttpKernelInterface
*
* @return Response A Response instance
*/
protected function restoreResponseBody(Request $request, Response $response)
private function restoreResponseBody(Request $request, Response $response)
{
if ('head' === strtolower($request->getMethod())) {
$response->setContent('');
@ -568,7 +568,7 @@ class HttpCache implements HttpKernelInterface
*
* @return Boolean true if the Request is private, false otherwise
*/
protected function isPrivateRequest(Request $request)
private function isPrivateRequest(Request $request)
{
foreach ($this->options['private_headers'] as $key) {
$key = strtolower(str_replace('HTTP_', '', $key));
@ -590,7 +590,7 @@ class HttpCache implements HttpKernelInterface
*
* @param string $event The event name
*/
protected function record(Request $request, $event)
private function record(Request $request, $event)
{
$path = $request->getPathInfo();
if ($qs = $request->getQueryString()) {

View File

@ -25,9 +25,9 @@ use Symfony\Component\HttpFoundation\HeaderBag;
*/
class Store implements StoreInterface
{
protected $root;
protected $keyCache;
protected $locks;
private $root;
private $keyCache;
private $locks;
/**
* Constructor.
@ -237,7 +237,7 @@ class Store implements StoreInterface
*
* @return Boolean true if the the two environments match, false otherwise
*/
protected function requestsMatch($vary, $env1, $env2)
private function requestsMatch($vary, $env1, $env2)
{
if (empty($vary)) {
return true;
@ -264,7 +264,7 @@ class Store implements StoreInterface
*
* @return array An array of data associated with the key
*/
protected function getMetadata($key)
private function getMetadata($key)
{
if (false === $entries = $this->load($key)) {
return array();
@ -298,7 +298,7 @@ class Store implements StoreInterface
*
* @return string The data associated with the key
*/
protected function load($key)
private function load($key)
{
$path = $this->getPath($key);
@ -311,7 +311,7 @@ class Store implements StoreInterface
* @param string $key The store key
* @param string $data The data to store
*/
protected function save($key, $data)
private function save($key, $data)
{
$path = $this->getPath($key);
if (!is_dir(dirname($path)) && false === @mkdir(dirname($path), 0777, true)) {
@ -348,7 +348,7 @@ class Store implements StoreInterface
*
* @return string A key for the given Request
*/
protected function getCacheKey(Request $request)
private function getCacheKey(Request $request)
{
if (isset($this->keyCache[$request])) {
return $this->keyCache[$request];
@ -364,7 +364,7 @@ class Store implements StoreInterface
*
* @return array An array of HTTP headers
*/
protected function persistRequest(Request $request)
private function persistRequest(Request $request)
{
return $request->headers->all();
}
@ -376,7 +376,7 @@ class Store implements StoreInterface
*
* @return array An array of HTTP headers
*/
protected function persistResponse(Response $response)
private function persistResponse(Response $response)
{
$headers = $response->headers->all();
$headers['X-Status'] = array($response->getStatusCode());
@ -390,7 +390,7 @@ class Store implements StoreInterface
* @param array $headers An array of HTTP headers for the Response
* @param string $body The Response body
*/
protected function restoreResponse($headers, $body = null)
private function restoreResponse($headers, $body = null)
{
$status = $headers['X-Status'][0];
unset($headers['X-Status']);

View File

@ -85,7 +85,7 @@ class HttpKernel implements HttpKernelInterface
* @throws \LogicException If one of the listener does not behave as expected
* @throws NotFoundHttpException When controller cannot be found
*/
protected function handleRaw(Request $request, $type = self::MASTER_REQUEST)
private function handleRaw(Request $request, $type = self::MASTER_REQUEST)
{
// request
$event = new GetResponseEvent($this, $request, $type);
@ -138,7 +138,7 @@ class HttpKernel implements HttpKernelInterface
*
* @throws \RuntimeException if the passed object is not a Response instance
*/
protected function filterResponse(Response $response, Request $request, $type)
private function filterResponse(Response $response, Request $request, $type)
{
$event = new FilterResponseEvent($this, $request, $type, $response);
@ -156,7 +156,7 @@ class HttpKernel implements HttpKernelInterface
*
* @return Response A Response instance
*/
protected function handleException(\Exception $e, $request, $type)
private function handleException(\Exception $e, $request, $type)
{
$event = new GetResponseForExceptionEvent($this, $request, $type, $e);
$this->dispatcher->dispatch(Events::onCoreException, $event);
@ -168,7 +168,7 @@ class HttpKernel implements HttpKernelInterface
return $this->filterResponse($event->getResponse(), $request, $type);
}
protected function varToString($var)
private function varToString($var)
{
if (is_object($var)) {
return sprintf('[object](%s)', get_class($var));

View File

@ -24,18 +24,18 @@ use Symfony\Component\HttpKernel\Log\LoggerInterface;
*/
class Profiler
{
protected $storage;
protected $collectors;
protected $logger;
protected $enabled;
protected $token;
protected $parent;
protected $data;
protected $ip;
protected $url;
protected $time;
protected $empty;
protected $children;
private $storage;
private $collectors;
private $logger;
private $enabled;
private $token;
private $parent;
private $data;
private $ip;
private $url;
private $time;
private $empty;
private $children;
/**
* Constructor.

View File

@ -21,7 +21,7 @@ use Symfony\Component\HttpFoundation\Response;
*/
class ResponseListener
{
protected $charset;
private $charset;
public function __construct($charset)
{

View File

@ -19,6 +19,8 @@ namespace Symfony\Component\Process;
* print $p->getOutput()."\n";
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
*/
class PhpProcess extends Process
{
@ -30,6 +32,8 @@ class PhpProcess extends Process
* @param array $env The environment variables
* @param integer $timeout The timeout in seconds
* @param array $options An array of options for proc_open
*
* @api
*/
public function __construct($script, $cwd = null, array $env = array(), $timeout = 60, array $options = array())
{
@ -38,10 +42,12 @@ class PhpProcess extends Process
/**
* Sets the path to the PHP binary to use.
*
* @api
*/
public function setPhpBinary($php)
{
$this->commandline = $php;
$this->setCommandLine($php);
}
/**
@ -51,11 +57,13 @@ class PhpProcess extends Process
* output available on STDOUT or STDERR
*
* @return integer The exit status code
*
* @api
*/
public function run($callback = null)
{
if (null === $this->commandline) {
$this->commandline = $this->getPhpBinary();
if (null === $this->getCommandLine()) {
$this->setCommandLine($this->getPhpBinary());
}
return parent::run($callback);
@ -68,7 +76,7 @@ class PhpProcess extends Process
*
* @throws \RuntimeException When defined PHP_PATH is not executable or not found
*/
static public function getPhpBinary()
private function getPhpBinary()
{
if (getenv('PHP_PATH')) {
if (!is_executable($php = getenv('PHP_PATH'))) {

View File

@ -16,19 +16,21 @@ namespace Symfony\Component\Process;
* start independent PHP processes.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
*/
class Process
{
protected $commandline;
protected $cwd;
protected $env;
protected $stdin;
protected $timeout;
protected $options;
protected $exitcode;
protected $status;
protected $stdout;
protected $stderr;
private $commandline;
private $cwd;
private $env;
private $stdin;
private $timeout;
private $options;
private $exitcode;
private $status;
private $stdout;
private $stderr;
/**
* Constructor.
@ -41,6 +43,8 @@ class Process
* @param array $options An array of options for proc_open
*
* @throws \RuntimeException When proc_open is not installed
*
* @api
*/
public function __construct($commandline, $cwd = null, array $env = array(), $stdin = null, $timeout = 60, array $options = array())
{
@ -75,6 +79,8 @@ class Process
* @return integer The exit status code
*
* @throws \RuntimeException When process can't be launch or is stopped
*
* @api
*/
public function run($callback = null)
{
@ -165,6 +171,8 @@ class Process
* to the run() method.
*
* @return string The process output
*
* @api
*/
public function getOutput()
{
@ -178,6 +186,8 @@ class Process
* to the run() method.
*
* @return string The process error output
*
* @api
*/
public function getErrorOutput()
{
@ -188,6 +198,8 @@ class Process
* Returns the exit code returned by the process.
*
* @return integer The exit status code
*
* @api
*/
public function getExitCode()
{
@ -198,6 +210,8 @@ class Process
* Checks if the process ended successfully.
*
* @return Boolean true if the process ended successfully, false otherwise
*
* @api
*/
public function isSuccessful()
{
@ -210,6 +224,8 @@ class Process
* It always returns false on Windows.
*
* @return Boolean
*
* @api
*/
public function hasBeenSignaled()
{
@ -222,6 +238,8 @@ class Process
* It is only meaningful if hasBeenSignaled() returns true.
*
* @return integer
*
* @api
*/
public function getTermSignal()
{
@ -234,6 +252,8 @@ class Process
* It always returns false on Windows.
*
* @return Boolean
*
* @api
*/
public function hasBeenStopped()
{
@ -246,6 +266,8 @@ class Process
* It is only meaningful if hasBeenStopped() returns true.
*
* @return integer
*
* @api
*/
public function getStopSignal()
{
@ -261,4 +283,14 @@ class Process
{
$this->stderr .= $line;
}
public function getCommandLine()
{
return $this->commandline;
}
public function setCommandLine($commandline)
{
$this->commandline = $commandline;
}
}

View File

@ -18,11 +18,11 @@ namespace Symfony\Component\Routing\Annotation;
*/
class Route
{
protected $pattern;
protected $name;
protected $requirements;
protected $options;
protected $defaults;
private $pattern;
private $name;
private $requirements;
private $options;
private $defaults;
/**
* Constructor.

View File

@ -18,7 +18,7 @@ namespace Symfony\Component\Routing\Annotation;
*/
class Routes
{
protected $routes;
private $routes;
/**
* Constructor.

View File

@ -18,11 +18,11 @@ namespace Symfony\Component\Routing;
*/
class CompiledRoute
{
protected $route;
protected $variables;
protected $tokens;
protected $staticPrefix;
protected $regex;
private $route;
private $variables;
private $tokens;
private $staticPrefix;
private $regex;
/**
* Constructor.

View File

@ -21,7 +21,7 @@ use Symfony\Component\Routing\Route;
*/
abstract class GeneratorDumper implements GeneratorDumperInterface
{
protected $routes;
private $routes;
/**
* Constructor.
@ -32,4 +32,9 @@ abstract class GeneratorDumper implements GeneratorDumperInterface
{
$this->routes = $routes;
}
public function getRoutes()
{
return $this->routes;
}
}

View File

@ -11,6 +11,8 @@
namespace Symfony\Component\Routing\Generator\Dumper;
use Symfony\Component\Routing\RouteCollection;
/**
* GeneratorDumperInterface is the interface that all generator dumper classes must implement.
*
@ -31,4 +33,11 @@ interface GeneratorDumperInterface
* @return string A PHP class representing the generator class
*/
function dump(array $options = array());
/**
* Gets the routes to dump.
*
* @return RouteCollection A RouteCollection instance
*/
function getRoutes();
}

View File

@ -47,10 +47,10 @@ class PhpGeneratorDumper extends GeneratorDumper
;
}
protected function addGenerator()
private function addGenerator()
{
$methods = array();
foreach ($this->routes->all() as $name => $route) {
foreach ($this->getRoutes()->all() as $name => $route) {
$compiledRoute = $route->compile();
$variables = str_replace("\n", '', var_export($compiledRoute->getVariables(), true));
@ -64,7 +64,7 @@ class PhpGeneratorDumper extends GeneratorDumper
$escapedName = str_replace('.', '__', $name);
$methods[] = <<<EOF
protected function get{$escapedName}RouteInfo()
private function get{$escapedName}RouteInfo()
{
\$defaults = \$this->defaults;
$defaultsMerge
@ -96,10 +96,10 @@ $methods
EOF;
}
protected function startClass($class, $baseClass)
private function startClass($class, $baseClass)
{
$routes = array();
foreach ($this->routes->all() as $name => $route) {
foreach ($this->getRoutes()->all() as $name => $route) {
$routes[] = " '$name' => true,";
}
$routes = implode("\n", $routes);
@ -115,7 +115,7 @@ EOF;
*/
class $class extends $baseClass
{
static protected \$declaredRouteNames = array(
static private \$declaredRouteNames = array(
$routes
);
@ -123,7 +123,7 @@ $routes
EOF;
}
protected function addConstructor()
private function addConstructor()
{
return <<<EOF
/**
@ -138,7 +138,7 @@ EOF;
EOF;
}
protected function endClass()
private function endClass()
{
return <<<EOF
}

View File

@ -21,10 +21,11 @@ use Symfony\Component\Routing\RouteCollection;
*/
class UrlGenerator implements UrlGeneratorInterface
{
protected $routes;
protected $defaults;
protected $context;
protected $cache;
private $routes;
private $cache;
/**
* Constructor.

View File

@ -62,7 +62,7 @@ class AnnotationGlobLoader extends AnnotationDirectoryLoader
*
* @return array An array of paths matching the glob pattern
*/
protected function getAbsolutePaths($glob)
private function getAbsolutePaths($glob)
{
$dirs = array();
foreach ($this->paths as $path) {

View File

@ -37,7 +37,7 @@ class PhpFileLoader extends FileLoader
$path = $this->locator->locate($file);
$collection = include $path;
$this->currentDir = dirname($path);
$this->setCurrentDir(dirname($path));
$collection->addResource(new FileResource($path));
return $collection;

View File

@ -56,7 +56,7 @@ class XmlFileLoader extends FileLoader
$resource = (string) $node->getAttribute('resource');
$type = (string) $node->getAttribute('type');
$prefix = (string) $node->getAttribute('prefix');
$this->currentDir = dirname($path);
$this->setCurrentDir(dirname($path));
$collection->addCollection($this->import($resource, ('' !== $type ? $type : null)), $prefix);
break;
default:
@ -167,7 +167,7 @@ class XmlFileLoader extends FileLoader
*
* @return array An array of libxml error strings
*/
protected function getXmlErrors()
private function getXmlErrors()
{
$errors = array();
foreach (libxml_get_errors() as $error) {

View File

@ -42,7 +42,7 @@ class YamlFileLoader extends FileLoader
{
$path = $this->locator->locate($file);
$config = $this->loadFile($path);
$config = Yaml::load($path);
$collection = new RouteCollection();
$collection->addResource(new FileResource($path));
@ -63,7 +63,7 @@ class YamlFileLoader extends FileLoader
if (isset($config['resource'])) {
$type = isset($config['type']) ? $config['type'] : null;
$prefix = isset($config['prefix']) ? $config['prefix'] : null;
$this->currentDir = dirname($path);
$this->setCurrentDir(dirname($path));
$collection->addCollection($this->import($config['resource'], $type), $prefix);
} elseif (isset($config['pattern'])) {
$this->parseRoute($collection, $name, $config, $path);
@ -113,18 +113,6 @@ class YamlFileLoader extends FileLoader
$collection->add($name, $route);
}
/**
* Loads a Yaml file.
*
* @param string $file A Yaml file path
*
* @return array
*/
protected function loadFile($file)
{
return Yaml::load($file);
}
/**
* Normalize route configuration.
*

View File

@ -43,7 +43,7 @@ class ApacheMatcherDumper extends MatcherDumper
$rules = array("# skip \"real\" requests\nRewriteCond %{REQUEST_FILENAME} -f\nRewriteRule .* - [QSA,L]");
$methodVars = array();
foreach ($this->routes->all() as $name => $route) {
foreach ($this->getRoutes()->all() as $name => $route) {
$compiledRoute = $route->compile();
// prepare the apache regex

View File

@ -21,7 +21,7 @@ use Symfony\Component\Routing\Route;
*/
abstract class MatcherDumper implements MatcherDumperInterface
{
protected $routes;
private $routes;
/**
* Constructor.
@ -32,4 +32,14 @@ abstract class MatcherDumper implements MatcherDumperInterface
{
$this->routes = $routes;
}
/**
* Gets the routes to dump.
*
* @return RouteCollection A RouteCollection instance
*/
public function getRoutes()
{
return $this->routes;
}
}

View File

@ -31,4 +31,11 @@ interface MatcherDumperInterface
* @return string A PHP class representing the matcher class
*/
function dump(array $options = array());
/**
* Gets the routes to match.
*
* @return RouteCollection A RouteCollection instance
*/
function getRoutes();
}

View File

@ -47,11 +47,11 @@ class PhpMatcherDumper extends MatcherDumper
;
}
protected function addMatcher()
private function addMatcher()
{
$code = array();
foreach ($this->routes->all() as $name => $route) {
foreach ($this->getRoutes()->all() as $name => $route) {
$compiledRoute = $route->compile();
$conditions = array();
@ -85,6 +85,8 @@ class PhpMatcherDumper extends MatcherDumper
$conditions = implode(' && ', $conditions);
$gotoname = 'not_'.preg_replace('/[^A-Za-z0-9_]/', '', $name);
$code[] = <<<EOF
// $name
if ($conditions) {
@ -95,7 +97,7 @@ EOF;
$code[] = <<<EOF
if (isset(\$this->context['method']) && !in_array(strtolower(\$this->context['method']), array('$req'))) {
\$allow = array_merge(\$allow, array('$req'));
goto not_$name;
goto $gotoname;
}
EOF;
}
@ -117,7 +119,7 @@ EOF
if ($req) {
$code[] = <<<EOF
not_$name:
$gotoname:
EOF;
}
@ -139,7 +141,7 @@ $code
EOF;
}
protected function startClass($class, $baseClass)
private function startClass($class, $baseClass)
{
return <<<EOF
<?php
@ -159,7 +161,7 @@ class $class extends $baseClass
EOF;
}
protected function addConstructor()
private function addConstructor()
{
return <<<EOF
/**
@ -174,7 +176,7 @@ EOF;
EOF;
}
protected function endClass()
private function endClass()
{
return <<<EOF
}

View File

@ -23,10 +23,11 @@ use Symfony\Component\Routing\RouteCollection;
*/
class UrlMatcher implements UrlMatcherInterface
{
protected $routes;
protected $defaults;
protected $context;
private $routes;
/**
* Constructor.
*

View File

@ -18,13 +18,13 @@ namespace Symfony\Component\Routing;
*/
class Route
{
protected $pattern;
protected $defaults;
protected $requirements;
protected $options;
protected $compiled;
private $pattern;
private $defaults;
private $requirements;
private $options;
private $compiled;
static protected $compilers = array();
static private $compilers = array();
/**
* Constructor.
@ -240,7 +240,7 @@ class Route
return $this->compiled = static::$compilers[$class]->compile($this);
}
protected function sanitizeRequirement($key, $regex)
private function sanitizeRequirement($key, $regex)
{
if (is_array($regex)) {
throw new \InvalidArgumentException(sprintf('Routing requirements must be a string, array given for "%s"', $key));

View File

@ -20,8 +20,8 @@ use Symfony\Component\Config\Resource\ResourceInterface;
*/
class RouteCollection
{
protected $routes;
protected $resources;
private $routes;
private $resources;
/**
* Constructor.

View File

@ -119,7 +119,7 @@ class RouteCompiler implements RouteCompilerInterface
*
* @throws \InvalidArgumentException When route can't be parsed
*/
protected function tokenize()
private function tokenize()
{
$this->tokens = array();
$buffer = $this->route->getPattern();
@ -221,7 +221,7 @@ class RouteCompiler implements RouteCompilerInterface
{
}
protected function getOptions()
private function getOptions()
{
$options = $this->route->getOptions();

View File

@ -22,14 +22,14 @@ use Symfony\Component\Config\ConfigCache;
*/
class Router implements RouterInterface
{
protected $matcher;
protected $generator;
protected $options;
protected $defaults;
protected $context;
protected $loader;
protected $collection;
protected $resource;
private $matcher;
private $generator;
private $options;
private $defaults;
private $context;
private $loader;
private $collection;
private $resource;
/**
* Constructor.

View File

@ -146,7 +146,7 @@ class AssetsHelper extends Helper implements AssetPackageInterface
*/
public function getUrl($path, $packageName = null)
{
if (false !== strpos($path, '://')) {
if (false !== strpos($path, '://') || 0 === strpos($path, '//')) {
return $path;
}

View File

@ -15,6 +15,8 @@ namespace Symfony\Component\Translation;
* IdentityTranslator does not translate anything.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
*/
class IdentityTranslator implements TranslatorInterface
{
@ -24,6 +26,8 @@ class IdentityTranslator implements TranslatorInterface
* Constructor.
*
* @param MessageSelector $selector The message selector for pluralization
*
* @api
*/
public function __construct(MessageSelector $selector)
{
@ -32,6 +36,8 @@ class IdentityTranslator implements TranslatorInterface
/**
* {@inheritdoc}
*
* @api
*/
public function setLocale($locale)
{
@ -39,6 +45,8 @@ class IdentityTranslator implements TranslatorInterface
/**
* {@inheritdoc}
*
* @api
*/
public function getLocale()
{
@ -46,6 +54,8 @@ class IdentityTranslator implements TranslatorInterface
/**
* {@inheritdoc}
*
* @api
*/
public function trans($id, array $parameters = array(), $domain = 'messages', $locale = null)
{
@ -54,6 +64,8 @@ class IdentityTranslator implements TranslatorInterface
/**
* {@inheritdoc}
*
* @api
*/
public function transChoice($id, $number, array $parameters = array(), $domain = 'messages', $locale = null)
{

View File

@ -17,11 +17,15 @@ use Symfony\Component\Translation\MessageCatalogue;
* ArrayLoader loads translations from a PHP array.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
*/
class ArrayLoader implements LoaderInterface
{
/**
* {@inheritdoc}
*
* @api
*/
public function load($resource, $locale, $domain = 'messages')
{

View File

@ -17,11 +17,15 @@ use Symfony\Component\Config\Resource\FileResource;
* CsvFileLoader loads translations from CSV files.
*
* @author Saša Stamenković <umpirsky@gmail.com>
*
* @api
*/
class CsvFileLoader extends ArrayLoader implements LoaderInterface
{
/**
* {@inheritdoc}
*
* @api
*/
public function load($resource, $locale, $domain = 'messages')
{

View File

@ -17,6 +17,8 @@ use Symfony\Component\Translation\MessageCatalogue;
* LoaderInterface is the interface implemented by all translation loaders.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
*/
interface LoaderInterface
{
@ -28,6 +30,8 @@ interface LoaderInterface
* @param string $domain The domain
*
* @return MessageCatalogue A MessageCatalogue instance
*
* @api
*/
function load($resource, $locale, $domain = 'messages');
}

View File

@ -17,11 +17,15 @@ use Symfony\Component\Config\Resource\FileResource;
* PhpFileLoader loads translations from PHP files returning an array of translations.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
*/
class PhpFileLoader extends ArrayLoader implements LoaderInterface
{
/**
* {@inheritdoc}
*
* @api
*/
public function load($resource, $locale, $domain = 'messages')
{

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