conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "human", "value": "Add load average stat function\n" }, { "from": "gpt", "value": "<?php\n\nfunction collect_loadAvg() {\n\t$avg = sys_getloadavg();\n\t$avg = $avg[0].','.$avg[1].','.$avg[2];\n\treturn $avg;\n}\n\n?>" } ]
php
chosen
[ { "from": "human", "value": "Add a primary key to the password resets table\n" }, { "from": "gpt", "value": "<?php\n\nuse Illuminate\\Database\\Migrations\\Migration;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Support\\Facades\\Schema;\n\nclass AddPasswordResetsPk extends Mig...
php
chosen
[ { "from": "human", "value": "Create an Api that provide form type options in differents type (xml, json, html)\n" }, { "from": "gpt", "value": "<?php\n\nnamespace IDCI\\Bundle\\ExtraFormBundle\\Controller;\n\nuse Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller;\nuse Symfony\\Component\\...
php
chosen
[ { "from": "human", "value": "Add task to create new editable content\n" }, { "from": "gpt", "value": "<?php\n\nclass alohaCreateContentTask extends sfBaseTask\n{\n protected function configure()\n {\n $this->addOptions(array(\n new sfCommandOption('application', null, sfCommandOption::...
php
chosen
[ { "from": "system", "value": "Allow quoted search terms in docs command.\n" }, { "from": "human", "value": "<?php\n\nnamespace CommerceGuys\\Platform\\Cli\\Command;\n\nuse Symfony\\Component\\Console\\Input\\InputArgument;\nuse Symfony\\Component\\Console\\Input\\InputInterface;\nuse Symfony\\Co...
php
chosen
[ { "from": "human", "value": "Add unit tests for maximum matching" }, { "from": "gpt", "value": "<?php\n\nuse Fhaculty\\Graph\\Graph;\n\nuse Fhaculty\\Graph\\Algorithm\\MaximumMatching\\Flow;\n\nuse Fhaculty\\Graph\\Loader\\EdgeListBipartit;\n\nclass MMFlowTest extends PHPUnit_Framework_TestCase\...
php
chosen
[ { "from": "human", "value": "Add tests for new constraint\n" }, { "from": "gpt", "value": "<?php\n\nnamespace EmailChecker\\Tests\\Constraint;\n\nuse EmailChecker\\Constraints\\NotThrowawayEmail;\nuse EmailChecker\\Constraints\\NotThrowawayEmailValidator;\n\nclass NotThrowawayEmailValidatorTest ...
php
chosen
[ { "from": "human", "value": "Add ImagickAware eventlistener for output converter\n" }, { "from": "gpt", "value": "<?php\n/**\n * This file is part of the Imbo package\n *\n * (c) Christer Edvartsen <cogo@starzinger.net>\n *\n * For the full copyright and license information, please view the LICE...
php
chosen
[ { "from": "human", "value": "Add tests re Language values.\n" }, { "from": "gpt", "value": "<?php\n/**\n * Unit testing for Services_OpenStreetMap_LanguageValidator class.\n *\n * PHP Version 5\n *\n * @category Services\n * @package Services_OpenStreetMap\n * @subpackage UnitTesting\n * @a...
php
chosen
[ { "from": "human", "value": "Add client & user indexes to refresh tokens.\n\nThis will allow us to look up active refresh tokens by user or by\nclient.\n" }, { "from": "gpt", "value": "<?php\n\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migrations\\Migration;\n\nclas...
php
chosen
[ { "from": "human", "value": "Add missing 'email change complete' view\n" }, { "from": "gpt", "value": "@extends('layouts.master')\n\n@section('title', 'Change Email')\n@section('description', '')\n\n@section('contents')\n\n <div class=\"card\">\n <div class=\"card__body card__body--pad...
php
chosen
[ { "from": "human", "value": "Add tests for Required rule\n" }, { "from": "gpt", "value": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Albert221\\Validation\\Rule;\n\nuse PHPUnit\\Framework\\TestCase;\n\nclass RequiredTest extends TestCase\n{\n public function testVerdict()\n {\n ...
php
chosen
[ { "from": "human", "value": "Add tests for user object.\n" }, { "from": "gpt", "value": "<?php\n\nnamespace AppBundle\\Tests\\Connections;\n\nuse Symfony\\Bundle\\FrameworkBundle\\Test\\KernelTestCase;\n\n/**\n * @file\n * Project: orcid\n * File: RepositoryTest.php\n */\nclass UserTest extends ...
php
chosen
[ { "from": "human", "value": "Add indexes on attachements as well\n" }, { "from": "gpt", "value": "<?php\n\nuse Movim\\Migration;\nuse Illuminate\\Database\\Schema\\Blueprint;\n\nclass AddCategoryAndRelIndexesToAttachments extends Migration\n{\n public function up()\n {\n $this->sche...
php
chosen
[ { "from": "human", "value": "Add trait for some helpful method for the model.\n" }, { "from": "gpt", "value": "<?php namespace Reshadman\\EloquentFaster;\n\n/**\n * Class MutatorCacheableTrait\n * @package Reshadman\\EloquentFaster\n * @property array mutatorCache\n*/\ntrait MutatorCacheableTrai...
php
chosen
[ { "from": "human", "value": "Add unittest to check that specific files exist in repo\n" }, { "from": "gpt", "value": "<?php\n\nclass RepoFilesExistsTest extends \\PHPUnit_Framework_TestCase\n{\n private $requiredFiles;\n\n protected function setUp()\n {\n $this->requiredFiles = [...
php
chosen
[ { "from": "human", "value": "Add passing test for child flushing\n" }, { "from": "gpt", "value": "<?hh\n\nclass :test:verbatim-root extends :x:element {\n attribute XHPRoot root @required;\n\n protected function render(): XHPRoot {\n return $this->:root;\n }\n}\n\nclass :test:verbatim-root...
php
chosen
[ { "from": "human", "value": "Add PHPUnit test for Stripe_CardError\n" }, { "from": "gpt", "value": "<?php\n\nclass Stripe_CardErrorTest extends Stripe_TestCase\n{\n public function testDecline()\n {\n self::authorizeFromEnv();\n\n $card = array(\n 'number' => '4000000000000002',\n ...
php
chosen
[ { "from": "system", "value": "BAP-11412: Implement enable/disable operations\n- CS Fix\n" }, { "from": "human", "value": "<?php\n\nnamespace Oro\\Bundle\\TranslationBundle\\Helper;\n\nuse Oro\\Bundle\\ConfigBundle\\Config\\ConfigManager;\nuse Oro\\Bundle\\LocaleBundle\\DependencyInjection\\Confi...
php
chosen
[ { "from": "human", "value": "Add the Google Calendar starter application.\n\n" }, { "from": "gpt", "value": "<?php\nrequire_once '../../src/apiClient.php';\nrequire_once '../../src/contrib/apiCalendarService.php';\nsession_start();\n\n$client = new apiClient();\n$client->setApplicationName(\"Goo...
php
chosen
[ { "from": "human", "value": "Add omikron tests for higher order functions\n" }, { "from": "gpt", "value": "<?php return\n\nwithin('higher order',\n describe('compose',\n it('yields identity when composing nothing', function() {\n $identity = compose();\n\n return ...
php
chosen
[ { "from": "human", "value": "Add the membership request page\n" }, { "from": "gpt", "value": "<!DOCTYPE HTML>\n<html lang=\"it\">\n<head>\n <meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n ...
php
chosen
[ { "from": "human", "value": "Add code snippet PHP file" }, { "from": "gpt", "value": "<?php\n\n/*\n * Drop this into your theme or plugin folder to disable the default 'post' content type.\n * Themes: Add the following at the top of your functions.php file.\n * Plugins: Add the following at the ...
php
chosen
[ { "from": "human", "value": "Add migration to change state name\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Application\\Migrations;\n\nuse SimplyTestable\\BaseMigrationsBundle\\Migration\\EntityModificationMigration,\n Doctrine\\DBAL\\Schema\\Schema,\n SimplyTestable\\ApiBundle\\E...
php
chosen
[ { "from": "human", "value": "Define a base model that allows access to services\n" }, { "from": "gpt", "value": "<?php\n\nnamespace MicroAPI;\n\nuse MicroAPI\\Injector;\n\nclass Model\n{\n /**\n * Access a service from the injector\n *\n * @param $serviceName - The name of the ser...
php
chosen
[ { "from": "human", "value": "Add unit test for routes\n" }, { "from": "gpt", "value": "<?php\n\nnamespace FD\\PrivateMessageBundle\\Tests\\Routing;\n\nuse Symfony\\Component\\Config\\FileLocator;\nuse Symfony\\Component\\Routing\\Loader\\YamlFileLoader;\nuse Symfony\\Component\\Routing\\RouteCol...
php
chosen
[ { "from": "human", "value": "Add a command to generate a new admin user\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Wanjee\\Shuwee\\AdminBundle\\Command;\n\nuse Symfony\\Bundle\\FrameworkBundle\\Command\\ContainerAwareCommand;\nuse Symfony\\Component\\Console\\Input\\InputArgument;\nuse ...
php
chosen
[ { "from": "human", "value": "Create a new trait containing redirectTo method\n" }, { "from": "gpt", "value": "<?php\n\nnamespace app\\utilities;\n\ntrait RedirectTrait\n{\n\tprotected function redirectTo($location)\n\t{\n\t\tif(!empty($location)) {\n\t\t\theader(\"Location: {$location}\");\n\t\t...
php
chosen
[ { "from": "human", "value": "Add tests for more views method\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Frozzare\\Tests\\Digster;\n\nuse Frozzare\\Digster\\Digster;\n\nclass View_Test extends \\WP_UnitTestCase {\n\n public function test_nest() {\n $loader = new \\Twig_Loader_A...
php
chosen
[ { "from": "system", "value": "Use cURL adapter for reading feeds\n" }, { "from": "human", "value": "<?php\n\nnamespace GithubFeed;\n\nclass Module\n{\n public function getAutoloaderConfig()\n {\n return array(\n 'Zend\\Loader\\ClassMapAutoloader' => array(\n ...
php
chosen
[ { "from": "human", "value": "Implement basic order api class\n\nOnly one method for now -- just to make sure it works\n" }, { "from": "gpt", "value": "<?php\n/**\n * Created by IntelliJ IDEA.\n * User: mduncan\n * Date: 8/13/15\n * Time: 3:58 PM\n */\n\nnamespace Fulfillment\\OMS\\Api;\n\n\nuse ...
php
chosen
[ { "from": "human", "value": "Add a default model controller\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Staq\\Core\\Data\\Stack\\Controller;\n\nclass Model extends Model\\__Parent {\n\n\n\n\t/*************************************************************************\n\t ATTRIBUTES\n\t ***...
php
chosen
[ { "from": "human", "value": "Revert \"Remove not required tests\"\n\nThis reverts commit 62b6c4028c63b95244e9e13706d78d9eec6b93e2.\n" }, { "from": "gpt", "value": "<?php\n\nrequire_once ('PHPUnit/Framework/TestCase.php');\n\nclass Services_Paymill_TestBase extends PHPUnit_Framework_TestCase\n{\n...
php
chosen
[ { "from": "human", "value": "Add always up to date updater.\n" }, { "from": "gpt", "value": "<?PHP\n\nheader('Content-type: text/plain');\n\nif (!isset($_REQUEST['data'])) {\n header('Location: http://www.dmdirc.com/');\n die('error This subdomain is for automated requests only');\n}\n\n$_CHANNE...
php
chosen
[ { "from": "human", "value": "[develop-2.1.1] +: Add adyen_event collection model to be able to query collections instead of querying the DB directly\n" }, { "from": "gpt", "value": "<?php\n\nclass Adyen_Payment_Model_Mysql4_Adyen_Event_Collection extends Mage_Core_Model_Resource_Db_Collection_Ab...
php
chosen
[ { "from": "human", "value": "Add NIST recommendations as password strength adapter." }, { "from": "gpt", "value": "<?php\n/**\n * Portable PHP password hashing framework.\n *\n * @package PHPass\n * @subpackage Strength\n * @category Cryptography\n * @author Ryan Chouinard <rchouinard at gmail.c...
php
chosen
[ { "from": "human", "value": "Add php script to print server details.\n" }, { "from": "gpt", "value": "<?php\n $title = 'Server Details'\n?>\n\n<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <title><?php echo $title ?></title>\n <meta charset=\"UTF-8\">\n </head>\n <body...
php
chosen
[ { "from": "human", "value": "Add descriptions to some existing settings.\n" }, { "from": "gpt", "value": "<?php\n\nuse Illuminate\\Database\\Migrations\\Migration;\nuse Illuminate\\Database\\Schema\\Blueprint;\n\nclass AddDescriptionsToExistingSettings extends Migration {\n\n /**\n * Run the ...
php
chosen
[ { "from": "human", "value": "Test of the phpsecRand class." }, { "from": "gpt", "value": "<?php\nrequire_once 'phpsec.class.php';\nrequire_once 'phpsec/phpsec.rand.php';\n\nclass RandTest extends PHPUnit_Framework_TestCase {\n public function setUp(){\n }\n public function tearDown(){\n }\n ...
php
chosen
[ { "from": "human", "value": "Add base exception for aop\n" }, { "from": "gpt", "value": "<?php\n/**\n * Go! OOP&AOP PHP framework\n *\n * @copyright Copyright 2011, Lissachenko Alexander <lisachenko.it@gmail.com>\n * @license http://www.opensource.org/licenses/mit-license.php The MIT L...
php
chosen
[ { "from": "human", "value": "Add fields to Payments table to store payment processor-related metadata\n" }, { "from": "gpt", "value": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migrations\\Migration;\n\nclass AddPa...
php
chosen
[ { "from": "human", "value": "Extend base migration to allow data imports\n" }, { "from": "gpt", "value": "<?php\n\nclass OEMigration extends CDbMigration {\n\n\t/**\n\t * Initialise tables with default data\n\t * Filenames must to be in the format \"nn_tablename.csv\", where nn is the processing...
php
chosen
[ { "from": "human", "value": "No-Plat: Add playback base role update script\n" }, { "from": "gpt", "value": "<?php\n/**\n * @package deployment\n * @subpackage Quasar.roles_and_permissions\n */\n\n$script = realpath(dirname(__FILE__) . '/../../../../') . '/alpha/scripts/utils/permissions/addPermi...
php
chosen
[ { "from": "human", "value": "Remove all rights other than technical and admin\n\ngit-svn-id: fac53d8b196e0ef1c2775236b39a8c3227ab71b5@1317 528793b8-127e-4309-9901-b74759c7208d\n" }, { "from": "gpt", "value": "<?php\n// Remove all usertypes other than technical and admin\n\n/**\n * DbPatch makes ...
php
chosen
[ { "from": "system", "value": "Make sure the Shindig library is set on the include path, for the hack to work\n\ngit-svn-id: e77a8db410fc7e53f700994083f7980387c3a882@686 528793b8-127e-4309-9901-b74759c7208d\n" }, { "from": "human", "value": "<?php\n/**\n * SURFconext EngineBlock\n *\n * LICENSE\n...
php
chosen
[ { "from": "human", "value": "Add one more class to the grade thing.\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Tsugi\\Grades;\n\n\nuse \\Tsugi\\UI\\Table;\nuse \\Tsugi\\Core\\LTIX;\n\nclass UI {\n\n public static function gradeTable($GRADE_DETAIL_CLASS) {\n global $CFG, $OUTPU...
php
chosen
[ { "from": "human", "value": "Add missing utility class to setup SM\n" }, { "from": "gpt", "value": "<?php\n/*\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF ...
php
chosen
[ { "from": "human", "value": "Switch to utf8mb4_bin collation to resolve media import issues.\n\n" }, { "from": "gpt", "value": "<?php declare(strict_types = 1);\n\nnamespace Migration;\n\nuse Doctrine\\DBAL\\Migrations\\AbstractMigration;\nuse Doctrine\\DBAL\\Schema\\Schema;\n\n/**\n * Auto-gene...
php
chosen
[ { "from": "human", "value": "Test toegevoegd: wordt een form-element aangemaakt?\n" }, { "from": "gpt", "value": "<?php\nclass Webenq_Test_Model_QuestionnaireQuestionTest extends Webenq_Test_Model\n{\n public function testFormElementIsGenerated()\n {\n $qq = new Webenq_Model_Questio...
php
chosen
[ { "from": "human", "value": "Enlarge classname database field to 64\n" }, { "from": "gpt", "value": "<?php\n/**\n * Database migration class\n *\n * @author David Vandemaele <david@tigron.be>\n */\n\nnamespace Skeleton\\I18n;\n\nuse \\Skeleton\\Database\\Database;\n\nclass Migration_20181204_161...
php
chosen
[ { "from": "human", "value": "Routing: Add unit test for Router\n" }, { "from": "gpt", "value": "<?php\n\nuse Enlighten\\Http\\Request;\nuse Enlighten\\Routing\\Route;\nuse Enlighten\\Routing\\Router;\n\nclass RouterTest extends PHPUnit_Framework_TestCase\n{\n public function testBlankRouter()...
php
chosen
[ { "from": "human", "value": "Test the new Sabre\\VObject\\Writer class.\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Sabre\\VObject;\n\nclass WriterTest extends \\PHPUnit_Framework_TestCase {\n\n function getComponent() {\n\n $data = \"BEGIN:VCALENDAR\\r\\nEND:VCALENDAR\";\n ...
php
chosen
[ { "from": "human", "value": "Add missing test for CreateTaskEvent\n" }, { "from": "gpt", "value": "<?php\n\n/**\n * This file is part of tenside/core.\n *\n * (c) Christian Schiffler <c.schiffler@cyberspectrum.de>\n *\n * For the full copyright and license information, please view the LICENSE\n ...
php
chosen
[ { "from": "human", "value": "Add migration for creating a user role column in users table\n" }, { "from": "gpt", "value": "<?php\n\nuse yii\\db\\Migration;\n\n/**\n * Handles adding role to table `user`.\n */\nclass m160902_150209_add_role_to_user extends Migration\n{\n /**\n * @inheritdo...
php
chosen
[ { "from": "human", "value": "Add basic get, post and delete support\n\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Mikkelson;\n\nclass ClubhouseException extends \\Exception {}\n\nclass Clubhouse {\n\n /** @var string users Clubhouse API token */\n protected $token;\n\n /** @var ...
php
chosen
[ { "from": "human", "value": "Switch collation to utf8mb4_general_ci to allow case insensitivity\n\n" }, { "from": "gpt", "value": "<?php declare(strict_types=1);\n\nnamespace App\\Entity\\Migration;\n\nuse Doctrine\\DBAL\\Schema\\Schema;\nuse Doctrine\\Migrations\\AbstractMigration;\n\n/**\n * A...
php
chosen
[ { "from": "human", "value": "Add authentication test for token bearer authorization\n" }, { "from": "gpt", "value": "<?php\n\nnamespace ActiveCollab\\Authentication\\Test;\n\nuse ActiveCollab\\Authentication\\Adapter\\AuthorizationBearer;\nuse ActiveCollab\\Authentication\\AuthenticatedUser\\Rep...
php
chosen
[ { "from": "human", "value": "Add test for Zend Stratigility\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Rougin\\Slytherin\\Test\\Middleware\\Auryn;\n\nuse Zend\\Stratigility\\MiddlewarePipe;\n\nuse Rougin\\Slytherin\\Middleware\\Stratigility\\Middleware;\n\nuse PHPUnit_Framework_TestCase...
php
chosen
[ { "from": "human", "value": "Fix - Basic class to abstract the idea." }, { "from": "gpt", "value": "<?php\n\n\tclass JqGrid {\n\t\t\n\t\tpublic function __construct(){}\n\t\t\n\t\tpublic function saveColumnsPosition()\n\t\t{\n\t\t\t$field = $_POST['field'];\n\t\t\t$columns = $_POST['cols'];\n\t\...
php
chosen
[ { "from": "human", "value": "Add unit test for artist constructor\n" }, { "from": "gpt", "value": "<?php\n\nnamespace HansOtt\\Lastify\\Test;\n\nuse HansOtt\\Lastify\\TrackInfo\\Artist;\nuse InvalidArgumentException;\nuse PHPUnit_Framework_TestCase;\n\nclass ArtistTest extends PHPUnit_Framework_...
php
chosen
[ { "from": "human", "value": "Add new migration in messageboard module\n" }, { "from": "gpt", "value": "<?php\n/**\n * add columns to users\n *\n */\nnamespace Fuel\\Migrations;\nclass Add_users_deleted_column\n{\n\tfunction up()\n\t{\n\n\t\tif(!\\DBUtil::field_exists('users', array('deleted')))\...
php
chosen
[ { "from": "human", "value": "Add plugin to List stuff\n" }, { "from": "gpt", "value": "<?php\n/*\nPlugin Name: Lists in a Shortcode\nDescription: MU Plugin that lets you get lists of posts, pages and sites in a network\nAuthor: Jude Rosario\nAuthor URI: http://premium.wpmudev.org/\nVersion: 1.1\...
php
chosen
[ { "from": "human", "value": "Add fields for Leeds test objects test data\n" }, { "from": "gpt", "value": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migrations\\Migration;\n\nclass AddLeedsTestsToMachineSurveydataTa...
php
chosen
[ { "from": "human", "value": "Upgrade helper for version 0.8.1, which is officially out today\n" }, { "from": "gpt", "value": "<?php\n\t// PONGSOCKET TWEET ARCHIVE\n\t// Upgrade tables to 0.8.1\n\t\n\trequire \"inc/preheader.php\";\n\t$db->query(\"ALTER TABLE `\".DTP.\"tweets` CHANGE `tweetid` `t...
php
chosen
[ { "from": "human", "value": "Add unit test for auth event.\n" }, { "from": "gpt", "value": "<?php\n\nuse Carbon\\Carbon;\nuse Northstar\\Models\\User;\n\nclass AuthenticationEventsTest extends TestCase\n{\n /** @test */\n public function testSuccessfulLoginEvent()\n {\n /** @var ...
php
chosen
[ { "from": "human", "value": "Use a SPLMaxHeap to efficiently sort items by volume\n" }, { "from": "gpt", "value": "<?php\n/**\n * Box packing (3D bin packing, knapsack problem)\n * @package BoxPacker\n * @author Doug Wright\n */\n namespace DVDoug\\BoxPacker;\n\n /**\n * List of items to be ...
php
chosen
[ { "from": "human", "value": "Create a default Automation Group\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Concrete\\Core\\User\\Group\\AutomatedGroup;\nuse Concrete\\Core\\User\\User;\nuse Concrete\\Core\\User\\Group\\GroupAutomationController;\n\nclass DefaultAutomation extends GroupAu...
php
chosen
[ { "from": "human", "value": "Add test for Guzzle Oauth bug patch\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Desk\\Test\\System;\n\nuse Desk\\Test\\Helper\\SystemTestCase;\nuse Guzzle\\Http\\Message\\RequestFactory;\nuse Guzzle\\Http\\QueryAggregator\\CommaAggregator;\nuse Guzzle\\Plugin...
php
chosen
[ { "from": "human", "value": "Add user average & sum tests.\n" }, { "from": "gpt", "value": "<?php\n\nclass UserRatingsTest extends RateableTestCase\n{\n\n public function testUserAverageRating()\n {\n Rating::unguard();\n\n $post1 = Post::find(1);\n $post2 = Post::find...
php
chosen
[ { "from": "system", "value": "Validate issuer even if none in payload\n" }, { "from": "human", "value": "<?php\n\nnamespace Emarref\\Jwt\\Verification;\n\nuse Emarref\\Jwt\\Claim;\nuse Emarref\\Jwt\\Encoding;\nuse Emarref\\Jwt\\Exception\\VerificationException;\nuse Emarref\\Jwt\\HeaderParameter...
php
chosen
[ { "from": "human", "value": "Add tcp/79 to rwhodb gateway\n" }, { "from": "gpt", "value": "#!/usr/bin/php\n<?php\n\nconst DB_PATH = \"/home/grawity/lib/cgi-data/rwho.db\";\n\n// read user input\n\n$input = fgets(STDIN);\nif (!strlen($input)) {\n\tdie(\"Error.\\n\");\n}\n$input = rtrim($input);\n...
php
chosen
[ { "from": "human", "value": "BB-8979: Add test for SegmentQueryConverter\n - added test\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Oro\\Bundle\\SegmentBundle\\Tests\\Functional\\Query;\n\nuse Oro\\Bundle\\SegmentBundle\\Model\\RestrictionSegmentProxy;\nuse Oro\\Bundle\\SegmentBundle\\Qu...
php
chosen
[ { "from": "human", "value": "Add an interface for models having sub-model" }, { "from": "gpt", "value": "<?php\n\n/**\n * Created by PhpStorm.\n * User: elbachirnouni\n * Date: 06/09/2016\n * Time: 23:09\n */\ninterface NOrderableParentRecordInterface {\n\n\t/**\n\t * Return false if this elemen...
php
chosen
[ { "from": "system", "value": "Load custom environment file if available\n" }, { "from": "human", "value": "<?php\n\nnamespace Illuminate\\Foundation\\Bootstrap;\n\nuse Dotenv\\Dotenv;\nuse Dotenv\\Exception\\InvalidPathException;\nuse Illuminate\\Contracts\\Foundation\\Application;\n\nclass Dete...
php
chosen
[ { "from": "human", "value": "Create tests for Logout command\n" }, { "from": "gpt", "value": "<?php\r\n\r\nnamespace AdobeConnectClient\\Tests\\Commands;\r\n\r\nuse AdobeConnectClient\\Commands\\Logout;\r\n\r\nclass LogoutTest extends TestCommandBase\r\n{\r\n /**\r\n * return string\r\n ...
php
chosen
[ { "from": "human", "value": "Add a Project Variable Get command.\n" }, { "from": "gpt", "value": "<?php\nnamespace Platformsh\\Cli\\Command\\Project\\Variable;\n\nuse Platformsh\\Cli\\Command\\CommandBase;\nuse Platformsh\\Cli\\Console\\AdaptiveTableCell;\nuse Platformsh\\Cli\\Util\\Table;\nuse ...
php
chosen
[ { "from": "human", "value": "Add getter for language to text class\n" }, { "from": "gpt", "value": "<?php\n/**\n * This class should represent the whole text\n *\n * @author newloki\n */\nnamespace \\Language\\Text;\nuse \\Language\\Languages\\LanguagesAbstract\n \\Language\\Word;\n\nclass Te...
php
chosen
[ { "from": "human", "value": "Add unit tests for the bulk query and bulk action\n\n" }, { "from": "gpt", "value": "<?php\n\nclass BulkQueryTest extends \\Codeception\\TestCase\\Test\n{\n\n use \\Codeception\\Specify;\n\n const BULK_SIZE = 5;\n\n /**\n * @var \\UnitTester\n */\n ...
php
chosen
[ { "from": "human", "value": "Add primary ID and make user_id and browser_id columns nullable in article_aggregated_views table\n" }, { "from": "gpt", "value": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migrations\\...
php
chosen
[ { "from": "human", "value": "Add PHP code style fixer\n" }, { "from": "gpt", "value": "<?php\n\n/*\n * This file is part of the Active Collab project.\n *\n * (c) A51 doo <info@activecollab.com>. All rights reserved.\n */\n\n$header = <<<EOF\nThis file is part of the Shade project.\n\n(c) A51 do...
php
chosen
[ { "from": "human", "value": "Add unit test for HttpStreamWrapperResponse\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Marein\\Nchan\\HttpAdapter;\n\nuse Marein\\Nchan\\Exception\\NchanException;\nuse PHPUnit\\Framework\\TestCase;\n\nclass HttpStreamWrapperResponseTest extends TestCase\n{\...
php
chosen
[ { "from": "human", "value": "Add script to generate the C structs containing the app's elements data." }, { "from": "gpt", "value": "#!/usr/bin/env php\n<?php\n\n/**\n * Generate C structs from a JSON file of chemical elements\n *\n * To run with the default data:\n * ./generate-structs.php...
php
chosen
[ { "from": "human", "value": "Add some tests for syndication jobs\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Tests\\Feature;\n\nuse Tests\\TestCase;\nuse App\\Services\\NoteService;\nuse App\\Jobs\\SyndicateToTwitter;\nuse App\\Jobs\\SyndicateToFacebook;\nuse Illuminate\\Support\\Facades...
php
chosen
[ { "from": "human", "value": "Add tests for Book class\n" }, { "from": "gpt", "value": "<?php\n\nini_set('display_errors', 1);\nini_set('display_startup_errors', 1);\nerror_reporting(E_ALL);\n\nrequire_once __DIR__ . '/../vendor/autoload.php';\n\nuse Biblys\\Data\\Book;\n\nclass testBook extends ...
php
chosen
[ { "from": "human", "value": "Add a category to group requirements for fork\n" }, { "from": "gpt", "value": "<?php\n\nnamespace ForkCMS\\Bundle\\InstallerBundle\\Requirement;\n\nfinal class RequirementCategory\n{\n /** @var string */\n private $name;\n\n /** @var Requirement[] */\n pr...
php
chosen
[ { "from": "human", "value": "Add dummy test to avoid Travis builds to fail.\n\n(Real tests should come pretty soon though.)\n" }, { "from": "gpt", "value": "<?php\nnamespace Afonso\\Soapi\\Tests;\n\nuse PHPUnit_Framework_TestCase;\n\nclass SoapiTest extends PHPUnit_Framework_TestCase\n{\n pub...
php
chosen
[ { "from": "human", "value": "Test for Repeater component implemented\n" }, { "from": "gpt", "value": "<?php\nnamespace Nayjest\\ViewComponents\\Test\\Components;\n\nuse Nayjest\\ViewComponents\\Components\\Container;\nuse Nayjest\\ViewComponents\\Components\\Text;\nuse Nayjest\\ViewComponents\\C...
php
chosen
[ { "from": "human", "value": "Check Login code actually added this time around.\n" }, { "from": "gpt", "value": "<?php\n\n\tfunction checkLogin($userID, $pass_hash, $linkID)\n\t{\n\t\t$userclause = mysql_real_escape_string(\"$userID\");\n\t\t$passclause = mysql_real_escape_string(\"$pass_hash\");...
php
chosen
[ { "from": "human", "value": "Add an interface to define custom form and load/save handlers\n" }, { "from": "gpt", "value": "<?php\n\nnamespace DDPro\\Admin\\Config;\n\n/**\n * Interface ModelServiceInterface\n *\n * This interface is used when a model config wants to provide a custom form with a...
php
chosen
[ { "from": "human", "value": "Add component for queuing messages.\n\nAll incomming messages are kept in memory. As soon as the queu reaches the\npre-configured size of 100 messages, the current list of messages is send.\n\nYou can reconfigure the queu size of the component by sending a message to\nthe `size`...
php
chosen
[ { "from": "human", "value": "Allow to get taxons from specific taxonomy\n" }, { "from": "gpt", "value": "<?php\n\n/*\n * This file is part of the Sylius package.\n *\n * (c) Paweł Jędrzejewski\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distr...
php
chosen
[ { "from": "human", "value": "Move array helper methods to a utility class.\n" }, { "from": "gpt", "value": "<?php\n\nnamespace UWaterlooAPI\\Utils;\n\nclass ArrayUtil\n{\n public static function getVal(array $array, ...$keys)\n {\n foreach ($keys as $key) {\n $array = $ar...
php
chosen
[ { "from": "human", "value": "Add a migration to add new columns to the posts table\n" }, { "from": "gpt", "value": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migrations\\Migration;\n\nclass AddColumnsToCategorizePo...
php
chosen
[ { "from": "human", "value": "Create the base test class\n" }, { "from": "gpt", "value": "<?php namespace Arcanedev\\Support\\Tests;\n\nabstract class TestCase extends \\PHPUnit_Framework_TestCase\n{\n /* -----------------------------------------------------------------------------------------...
php
chosen
[ { "from": "human", "value": "Add skeleton for combined poller" }, { "from": "gpt", "value": "<?php\n\nnamespace Sockets;\n\n// modelled closely after React\\EventLoop\\StreamSelectLoop\nclass SelectPoller\n{\n private $loop;\n private $pollInterval = 0.01;\n private $tid = null;\n pr...
php
chosen
[ { "from": "human", "value": "Change data field for sprint snapshots to longText.\n" }, { "from": "gpt", "value": "<?php\n\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migrations\\Migration;\n\nclass ChangeDataTypeToLongtext extends Migration {\n\n\t/**\n\t * Run the m...
php
chosen
[ { "from": "human", "value": "Isolate notifier in dedicated provider\n" }, { "from": "gpt", "value": "<?php\nnamespace Loct\\Pinger\\Provider;\n\nuse \\Loct\\Pinger\\Notifier\\MailgunNotifier;\nuse \\Mailgun\\Mailgun;\nuse \\Pimple\\Container;\nuse \\Pimple\\ServiceProviderInterface;\n\nclass Not...
php
chosen
[ { "from": "human", "value": "Add a test for ETag generation\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Kibo\\Phast\\HTTP;\n\n\nclass ResponseTest extends \\PHPUnit_Framework_TestCase {\n\n public function testETagGeneration() {\n $res = new Response();\n\n $empty = $res...
php
chosen
[ { "from": "system", "value": "Update tests now that ShellHelper throws a generic exception.\n" }, { "from": "human", "value": "<?php\n\nnamespace CommerceGuys\\Platform\\Cli\\Tests;\n\nuse CommerceGuys\\Platform\\Cli\\Helper\\ShellHelper;\n\nclass ShellHelperTest extends \\PHPUnit_Framework_Test...
php
chosen
[ { "from": "human", "value": "FIX Added task for updating FileSize and Dimensions\n" }, { "from": "gpt", "value": "<?php\n\n/**\n * Post upgrade, update filesizes for assets uploaded prior to FileSize capture\n *\n * @author marcus\n */\nclass UpdateFileSizeTask extends BuildTask\n{\n public f...
php
chosen