Commit 90a48a9f authored by webchick's avatar webchick

Issue #1764342 by Rob Loach: Update Symfony and Doctrine to RC2.

parent c69d5cf9
......@@ -3,35 +3,35 @@
"packages": [
{
"package": "doctrine/common",
"version": "2.3.0-RC1"
"version": "2.3.0-RC2"
},
{
"package": "symfony/class-loader",
"version": "v2.1.0-RC1"
"version": "v2.1.0-RC2"
},
{
"package": "symfony/dependency-injection",
"version": "v2.1.0-RC1"
"version": "v2.1.0-RC2"
},
{
"package": "symfony/event-dispatcher",
"version": "v2.1.0-RC1"
"version": "v2.1.0-RC2"
},
{
"package": "symfony/http-foundation",
"version": "v2.1.0-RC1"
"version": "v2.1.0-RC2"
},
{
"package": "symfony/http-kernel",
"version": "v2.1.0-RC1"
"version": "v2.1.0-RC2"
},
{
"package": "symfony/routing",
"version": "v2.1.0-RC1"
"version": "v2.1.0-RC2"
},
{
"package": "symfony/yaml",
"version": "v2.1.0-RC1"
"version": "v2.1.0-RC2"
},
{
"package": "twig/twig",
......
# SimpleTest breaks with the following files, so avoid adding them.
symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1-1.php
symfony/class-loader/Symfony/Component/ClassLoader/Tests/Fixtures/php5.4/traits.php
symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services11.php
<?php
// autoload.php generated by Composer
if (!class_exists('Composer\\Autoload\\ClassLoader', false)) {
require __DIR__ . '/composer' . '/ClassLoader.php';
}
return call_user_func(function() {
$loader = new \Composer\Autoload\ClassLoader();
$composerDir = __DIR__ . '/composer';
require_once __DIR__ . '/composer' . '/autoload_real.php';
$map = require $composerDir . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
$loader->add($namespace, $path);
}
$classMap = require $composerDir . '/autoload_classmap.php';
if ($classMap) {
$loader->addClassMap($classMap);
}
$loader->register();
return $loader;
});
return ComposerAutoloaderInit::getLoader();
......@@ -201,5 +201,7 @@ public function findFile($class)
if ($this->useIncludePath && $file = stream_resolve_include_path($classPath)) {
return $file;
}
$this->classMap[$class] = false;
}
}
<?php
// autoload_namespace.php generated by Composer
// autoload_namespaces.php generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
......
<?php
// autoload_real.php generated by Composer
require __DIR__ . '/ClassLoader.php';
class ComposerAutoloaderInit
{
public static function getLoader()
{
$loader = new \Composer\Autoload\ClassLoader();
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
$loader->add($namespace, $path);
}
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
$loader->addClassMap($classMap);
}
$loader->register();
return $loader;
}
}
......@@ -3,7 +3,7 @@
"name": "twig/twig",
"version": "v1.8.3",
"version_normalized": "1.8.3.0",
"time": "2012-06-18 15:48:16",
"time": "2012-06-18 19:48:16",
"source": {
"type": "git",
"url": "git://github.com/fabpot/Twig.git",
......@@ -55,19 +55,19 @@
},
{
"name": "symfony/class-loader",
"version": "v2.1.0-RC1",
"version_normalized": "2.1.0.0-RC1",
"version": "v2.1.0-RC2",
"version_normalized": "2.1.0.0-RC2",
"target-dir": "Symfony/Component/ClassLoader",
"time": "2012-07-15 17:13:51",
"time": "2012-08-27 15:51:49",
"source": {
"type": "git",
"url": "https://github.com/symfony/ClassLoader",
"reference": "v2.1.0-RC1"
"reference": "v2.1.0-RC2"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/ClassLoader/zipball/v2.1.0-RC1",
"reference": "v2.1.0-RC1",
"url": "https://github.com/symfony/ClassLoader/zipball/v2.1.0-RC2",
"reference": "v2.1.0-RC2",
"shasum": ""
},
"require": {
......@@ -110,19 +110,19 @@
},
{
"name": "symfony/dependency-injection",
"version": "v2.1.0-RC1",
"version_normalized": "2.1.0.0-RC1",
"version": "v2.1.0-RC2",
"version_normalized": "2.1.0.0-RC2",
"target-dir": "Symfony/Component/DependencyInjection",
"time": "2012-08-03 19:44:30",
"time": "2012-08-28 07:54:42",
"source": {
"type": "git",
"url": "https://github.com/symfony/DependencyInjection",
"reference": "v2.1.0-RC1"
"reference": "v2.1.0-RC2"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/DependencyInjection/zipball/v2.1.0-RC1",
"reference": "v2.1.0-RC1",
"url": "https://github.com/symfony/DependencyInjection/zipball/v2.1.0-RC2",
"reference": "v2.1.0-RC2",
"shasum": ""
},
"require": {
......@@ -133,8 +133,8 @@
"symfony/config": "2.1.*"
},
"suggest": {
"symfony/yaml": "v2.1.0-RC1",
"symfony/config": "v2.1.0-RC1"
"symfony/yaml": "v2.1.0-RC2",
"symfony/config": "v2.1.0-RC2"
},
"type": "library",
"extra": {
......@@ -168,21 +168,97 @@
}
}
},
{
"name": "doctrine/common",
"version": "2.3.0-RC2",
"version_normalized": "2.3.0.0-RC2",
"time": "2012-08-29 14:06:32",
"source": {
"type": "git",
"url": "https://github.com/doctrine/common",
"reference": "2.3.0-RC2"
},
"dist": {
"type": "zip",
"url": "https://github.com/doctrine/common/zipball/2.3.0-RC2",
"reference": "2.3.0-RC2",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.3.x-dev"
}
},
"installation-source": "dist",
"license": [
"MIT"
],
"authors": [
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com",
"homepage": "http://www.jwage.com/",
"role": null
},
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com",
"homepage": null,
"role": null
},
{
"name": "Roman Borschel",
"email": "roman@code-factory.org",
"homepage": null,
"role": null
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de",
"homepage": null,
"role": null
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com",
"homepage": "http://jmsyst.com",
"role": "Developer of wrapped JMSSerializerBundle"
}
],
"description": "Common Library for Doctrine projects",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"collections",
"spl",
"eventmanager",
"annotations",
"persistence"
],
"autoload": {
"psr-0": {
"Doctrine\\Common": "lib/"
}
}
},
{
"name": "symfony/http-foundation",
"version": "v2.1.0-RC1",
"version_normalized": "2.1.0.0-RC1",
"version": "v2.1.0-RC2",
"version_normalized": "2.1.0.0-RC2",
"target-dir": "Symfony/Component/HttpFoundation",
"time": "2012-08-04 16:18:38",
"time": "2012-08-22 13:48:41",
"source": {
"type": "git",
"url": "https://github.com/symfony/HttpFoundation",
"reference": "v2.1.0-RC1"
"reference": "v2.1.0-RC2"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/HttpFoundation/zipball/v2.1.0-RC1",
"reference": "v2.1.0-RC1",
"url": "https://github.com/symfony/HttpFoundation/zipball/v2.1.0-RC2",
"reference": "v2.1.0-RC2",
"shasum": ""
},
"require": {
......@@ -223,19 +299,19 @@
},
{
"name": "symfony/event-dispatcher",
"version": "v2.1.0-RC1",
"version_normalized": "2.1.0.0-RC1",
"version": "v2.1.0-RC2",
"version_normalized": "2.1.0.0-RC2",
"target-dir": "Symfony/Component/EventDispatcher",
"time": "2012-07-20 06:18:14",
"time": "2012-08-22 13:48:41",
"source": {
"type": "git",
"url": "https://github.com/symfony/EventDispatcher",
"reference": "v2.1.0-RC1"
"reference": "v2.1.0-RC2"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/EventDispatcher/zipball/v2.1.0-RC1",
"reference": "v2.1.0-RC1",
"url": "https://github.com/symfony/EventDispatcher/zipball/v2.1.0-RC2",
"reference": "v2.1.0-RC2",
"shasum": ""
},
"require": {
......@@ -245,8 +321,8 @@
"symfony/dependency-injection": "2.1.*"
},
"suggest": {
"symfony/dependency-injection": "v2.1.0-RC1",
"symfony/http-kernel": "v2.1.0-RC1"
"symfony/dependency-injection": "v2.1.0-RC2",
"symfony/http-kernel": "v2.1.0-RC2"
},
"type": "library",
"extra": {
......@@ -282,19 +358,19 @@
},
{
"name": "symfony/http-kernel",
"version": "v2.1.0-RC1",
"version_normalized": "2.1.0.0-RC1",
"version": "v2.1.0-RC2",
"version_normalized": "2.1.0.0-RC2",
"target-dir": "Symfony/Component/HttpKernel",
"time": "2012-08-04 16:32:21",
"time": "2012-08-28 08:00:18",
"source": {
"type": "git",
"url": "https://github.com/symfony/HttpKernel",
"reference": "v2.1.0-RC1"
"reference": "v2.1.0-RC2"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/HttpKernel/zipball/v2.1.0-RC1",
"reference": "v2.1.0-RC1",
"url": "https://github.com/symfony/HttpKernel/zipball/v2.1.0-RC2",
"reference": "v2.1.0-RC2",
"shasum": ""
},
"require": {
......@@ -313,12 +389,12 @@
"symfony/routing": "2.1.*"
},
"suggest": {
"symfony/browser-kit": "v2.1.0-RC1",
"symfony/class-loader": "v2.1.0-RC1",
"symfony/config": "v2.1.0-RC1",
"symfony/console": "v2.1.0-RC1",
"symfony/dependency-injection": "v2.1.0-RC1",
"symfony/finder": "v2.1.0-RC1"
"symfony/browser-kit": "v2.1.0-RC2",
"symfony/class-loader": "v2.1.0-RC2",
"symfony/config": "v2.1.0-RC2",
"symfony/console": "v2.1.0-RC2",
"symfony/dependency-injection": "v2.1.0-RC2",
"symfony/finder": "v2.1.0-RC2"
},
"type": "library",
"extra": {
......@@ -354,19 +430,19 @@
},
{
"name": "symfony/routing",
"version": "v2.1.0-RC1",
"version_normalized": "2.1.0.0-RC1",
"version": "v2.1.0-RC2",
"version_normalized": "2.1.0.0-RC2",
"target-dir": "Symfony/Component/Routing",
"time": "2012-07-31 21:14:37",
"time": "2012-08-28 07:54:42",
"source": {
"type": "git",
"url": "https://github.com/symfony/Routing",
"reference": "v2.1.0-RC1"
"reference": "v2.1.0-RC2"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/Routing/zipball/v2.1.0-RC1",
"reference": "v2.1.0-RC1",
"url": "https://github.com/symfony/Routing/zipball/v2.1.0-RC2",
"reference": "v2.1.0-RC2",
"shasum": ""
},
"require": {
......@@ -379,8 +455,8 @@
"doctrine/common": ">=2.2,<2.4-dev"
},
"suggest": {
"symfony/config": "v2.1.0-RC1",
"symfony/yaml": "v2.1.0-RC1",
"symfony/config": "v2.1.0-RC2",
"symfony/yaml": "v2.1.0-RC2",
"doctrine/common": ">=2.2,<2.4-dev"
},
"type": "library",
......@@ -417,19 +493,19 @@
},
{
"name": "symfony/yaml",
"version": "v2.1.0-RC1",
"version_normalized": "2.1.0.0-RC1",
"version": "v2.1.0-RC2",
"version_normalized": "2.1.0.0-RC2",
"target-dir": "Symfony/Component/Yaml",
"time": "2012-07-15 17:13:51",
"time": "2012-08-22 13:48:41",
"source": {
"type": "git",
"url": "https://github.com/symfony/Yaml",
"reference": "v2.1.0-RC1"
"reference": "v2.1.0-RC2"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/Yaml/zipball/v2.1.0-RC1",
"reference": "v2.1.0-RC1",
"url": "https://github.com/symfony/Yaml/zipball/v2.1.0-RC2",
"reference": "v2.1.0-RC2",
"shasum": ""
},
"require": {
......@@ -466,81 +542,5 @@
"Symfony\\Component\\Yaml": ""
}
}
},
{
"name": "doctrine/common",
"version": "2.3.0-RC1",
"version_normalized": "2.3.0.0-RC1",
"time": "2012-07-29 10:44:28",
"source": {
"type": "git",
"url": "https://github.com/doctrine/common",
"reference": "2.3.0-RC1"
},
"dist": {
"type": "zip",
"url": "https://github.com/doctrine/common/zipball/2.3.0-RC1",
"reference": "2.3.0-RC1",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.3.x-dev"
}
},
"installation-source": "dist",
"license": [
"MIT"
],
"authors": [
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com",
"homepage": "http://www.jwage.com/",
"role": null
},
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com",
"homepage": null,
"role": null
},
{
"name": "Roman Borschel",
"email": "roman@code-factory.org",
"homepage": null,
"role": null
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de",
"homepage": null,
"role": null
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com",
"homepage": "https://github.com/schmittjoh",
"role": null
}
],
"description": "Common Library for Doctrine projects",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"collections",
"spl",
"eventmanager",
"annotations",
"persistence"
],
"autoload": {
"psr-0": {
"Doctrine\\Common": "lib/"
}
}
}
]
{
"name": "doctrine/common",
"type": "library","version":"2.3.0-RC1",
"type": "library","version":"2.3.0-RC2",
"description": "Common Library for Doctrine projects",
"keywords": ["collections", "spl", "eventmanager", "annotations", "persistence"],
"homepage": "http://www.doctrine-project.org",
......
......@@ -68,7 +68,8 @@ class AnnotationReader implements Reader
'codeCoverageIgnore' => true, 'codeCoverageIgnoreStart' => true, 'codeCoverageIgnoreEnd' => true,
'Required' => true, 'Attribute' => true, 'Attributes' => true,
'Target' => true, 'SuppressWarnings' => true,
'ingroup' => true, 'code' => true, 'endcode' => true
'ingroup' => true, 'code' => true, 'endcode' => true,
'package_version' => true,
);
/**
......
......@@ -496,15 +496,5 @@ public function matching(Criteria $criteria)
return new static($filtered);
}
/**
* Return the expression builder.
*
* @return ExpressionBuilder
*/
public function expr()
{
return new ExpressionBuilder();
}
}
......@@ -20,6 +20,7 @@
namespace Doctrine\Common\Collections;
use Doctrine\Common\Collections\Expr\Expression;
use Doctrine\Common\Collections\Expr\CompositeExpression;
/**
* Criteria for filtering Selectable collections.
......@@ -39,6 +40,11 @@ class Criteria
*/
const DESC = 'DESC';
/**
* @var \Doctrine\Common\Collections\ExpressionBuilder
*/
private static $expressionBuilder;
/**
* @var \Doctrine\Common\Collections\Expr\Expression
*/
......@@ -59,6 +65,29 @@ class Criteria
*/
private $maxResults;
/**
* Creates an instance of the class.
*
* @return Criteria
*/
public static function create()
{
return new static();
}
/**
* Return the expression builder.
*
* @return \Doctrine\Common\Collections\ExpressionBuilder
*/
public static function expr()
{
if (self::$expressionBuilder === null) {
self::$expressionBuilder = new ExpressionBuilder();
}
return self::$expressionBuilder;
}
/**
* Construct new criteria
*
......@@ -87,6 +116,46 @@ public function where(Expression $expression)
return $this;
}
/**
* Append the where expression to evaluate when this criteria is searched for
* using an AND with previous expression.
*
* @param Expression
* @return Criteria
*/
public function andWhere(Expression $expression)
{
if ($this->expression === null) {
return $this->where($expression);
}
$this->expression = new CompositeExpression(CompositeExpression::TYPE_AND, array(
$this->expression, $expression
));
return $this;
}
/**
* Append the where expression to evaluate when this criteria is searched for
* using an OR with previous expression.
*
* @param Expression
* @return Criteria
*/
public function orWhere(Expression $expression)
{
if ($this->expression === null) {
return $this->where($expression);
}
$this->expression = new CompositeExpression(CompositeExpression::TYPE_OR, array(
$this->expression, $expression
));
return $this;
}
/**
* Get the expression attached to this criteria.
*
......