conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "human", "value": "Add media_blocks pivot table to efficiently attach media to fields (in blocks).\n" }, { "from": "gpt", "value": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migrations\\Migration;\n\nclas...
php
chosen
[ { "from": "human", "value": "Add first index of test suite.\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Mimic\\Test;\n\nuse PHPUnit_Framework_TestCase;\nuse Mimic\\Functional as F;\n\n/**\n * Unit Test for dropFirst Mimic library function.\n *\n * @since 0.1.0\n */\nclass FirstIndexOfFun...
php
chosen
[ { "from": "human", "value": "Add unit tests for Response\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Tests\\Bulb;\n\nuse Yeelight\\Bulb\\Exceptions\\BulbCommandException;\nuse Yeelight\\Bulb\\Response;\n\nclass ResponseTest extends \\PHPUnit_Framework_TestCase\n{\n public function tes...
php
chosen
[ { "from": "human", "value": "Add phpunit test for Stripe_Subscription\n" }, { "from": "gpt", "value": "<?php\n\nclass Stripe_SubscriptionTest extends Stripe_TestCase\n{\n\n public function testCreateUpdateCancel()\n {\n $planID = 'gold-' . self::randomString();\n self::retrieveOrCreatePl...
php
chosen
[ { "from": "human", "value": "[FEATURE] Add a repository class for Git-Repositories\n" }, { "from": "gpt", "value": "<?php\nnamespace Mrimann\\CoMo\\Domain\\Repository;\n\n/* *\n * This script belongs to the TYPO3 Flow package...
php
chosen
[ { "from": "human", "value": "Add an example using the new RequestHandler\n" }, { "from": "gpt", "value": "<?php\n\nuse \\Bruno\\AdobeConnectClient\\API;\nuse \\Bruno\\AdobeConnectClient\\RequestHandler;\n\n// If want change the cURL Options\n$requestHandler = new RequestHandler(\n 'https://us...
php
chosen
[ { "from": "human", "value": "Add tests for file loader\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Becklyn\\AssetsBundle\\tests\\File;\n\nuse Becklyn\\AssetsBundle\\Entry\\EntryNamespaces;\nuse Becklyn\\AssetsBundle\\File\\FileLoader;\nuse Becklyn\\AssetsBundle\\Processor\\ProcessorRegis...
php
chosen
[ { "from": "human", "value": "Add example referenced from Collection::bulkWrite()\n" }, { "from": "gpt", "value": "<?php\nrequire __DIR__ . \"/\" . \"../vendor/autoload.php\";\n\nfunction dumpWriteResults(MongoDB\\WriteResult $result) {\n printf(\"Inserted %d documents, upserted %d, updated %d...
php
chosen
[ { "from": "human", "value": "Add Search Part AJAX feature\n" }, { "from": "gpt", "value": "<?php\nheader(\"Cache-Control: no-cache, must-revalidate\");\nheader('Content-type: application/json');\n\nif ( ! isset($_POST[\"value\"]) ) {\n\t\n\t/* One or more required inputs aren't set. */\n\texit(\...
php
chosen
[ { "from": "human", "value": "Add the district extractor test\n" }, { "from": "gpt", "value": "<?php\n\n/*\n * This file is part of Bens Penhorados, an undergraduate capstone project.\n *\n * (c) Fábio Santos <ffsantos92@gmail.com>\n *\n * For the full copyright and license information, please vi...
php
chosen
[ { "from": "human", "value": "Add example: list vs set lookup\n" }, { "from": "gpt", "value": "<?php\n\nrequire_once __DIR__.'/../vendor/autoload.php';\n\n/*\n * Compare lookup in a list (O(n)) vs lookup in a set (O(1))\n */\n\nuse mre\\PHPench\\BenchmarkInterface;\n\nabstract class AbstractBench...
php
chosen
[ { "from": "human", "value": "Add a factory trait for tracking cached objects\n" }, { "from": "gpt", "value": "<?php\n\nnamespace JPB\\WP\\Dev;\n\nuse function wp_list_filter;\n\ntrait FactoryTrait {\n\n\tprotected $_cached = [];\n\n\t/**\n\t * Retrieve an object from a cached slot within the fac...
php
chosen
[ { "from": "human", "value": "Add interface for another client to retrieve a valid client.\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Dan\\Shopify;\n\n/**\n * Interface ShopifyApiInterface\n */\ninterface HasShopifyClientInterface\n{\n /** @return string */\n public function getSho...
php
chosen
[ { "from": "human", "value": "Add constraint class for header not contains\n" }, { "from": "gpt", "value": "<?php\n/**\n * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)\n * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)\n *\n * Licensed under The MIT Lic...
php
chosen
[ { "from": "human", "value": "Revert \"Revert \"Including language Portuguese Brazil\"\"\n\nThis reverts commit 5ce0123660faa559f67d62d259561620a067078a.\n" }, { "from": "gpt", "value": "<?php\n\nreturn [\n 'aries' => 'Áries',\n 'taurus' => 'Touro',\n 'gemini' => 'Gêmeos',\n 'cancer' ...
php
chosen
[ { "from": "human", "value": "[Controller] Create controller for account with methods to open and process an account\n" }, { "from": "gpt", "value": "<?php\n\nnamespace HCLabs\\Bills\\Controller;\n\nuse HCLabs\\Bills\\Command\\Bus\\CommandBusInterface;\nuse Symfony\\Component\\Form\\FormFactoryIn...
php
chosen
[ { "from": "human", "value": "[Tests] Add a base class for Bolt\\Composer\\Action tests" }, { "from": "gpt", "value": "<?php\nnamespace Bolt\\Tests\\Composer\\Action;\n\nuse Bolt\\Tests\\BoltUnitTest;\n\nabstract class ActionUnitTest extends BoltUnitTest\n{\n public function setUp()\n {\n ...
php
chosen
[ { "from": "system", "value": "Use class name instead of object to reference constant (compile error fix on some versions of php)\n" }, { "from": "human", "value": "<?\r\n\r\n// callback controller\r\nclass Bitpay_Bitcoins_IndexController extends Mage_Core_Controller_Front_Action {\n\t\r\n\t// bi...
php
chosen
[ { "from": "human", "value": "Add title and description columns to snippets table migration\n" }, { "from": "gpt", "value": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migrations\\Migration;\n\nclass AddTitleAndDescr...
php
chosen
[ { "from": "human", "value": "Add migration for AccountPlan entity\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Application\\Migrations;\n\nuse SimplyTestable\\BaseMigrationsBundle\\Migration\\BaseMigration,\n Doctrine\\DBAL\\Schema\\Schema;\n\n/**\n * Auto-generated Migration: Please m...
php
chosen
[ { "from": "human", "value": "Add unit test for JS::removeJsComments()\n" }, { "from": "gpt", "value": "<?php\n/**\n * JsMinifyTest.php\n * @author Dylan Ferris\n * @link https://github.com/acerix\n */\n\nnamespace rmrevin\\yii\\minify\\tests\\unit\\view;\n\nuse rmrevin\\yii\\minify\\components\\...
php
chosen
[ { "from": "human", "value": "Test that you need to be logged in to see the tags index action\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Backend\\Modules\\Blog\\Tests\\Action;\n\nuse Backend\\Modules\\Tags\\DataFixtures\\LoadTagsModulesTags;\nuse Backend\\Modules\\Tags\\DataFixtures\\Loa...
php
chosen
[ { "from": "human", "value": "Refactor hprose server and client based on swoole\n" }, { "from": "gpt", "value": "<?php\n/**********************************************************\\\n| |\n| hprose ...
php
chosen
[ { "from": "human", "value": "Add list dataset (sample) script.\n" }, { "from": "gpt", "value": "<?php\n/**\n * List dataset(s)\n * Written by Ryan Yonzon <hello@ryanyonzon.com>\n */\n\nset_include_path(\"vendor/google/apiclient/src/\" . PATH_SEPARATOR . get_include_path());\n\nrequire_once 'Goog...
php
chosen
[ { "from": "human", "value": "Add results by task type controller routing test\n" }, { "from": "gpt", "value": "<?php\n\nnamespace SimplyTestable\\WebClientBundle\\Tests\\Controller\\View\\Test\\Results\\ByTaskType\\IndexAction;\n\nuse SimplyTestable\\WebClientBundle\\Tests\\Controller\\Base\\Rou...
php
chosen
[ { "from": "human", "value": "Add Example of Filtering Devices By Name\n" }, { "from": "gpt", "value": "<?php\n\nrequire_once('../src/ColoCrossing.php');\n\n$colocrossing_client = new ColoCrossing_Client();\n$colocrossing_client->setAPIToken('YOUR_API_TOKEN');\n\n?>\n\n<h1>List Devices Like Name<...
php
chosen
[ { "from": "human", "value": "Create the default application layer\n" }, { "from": "gpt", "value": "<?php\n/**\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n *\n * @author Stephane HULARD <s.hulard@chstudio.fr>\n ...
php
chosen
[ { "from": "human", "value": "Test if QueryConstraintGroup is valid\n" }, { "from": "gpt", "value": "<?php\n\nclass SqlQuerySelectDataConstraintGroupTest extends MidgardTest\n{\n protected $select = null;\n protected $mgd = null;\n\n public function setUp()\n {\n $this->mgd = m...
php
chosen
[ { "from": "human", "value": "Add index on column sent_time\n\nAdding an index on columns sent_time speeds up the deletion of sent rows" }, { "from": "gpt", "value": "<?php\nuse yii\\db\\Migration;\nuse nterms\\mailqueue\\MailQueue;\nclass m170221_090302_add_sent_time_index extends Migration\n{\n...
php
chosen
[ { "from": "human", "value": "Add unittest to check that specific files exist in repo\n" }, { "from": "gpt", "value": "<?php\n\nnamespace SendGrid;\n\n\nclass FilesExistTest extends \\PHPUnit_Framework_TestCase\n{\n private $requiredFiles;\n\n protected function setUp()\n {\n $thi...
php
chosen
[ { "from": "human", "value": "Add a pfSense interactive php shell for developers.\n" }, { "from": "gpt", "value": "#!/usr/local/bin/php -f\n \n<?php\n\necho \"Starting the pfSense shell system\";\n\necho \".\";\nrequire(\"globals.inc\");\n$g['booting'] = true;\nrequire(\"functions.inc\");\necho \...
php
chosen
[ { "from": "human", "value": "Add test: /admin/entries/create, Post new entry.\n" }, { "from": "gpt", "value": "<?php\ndeclare(strict_types=1);\n\nnamespace Fc2blog\\Tests\\App\\Controller\\Admin\\Entries;\n\nuse Fc2blog\\Model\\EntriesModel;\nuse Fc2blog\\Tests\\Helper\\ClientTrait;\nuse Fc2blog...
php
chosen
[ { "from": "human", "value": "[Blog] Add basic functional tests for the blog module.\n" }, { "from": "gpt", "value": "<?php\n/**\n * This file is part of the Clastic package.\n *\n * (c) Dries De Peuter <dries@nousefreak.be>\n * For the full copyright and license information, please view the LICE...
php
chosen
[ { "from": "human", "value": "Add visible flag to artists table" }, { "from": "gpt", "value": "<?php\n\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migrations\\Migration;\n\nclass AddVisibleToArtistsTable extends Migration\n{\n /**\n * Run the migrations.\n ...
php
chosen
[ { "from": "human", "value": "Create an application class to run testkit from phpunit bootstrap file\n" }, { "from": "gpt", "value": "<?php\nnamespace pyd\\testkit;\n\nuse pyd\\testkit\\Testkit;\n\n/**\n * Testkit application.\n *\n * @author Pierre-Yves DELETTRE <pierre.yves.delettre@gmail.com>\...
php
chosen
[ { "from": "human", "value": "Add Migration file for paper_size property\n" }, { "from": "gpt", "value": "<?php\n\nnamespace CanalTP\\MttBundle\\Migrations\\pdo_pgsql;\n\nuse Doctrine\\DBAL\\Migrations\\AbstractMigration;\nuse Doctrine\\DBAL\\Schema\\Schema;\n\n/**\n * Auto-generated Migration: P...
php
chosen
[ { "from": "human", "value": "Add missing Uni Gen file\n\nThis file was intended to be included in PR #758.\n" }, { "from": "gpt", "value": "<?php\n\n$game = SmrGame::getGame($var['game_id']);\n$template->assign('PageTopic', 'Edit Galaxies : ' . $game->getDisplayName());\n$template->assign('GameE...
php
chosen
[ { "from": "human", "value": "Create a base model for faster cache.\n" }, { "from": "gpt", "value": "<?php namespace Reshadman\\EloquentFaster;\n\nuse Illuminate\\Database\\Eloquent\\Model;\n\nclass FasterModel extends Model {\n\n /*\n * This trait handle the duty of setting and getting ca...
php
chosen
[ { "from": "human", "value": "ADD : admin user log model\n" }, { "from": "gpt", "value": "<?php\n/*\n* Blog\n* Database Table : admin_user_logs\n*/\ndefined('BASEPATH') OR exit('No direct script access allowed');\n\nclass AdminUserLog extends CI_Model {\n\t\n\tfunction __construct() {\n\t\tparent...
php
chosen
[ { "from": "human", "value": "Add French translation for Kcaptcha\n" }, { "from": "gpt", "value": "<?php defined('BASEPATH') OR exit('No direct script access allowed');\n\n$lang['captcha.label'] = '%sSaisissez le texte affiché dans l\\'image';\n$lang['captcha.tip'] = 'Cliquez sur l\\'image si vou...
php
chosen
[ { "from": "human", "value": "Add messenger service provider for Laravel support\n" }, { "from": "gpt", "value": "<?php namespace Nathanmac\\InstantMessenger;\n\nuse Illuminate\\Support\\ServiceProvider;\n\nclass MessengerServiceProvider extends ServiceProvider {\n\n /**\n * Indicates if l...
php
chosen
[ { "from": "human", "value": "Add checking if In Library\n\nAlso final hook check.\n" }, { "from": "gpt", "value": "<?php $rem_address = getenv('REMOTE_ADDR'); \nswitch ($rem_address) {\ncase '72.66.191.77':\ncase '66.37.66.139':\n$inlibrary = true;\n$currentbranch = \"Blacksburg\";\n$county = \"...
php
chosen
[ { "from": "human", "value": "Create reg_number column in profile\n" }, { "from": "gpt", "value": "<?php\n\nuse yii\\db\\Migration;\n\n/**\n * Handles adding reg_number to table `profile`.\n */\nclass m160701_001617_add_reg_number_to_profile extends Migration\n{\n /**\n * @inheritdoc\n ...
php
chosen
[ { "from": "human", "value": "Add only function test suite.\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Mimic\\Test;\n\nuse PHPUnit_Framework_TestCase;\nuse Mimic\\Functional as F;\n\n/**\n * Unit Test for only Mimic library function.\n *\n * @since 0.1.0\n */\nclass OnlyFuncTest extends ...
php
chosen
[ { "from": "human", "value": "Add a trait implementing the Observer::handleEvent() method\n" }, { "from": "gpt", "value": "<?php\nnamespace pyd\\testkit\\events;\n\n/**\n * Default implementation of the handleEvent() method required by the 'Observer'\n * interface.\n * \n * @see \\pyd\\testkit\\f...
php
chosen
[ { "from": "human", "value": "Add new middleware to add header with project id positioned\n" }, { "from": "gpt", "value": "<?php\n/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2016 Bruno P. Kinoshita, Peter Florijn\n *\n * Permission is hereby granted, free of charge, to any person obtaining...
php
chosen
[ { "from": "human", "value": "Add script to service requests\n" }, { "from": "gpt", "value": "<?php\r\nfunction write_database ( $ex_status )\r\n{\r\n\t$len = strlen($ex_status);\r\n\r\n\t$db = new mysqli('localhost', 'root', 'smarthouse', 'outlets');\r\n\r\n\tif ($db->connect_errno > 0) {\r\n\t\...
php
chosen
[ { "from": "human", "value": "Add the new site navigation bar\n" }, { "from": "gpt", "value": "<?php \n\t$url = $_SERVER['REQUEST_URI']; \n?>\n\n<nav class=\"navbar navbar-inverse\">\n\t<div class=\"container-fluid\">\n\t\t<div class=\"navbar-header\">\n\t\t\t<button type=\"button\" class=\"navba...
php
chosen
[ { "from": "human", "value": "Add PHPUnit Tests for StringUtils\n" }, { "from": "gpt", "value": "<?php\ndeclare(strict_types=1);\n\nrequire_once(\"lib/autoload.php\");\nrequire_once(\"vendor/autoload.php\");\n\nuse Utils\\StringUtils;\nuse PHPUnit\\Framework\\TestCase;\n\nclass StringUtilsTest ex...
php
chosen
[ { "from": "human", "value": "Add unit test for UriSigner\n\nWe do not use it at all but hell yeah, symfony makes it mandatory. :(\n" }, { "from": "gpt", "value": "<?php\n\n/*\n * This file is part of the Symfony package.\n *\n * (c) Fabien Potencier <fabien@symfony.com>\n *\n * For the full copy...
php
chosen
[ { "from": "system", "value": "Add project numbers to view\n" }, { "from": "human", "value": "@extends('layouts.default')\n\n@section('content')\n Admin Dashboard\n\n Open Tickets: {{ count($openTickets) }} / In Progress Tickets: {{ count($inProgressTickets) }} <br />\n Count of number o...
php
chosen
[ { "from": "human", "value": "Add factory for instance creation convenience\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Skygsn\\Sitemap;\n\nuse Skygsn\\Sitemap\\Formatter\\XmlSitemapFormatter;\nuse Skygsn\\Sitemap\\Formatter\\XmlUrlFormatter;\nuse Skygsn\\Sitemap\\Storage\\FileSystemStora...
php
chosen
[ { "from": "human", "value": "Create new email user provider.\n\nThis user provider can be used to login users by using an email address.\n" }, { "from": "gpt", "value": "<?php\n\nnamespace SumoCoders\\FrameworkMultiUserBundle\\Security;\n\nuse SumoCoders\\FrameworkMultiUserBundle\\User\\Interfac...
php
chosen
[ { "from": "human", "value": "Add test case for basic `set` and `get`\n" }, { "from": "gpt", "value": "<?php\nnamespace RockSymfony\\ServiceContainer\\Tests;\n\nuse PHPUnit\\Framework\\TestCase;\nuse RockSymfony\\ServiceContainer\\ServiceContainer;\n\nclass SetAndGetTest extends TestCase\n{\n ...
php
chosen
[ { "from": "system", "value": "Fix use of PHP5.4 array syntax.\nThe library is still valid for use with PHP 5.3\n" }, { "from": "human", "value": "<?php\n\nnamespace RMS\\PushNotificationsBundle\\Service;\n\n\nclass EventListener {\n\n /**\n * @var EventListenerInterface[]\n */\n pr...
php
chosen
[ { "from": "human", "value": "test: Add tests for new class QuantityFormat\n" }, { "from": "gpt", "value": "<?php\nnamespace nochso\\Omni\\Test;\n\nuse nochso\\Omni\\QuantityFormat;\n\nclass QuantityFormatTest extends \\PHPUnit_Framework_TestCase\n{\n public function formatProvider()\n {\n ...
php
chosen
[ { "from": "human", "value": "Add test for large writes\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Amp\\ByteStream\\Test;\n\nuse Amp\\ByteStream\\ResourceInputStream;\nuse Amp\\ByteStream\\ResourceOutputStream;\nuse Amp\\Loop;\nuse PHPUnit\\Framework\\TestCase;\n\nclass ResourceStreamTes...
php
chosen
[ { "from": "human", "value": "Add a small script to test HTTP request / responses\n" }, { "from": "gpt", "value": "<?php\n\nrequire __DIR__ . '/bootstrap.php';\n\nfunction json_response($array)\n{\n header('Content-Type: application/json');\n echo json_encode($array);\n\n exit;\n}\n\n$cm...
php
chosen
[ { "from": "human", "value": "Add abstract class to extract previews from files that are zip archives\n\nSigned-off-by: Julius Härtl <bf353fa4999f2f148afcc6d8ee6cb1ee74cc07c3@bitgrid.net>\n" }, { "from": "gpt", "value": "<?php\n/**\n * @copyright Copyright (c) 2020 Julius Härtl <jus@bitgrid.net>\...
php
chosen
[ { "from": "human", "value": "Add common auth register form language\n" }, { "from": "gpt", "value": "<?php\n/**\n * This <server-gardu-reporter> project created by :\n * Name : syafiq\n * Date / Time : 01 July 2017, 11:13 PM.\n * Email : syafiq.rezpector@gmail.com\n * Github ...
php
chosen
[ { "from": "human", "value": "Add a function to calculate the memory used in the application.\n" }, { "from": "gpt", "value": "<?php\n\n/**\n * Common function\n *\n * @category\tEventing\n * @package\t\tCommon\n * @subpackage\tMemoryUsage\n * @see\t\t\t/index.php\n */\n\n\tif(!defined('E_FRAMEWO...
php
chosen
[ { "from": "human", "value": "Add test for Syslog Writer - Logger\n" }, { "from": "gpt", "value": "<?php\n/**\n * Tlumx Framework (http://framework.tlumx.xyz/)\n *\n * @author Yaroslav Kharitonchuk <yarik.proger@gmail.com>\n * @link https://github.com/tlumx/framework\n * @copyright Copyri...
php
chosen
[ { "from": "human", "value": "Create PCR Risk form using highcharts\n" }, { "from": "gpt", "value": "<script src=\"https://code.jquery.com/jquery-1.12.0.min.js\"></script>\n\n<script src=\"https://code.highcharts.com/highcharts.js\"></script>\n\n<div id=\"container\" style=\"height: 400px; min-wi...
php
chosen
[ { "from": "human", "value": "Make the nav a partial\n" }, { "from": "gpt", "value": "<img class=\"logo\" title=\"Laravel Logo\" alt=\"Laravel Logo\" src=\"img/laravel.svg\">\n<span class=\"social-icons\">\n <a href=\"{{ $meetup_url }}\" title=\"Link to the Laravel Brussels group on Meetup.com...
php
chosen
[ { "from": "human", "value": "Add basic consent API functional test\n" }, { "from": "gpt", "value": "<?php\n\nnamespace OpenConext\\EngineBlockBundle\\Tests;\n\nuse Liip\\FunctionalTestBundle\\Test\\WebTestCase;\nuse OpenConext\\EngineBlockBundle\\Configuration\\Feature;\nuse OpenConext\\EngineBl...
php
chosen
[ { "from": "human", "value": "Add migration to encrypt users table if supported keyring plugin is installed\n" }, { "from": "gpt", "value": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migrations\\Migration;\n\nclass ...
php
chosen
[ { "from": "human", "value": "Add a placeholder unit test\n\n\ngit-svn-id: b877033504b8e832e080652813009f8744ba2601@1499189 13f79535-47bb-0310-9956-ffa450edef68\n" }, { "from": "gpt", "value": "<?php\nrequire_once('../utils/phpunit.phar');\nrequire_once('../../atom/cmis-lib.php');\nclass Alfresco...
php
chosen
[ { "from": "human", "value": "Test the config is set.\n" }, { "from": "gpt", "value": "<?php\n\nnamespace NavJobs\\RabbitMessenger\\Test\\Integration;\n\nclass ConfigTest extends TestCase\n{\n\n /**\n * @test\n */\n public function it_has_config_variables()\n {\n $this->as...
php
chosen
[ { "from": "human", "value": "Add the '{icon}' template helper to embed Font Awesome icons\n" }, { "from": "gpt", "value": "<?php\n\nnamespace wcf\\system\\template\\plugin;\n\nuse wcf\\system\\exception\\SystemException;\nuse wcf\\system\\template\\TemplateEngine;\n\n/**\n * Template compiler pl...
php
chosen
[ { "from": "human", "value": ":white_check_mark: Add API tests (Home endpoint)\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Tests\\Feature;\n\nuse Tests\\TestCase;\nuse App\\User;\nuse App\\Org;\nuse Illuminate\\Foundation\\Testing\\DatabaseTransactions;\n\nclass ApiTest extends TestCase\n...
php
chosen
[ { "from": "human", "value": "Add a simple task runner class that makes it even easier to execute artisan tasks and display the output.\n" }, { "from": "gpt", "value": "<?php\n/**\n * FluxBB - fast, light, user-friendly PHP forum software\n * Copyright (C) 2008-2012 FluxBB.org\n * based on code b...
php
chosen
[ { "from": "human", "value": "Add abstract controller with support catch exception in ajax\n" }, { "from": "gpt", "value": "<?php\n\n/*\n * To change this license header, choose License Headers in Project Properties.\n * To change this template file, choose Tools | Templates\n * and open the temp...
php
chosen
[ { "from": "human", "value": "Add an elasticsearch management view\n" }, { "from": "gpt", "value": "@section(\"content\")\n\n\t<div class=\"container main\">\n\t\t<h1>Elasticsearch Management</h1>\n\n\t\t<div class=\"row\">\n\t\t\t<div class=\"col-md-4\">\n\t\t\t\t{{ Form::open([\"method\" => \"p...
php
chosen
[ { "from": "human", "value": "Fix issue WEB-577 and WEB-579\n" }, { "from": "gpt", "value": "<?php\n\nuse Phinx\\Migration\\AbstractMigration;\n\nclass ForeingnKeyMetrics extends AbstractMigration\n{\n /**\n * Change Method.\n *\n * Write your reversible migrations using this metho...
php
chosen
[ { "from": "human", "value": "Add snippet for changing a user's subscription level when their membership expires.\n" }, { "from": "gpt", "value": "<?php\n/**\n * Moves a member to a new subscription level when their membership expires.\n * This does not take payment again so it is recommended for...
php
chosen
[ { "from": "human", "value": "Add exception for missing env vars\n" }, { "from": "gpt", "value": "<?php namespace App\\Exceptions;\n\nclass MissingEnvironmentVariableException extends \\Exception\n{\n\n public function __construct($variable, $code = 0, Exception $previous = null)\n {\n ...
php
chosen
[ { "from": "system", "value": "Add translation for the string \"Submit\" for the Very Wow translation\n\nSummary: Added Submit translation for Very Wow Locale\n\nTest Plan: Look at the code and hope it works\n\nReviewers: #blessed_reviewers, epriestley\n\nReviewed By: #blessed_reviewers, epriestley\n\nSubscr...
php
chosen
[ { "from": "human", "value": "Integrate image scaler command from dothiv/dothiv.\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Dothiv\\Bundle\\ContentfulBundle\\Command;\n\nuse Doctrine\\Common\\Cache\\Cache;\nuse Doctrine\\ORM\\EntityManager;\nuse Dothiv\\Bundle\\ContentfulBundle\\Logger\\...
php
chosen
[ { "from": "human", "value": "Add TeamInvite entity persist test\n" }, { "from": "gpt", "value": "<?php\n\nnamespace SimplyTestable\\ApiBundle\\Tests\\Entity\\Task;\n\nuse SimplyTestable\\ApiBundle\\Tests\\BaseSimplyTestableTestCase;\nuse SimplyTestable\\ApiBundle\\Entity\\Team\\Team;\nuse Simply...
php
chosen
[ { "from": "human", "value": "Add console task runner interface\n" }, { "from": "gpt", "value": "<?php namespace Aedart\\Scaffold\\Contracts\\Tasks;\n\nuse Illuminate\\Contracts\\Config\\Repository;\nuse Symfony\\Component\\Console\\Input\\InputInterface;\nuse Symfony\\Component\\Console\\Output\...
php
chosen
[ { "from": "human", "value": "Move cache access to separate class\n" }, { "from": "gpt", "value": "<?php\n/**\n * Humbug\n *\n * @category Humbug\n * @package Humbug\n * @copyright Copyright (c) 2015 Pádraic Brady (http://blog.astrumfutura.com)\n * @license https://github.com/padraic/hum...
php
chosen
[ { "from": "human", "value": "Create Connect ThreeDS Auth Request Test added\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Iyzipay\\Tests\\Request;\n\nuse Iyzipay\\Model\\Locale;\nuse Iyzipay\\Request\\CreateConnectThreeDSAuthRequest;\nuse Iyzipay\\Tests\\TestCase;\n\nclass CreateConnectThr...
php
chosen
[ { "from": "human", "value": "Create fields to track signup token usage\n" }, { "from": "gpt", "value": "<?php\n\nuse yii\\db\\Migration;\n\n/**\n * Handles adding token_statuses to table `signuplinks`.\n */\nclass m160704_023955_add_token_statuses_to_signuplinks extends Migration\n{\n /**\n ...
php
chosen
[ { "from": "human", "value": "Add Composer class to init JSON files(s)" }, { "from": "gpt", "value": "<?php\n\nnamespace Bolt\\Composer\\Action;\n\nuse Composer\\Json\\JsonFile;\n\nclass InitJson\n{\n /**\n * @param $io Composer\\IO\\BufferIO\n * @param $composer Composer\\Compos...
php
chosen
[ { "from": "human", "value": "Add Template Data processor / handler task\n\nThe task is at this point not completed, there are many things that\nstill need to get done, before this is in order. The entire\nproperties processing should be moved to a specialised handler, which\ncan be used when asking for the ...
php
chosen
[ { "from": "human", "value": "Build simple facade over the rest of the classes to cover the 80% case." }, { "from": "gpt", "value": "<?php\n\nnamespace mcordingley\\Regression;\n\nuse mcordingley\\Regression\\RegressionStrategy\\LinearLeastSquares;\n\n/**\n * SimpleRegression\n * \n * A facade (i...
php
chosen
[ { "from": "human", "value": "Implement new Bridge to mangareader.net\n\nThis Bridge returns information about the last updates on mangareader.net\n" }, { "from": "gpt", "value": "<?php\n\nclass MangareaderBridge extends BridgeAbstract{\n\n\tpublic function loadMetadatas() {\n\n\t\t$this->maintai...
php
chosen
[ { "from": "human", "value": "Remove Genesis Templates archive and blog\n\nCode from Bill Erickson's article\nhttp://www.billerickson.net/remove-genesis-page-templates/\n\nFixes #12\n" }, { "from": "gpt", "value": "<?php\n/* Remove Genesis Page Templates\n *\n * @author Bill Erickson\n * @link ht...
php
chosen
[ { "from": "human", "value": "Add a test case of AdminService\n" }, { "from": "gpt", "value": "<?php\n\nnamespace App\\Controller\\Admin;\n\nuse PHPUnit\\Framework\\TestCase;\n\nclass AdminServiceTest extends TestCase\n{\n public function testGetEnvironment() {\n AdminService::setEnviro...
php
chosen
[ { "from": "human", "value": "Add unit test for SNMP models\n" }, { "from": "gpt", "value": "<?php\n\ndefine('PHPUnit_MAIN_METHOD', 'Plugins_Fusioninventory_InventorySNMPModels::main');\n\nif (!defined('GLPI_ROOT')) {\n define('GLPI_ROOT', '../../../..');\n\n require_once GLPI_ROOT.\"/inc/inc...
php
chosen
[ { "from": "human", "value": "Create coin data service adapter abstract\n" }, { "from": "gpt", "value": "<?php\n\nnamespace App\\Classes\\CoinDataAdapters;\n\nuse App\\Classes\\CoinDataService;\n\nabstract class CoinDataAdapterAbstract extends CoinDataService\n{\n abstract protected function c...
php
chosen
[ { "from": "human", "value": "Drop tags from pre-existing private discussions\n" }, { "from": "gpt", "value": "<?php\n\n/*\n * This file is part of fof/byobu.\n *\n * Copyright (c) 2019 - 2021 FriendsOfFlarum.\n *\n * For the full copyright and license information, please view the LICENSE\n * fil...
php
chosen
[ { "from": "human", "value": "Add invalid argument exception for engine block bundle\n" }, { "from": "gpt", "value": "<?php\n\nnamespace OpenConext\\EngineBlockBundle\\Exception;\n\nuse InvalidArgumentException as CoreInvalidArgumentException;\n\nclass InvalidArgumentException extends CoreInvalid...
php
chosen
[ { "from": "human", "value": "Add trait for slightly easier problem rendering\n" }, { "from": "gpt", "value": "<?php\n/**\n * @copyright (c) 2016 Quicken Loans Inc.\n *\n * For full license information, please view the LICENSE distributed with this source code.\n */\n\nnamespace QL\\Panthor\\HTTP...
php
chosen
[ { "from": "human", "value": "Revert \"Some minor cleaning up [ci skip].\"\n\nThis reverts commit 5c22c16917e7b9d7c6885ccba09c6443043d2c1f.\n" }, { "from": "gpt", "value": "<?php\n function downloads($dirName = \"\") {\n $realDirName = ($dirName === \"\")?$_SERVER[\"DOCUMENT_ROOT\"].\"/...
php
chosen
[ { "from": "human", "value": "Add basic tests for store pages\n" }, { "from": "gpt", "value": "<?php\n/**\n * @author Mauri de Souza Nunes <mauri870@gmail.com>\n * @copyright Copyright (c) 2016, Mauri de Souza Nunes <github.com/mauri870>\n * @license https://opensource.org/licenses/MIT MIT L...
php
chosen
[ { "from": "human", "value": "Test Parse model for Parseable and Unparseable data\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Mailgun\\Tests\\Model\\EmailValidation;\n\nuse Mailgun\\Model\\EmailValidation\\Parse;\n\nclass ParseTest extends \\PHPUnit_Framework_TestCase\n{\n public funct...
php
chosen
[ { "from": "human", "value": "Create a 403 error page\n" }, { "from": "gpt", "value": "<!DOCTYPE html>\n<html>\n <head>\n <title>Access denied</title>\n\n <link href=\"https://fonts.googleapis.com/css?family=Lato:300,700\" rel=\"stylesheet\" type=\"text/css\">\n\n <style>\...
php
chosen
[ { "from": "human", "value": "Add helper function to find missing parameter fields\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 LICENSE ...
php
chosen
[ { "from": "human", "value": "Create controller to category update form\n" }, { "from": "gpt", "value": "<?php\n/**\n *Controller to get all categories\n *\n *@author Iasmin Mendes <mendesiasmin96@gmail.com>\n *@license MIT License\n *@link http://eletronjun.com.br/controller/findCategoryData...
php
chosen