Skip to content

Instantly share code, notes, and snippets.

@benlumley
Created November 30, 2012 18:29
Show Gist options
  • Save benlumley/4177589 to your computer and use it in GitHub Desktop.
Save benlumley/4177589 to your computer and use it in GitHub Desktop.
Sample diff
diff --git a/lib/Doctrine/Common/Annotations/AnnotationReader.php b/lib/Doctrine/Common/Annotations/AnnotationReader.php
index 286e7d0..5a1d253 100644
--- a/lib/Doctrine/Common/Annotations/AnnotationReader.php
+++ b/lib/Doctrine/Common/Annotations/AnnotationReader.php
@@ -68,8 +68,7 @@ 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,
- 'package_version' => true,
+ 'ingroup' => true, 'code' => true, 'endcode' => true
);
/**
diff --git a/lib/Doctrine/Common/Cache/FileCache.php b/lib/Doctrine/Common/Cache/FileCache.php
index da650b4..4435975 100644
--- a/lib/Doctrine/Common/Cache/FileCache.php
+++ b/lib/Doctrine/Common/Cache/FileCache.php
@@ -102,7 +102,7 @@ abstract class FileCache extends CacheProvider
*/
protected function doDelete($id)
{
- return @unlink($this->getFilename($id));
+ return unlink($this->getFilename($id));
}
/**
@@ -116,7 +116,7 @@ abstract class FileCache extends CacheProvider
$iterator = new \RegexIterator($iterator, $pattern);
foreach ($iterator as $name => $file) {
- @unlink($name);
+ unlink($name);
}
return true;
diff --git a/lib/Doctrine/Common/Collections/ArrayCollection.php b/lib/Doctrine/Common/Collections/ArrayCollection.php
index 7c2b13e..a075c08 100644
--- a/lib/Doctrine/Common/Collections/ArrayCollection.php
+++ b/lib/Doctrine/Common/Collections/ArrayCollection.php
@@ -496,5 +496,15 @@ class ArrayCollection implements Collection, Selectable
return new static($filtered);
}
+
+ /**
+ * Return the expression builder.
+ *
+ * @return ExpressionBuilder
+ */
+ public function expr()
+ {
+ return new ExpressionBuilder();
+ }
}
diff --git a/lib/Doctrine/Common/Collections/Criteria.php b/lib/Doctrine/Common/Collections/Criteria.php
index 3b05549..cb4d89f 100644
--- a/lib/Doctrine/Common/Collections/Criteria.php
+++ b/lib/Doctrine/Common/Collections/Criteria.php
@@ -41,11 +41,6 @@ class Criteria
const DESC = 'DESC';
/**
- * @var \Doctrine\Common\Collections\ExpressionBuilder
- */
- private static $expressionBuilder;
-
- /**
* @var \Doctrine\Common\Collections\Expr\Expression
*/
private $expression;
@@ -76,19 +71,6 @@ class Criteria
}
/**
- * 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
*
* @param Expression $expression
diff --git a/lib/Doctrine/Common/Collections/Selectable.php b/lib/Doctrine/Common/Collections/Selectable.php
index 675d6ea..d5543c1 100644
--- a/lib/Doctrine/Common/Collections/Selectable.php
+++ b/lib/Doctrine/Common/Collections/Selectable.php
@@ -44,5 +44,12 @@ interface Selectable
* @return Collection
*/
function matching(Criteria $criteria);
+
+ /**
+ * Return the expression builder.
+ *
+ * @return \Doctrine\Common\Collections\ExpressionBuilder
+ */
+ function expr();
}
diff --git a/lib/Doctrine/Common/Version.php b/lib/Doctrine/Common/Version.php
index c510f38..cca4894 100644
--- a/lib/Doctrine/Common/Version.php
+++ b/lib/Doctrine/Common/Version.php
@@ -36,7 +36,7 @@ class Version
/**
* Current Doctrine Version
*/
- const VERSION = '2.3.1-DEV';
+ const VERSION = '2.3.0';
/**
* Compares a Doctrine version with the current one.
diff --git a/lib/vendor/doctrine-build-common b/lib/vendor/doctrine-build-common
index 609b4dc..a6ad7a3 160000
--- a/lib/vendor/doctrine-build-common
+++ b/lib/vendor/doctrine-build-common
@@ -1 +1 @@
-Subproject commit 609b4dc50c88eaa6a3278b2e099e5c515cfb68dd
+Subproject commit a6ad7a3ef8aa9ec0959a9493bb37ddffdb4a0484
diff --git a/tests/Doctrine/Tests/Common/Collections/CollectionTest.php b/tests/Doctrine/Tests/Common/Collections/CollectionTest.php
index 280efa3..58979fa 100644
--- a/tests/Doctrine/Tests/Common/Collections/CollectionTest.php
+++ b/tests/Doctrine/Tests/Common/Collections/CollectionTest.php
@@ -212,7 +212,7 @@ class CollectionTest extends \Doctrine\Tests\DoctrineTestCase
{
$this->fillMatchingFixture();
- $col = $this->_coll->matching(new Criteria(Criteria::expr()->eq("foo", "bar")));
+ $col = $this->_coll->matching(new Criteria($this->_coll->expr()->eq("foo", "bar")));
$this->assertInstanceOf('Doctrine\Common\Collections\Collection', $col);
$this->assertNotSame($col, $this->_coll);
$this->assertEquals(1, count($col));
diff --git a/tests/Doctrine/Tests/Common/Collections/CriteriaTest.php b/tests/Doctrine/Tests/Common/Collections/CriteriaTest.php
index 03fb6ca..61febb4 100644
--- a/tests/Doctrine/Tests/Common/Collections/CriteriaTest.php
+++ b/tests/Doctrine/Tests/Common/Collections/CriteriaTest.php
@@ -74,9 +74,4 @@ class CriteriaTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(array("foo" => "ASC"), $criteria->getOrderings());
}
-
- public function testExpr()
- {
- $this->assertInstanceOf('Doctrine\Common\Collections\ExpressionBuilder', Criteria::expr());
- }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment