Skip to content

Instantly share code, notes, and snippets.

View sminnee's full-sized avatar

Sam Minnée sminnee

View GitHub Profile
@sminnee
sminnee / Job.php
Created June 18, 2015 14:14
JobAdmin part 1
<?php
class Job extends DataObject {
private static $db = array(
'Reference' => 'Varchar(5)',
'Position' => 'Varchar(255)',
'ClosingDate' => 'Date',
'Content' => 'Text',
'Status' => 'Enum("Draft, Published, Closed","Draft")',
);
@sminnee
sminnee / JobPage.php
Created June 18, 2015 14:46
Sortable job listings
<?php
class JobPage extends Page {
private static $description = "Lists available jobs";
}
class JobPage_Controller extends Page_Controller {
public function SortByDateLink() {
diff --git a/dev/Debug.php b/dev/Debug.php
index f063090..3c74807 100644
--- a/dev/Debug.php
+++ b/dev/Debug.php
@@ -524,7 +524,8 @@ function exceptionHandler($exception) {
$file = $exception->getFile();
$line = $exception->getLine();
$context = $exception->getTrace();
- return Debug::fatalHandler($errno, $message, $file, $line, $context);
+ Debug::fatalHandler($errno, $message, $file, $line, $context);
Project 1
Country Code is:
Project 2
Country Code is: +64
<?php
class Maybe {
private $value;
public function __construct($value) {
$this->value = $value;
}
static function from_value($value) {
<?php
class Maybe {
private $value;
public function __construct($value) {
$this->value = $value;
}
static function from_value($value) {
<?php
class Maybe {
private $value;
public function __construct($value) {
$this->value = $value;
}
static function for_value($value) {
diff --git a/tests/Composer/Test/Package/Version/VersionParserTest.php b/tests/Composer/Test/Package/Version/VersionParserTest.php
index 5654518..d30fa2e 100644
--- a/tests/Composer/Test/Package/Version/VersionParserTest.php
+++ b/tests/Composer/Test/Package/Version/VersionParserTest.php
@@ -243,6 +243,7 @@ public function simpleConstraints()
'not equal/2' => array('!=1.0.0', new VersionConstraint('!=', '1.0.0.0')),
'greater than' => array('>1.0.0', new VersionConstraint('>', '1.0.0.0')),
'lesser than' => array('<1.2.3.4', new VersionConstraint('<', '1.2.3.4-dev')),
+ 'lesser than stable'=> array('<1.2.3-stable', new VersionConstraint('<', '1.2.3.0')),
'less/eq than' => array('<=1.2.3', new VersionConstraint('<=', '1.2.3.0')),
diff --git a/src/Composer/Command/RequireCommand.php b/src/Composer/Command/RequireCommand.php
index 82401ff..eb761fd 100644
--- a/src/Composer/Command/RequireCommand.php
+++ b/src/Composer/Command/RequireCommand.php
@@ -150,8 +150,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
->setPreferDist($input->getOption('prefer-dist'))
->setDevMode($updateDevMode)
->setUpdate(true)
- ->setUpdateWhitelist(array_keys($requirements))
- ->setWhitelistDependencies($input->getOption('update-with-dependencies'))
diff --git a/src/Composer/Command/RequireCommand.php b/src/Composer/Command/RequireCommand.php
index 82401ff..eb761fd 100644
--- a/src/Composer/Command/RequireCommand.php
+++ b/src/Composer/Command/RequireCommand.php
@@ -150,8 +150,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
->setPreferDist($input->getOption('prefer-dist'))
->setDevMode($updateDevMode)
->setUpdate(true)
- ->setUpdateWhitelist(array_keys($requirements))
- ->setWhitelistDependencies($input->getOption('update-with-dependencies'))