conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "human", "value": "Add a kernel to handle multilingual routing\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Askaoru\\Routable\\Http;\n\nuse Illuminate\\Contracts\\Foundation\\Application;\nuse Illuminate\\Routing\\Router;\nuse Illuminate\\Foundation\\Http\\Kernel as HttpKernel;\...
php
chosen
[ { "from": "human", "value": "Fix: Add test for __get() and __set()\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Doctrine\\Tests\\Common\\Annotations;\n\nuse Doctrine\\Common\\Annotations\\Annotation;\nuse PHPUnit\\Framework\\TestCase;\n\nfinal class AnnotationTest extends TestCase\n{\n ...
php
chosen
[ { "from": "human", "value": "Add ServerError as exception marker\n" }, { "from": "gpt", "value": "<?php\n/**\n * Copyright (c) 2012-2013 Jurian Sluiman.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided th...
php
chosen
[ { "from": "human", "value": "Add trait to add the custom nested collection class\n" }, { "from": "gpt", "value": "<?php namespace TypiCMS;\n\ntrait NestableTrait\n{\n /**\n * Return a custom nested collection\n *\n * @param array $models\n * @return NestedCollectio...
php
chosen
[ { "from": "human", "value": "Use JSON datatype for news page\n" }, { "from": "gpt", "value": "<?php\n\nuse Illuminate\\Database\\Migrations\\Migration;\n\nclass JsonNewsPostPage extends Migration\n{\n /**\n * Run the migrations.\n *\n * @return void\n */\n public function u...
php
chosen
[ { "from": "system", "value": "Correct variable name from copy/pasta" }, { "from": "human", "value": "<?php\n\nnamespace Bolt\\Provider;\n\nuse Bolt\\TemplateChooser;\nuse Silex\\Application;\nuse Silex\\ServiceProviderInterface;\n\nclass TemplateChooserServiceProvider implements ServiceProviderI...
php
chosen
[ { "from": "human", "value": "[PLG_HUBZERO_RECAPTCHA] Add master key to plugin params since all hubs use same key.\n" }, { "from": "gpt", "value": "<?php\n\nuse Hubzero\\Content\\Migration\\Base;\n\n// Check to ensure this file is included in Joomla!\ndefined('_JEXEC') or die('Restricted access')...
php
chosen
[ { "from": "human", "value": "Add specs for regression on the expectation factory issue\n" }, { "from": "gpt", "value": "<?php\n\nnamespace spec\\PhpSpec\\Wrapper;\n\nuse PhpSpec\\ObjectBehavior;\nuse Prophecy\\Argument;\n\nuse PhpSpec\\Wrapper\\Wrapper;\nuse PhpSpec\\Wrapper\\Subject\\WrappedObj...
php
chosen
[ { "from": "human", "value": "Sort an array in reverse order\n" }, { "from": "gpt", "value": "\n<?php\n$fruits = array(\"lemon\", \"orange\", \"banana\", \"apple\");\nrsort($fruits);\nforeach ($fruits as $key => $val) {\n echo \"$key = $val\\n\";\n}\n?>\n" } ]
php
chosen
[ { "from": "human", "value": "Add base class for all module files\n" }, { "from": "gpt", "value": "<?php\n\nnamespace ModuleGenerator\\Module;\n\nuse ModuleGenerator\\CLI\\Service\\Generate\\GeneratableFile;\nuse ModuleGenerator\\PhpGenerator\\ModuleName\\ModuleName;\n\nabstract class Generatable...
php
chosen
[ { "from": "human", "value": "Test unitaire pour les subventions\n" }, { "from": "gpt", "value": "<?php\n\nrequire_once(dirname(__FILE__).'/../bootstrap/common.php');\nsfContext::createInstance($configuration);\n\n$viti = CompteTagsView::getInstance()->findOneCompteByTag('test', 'test_teledeclar...
php
chosen
[ { "from": "human", "value": "Add tests for forbidden fulltext search on RS backend\n" }, { "from": "gpt", "value": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Keboola\\Test\\Backend\\Redshift;\n\nuse Keboola\\Csv\\CsvFile;\nuse Keboola\\StorageApi\\ClientException;\nuse Keboola\\Test\\Storag...
php
chosen
[ { "from": "human", "value": "Add Hood Listing page to keyserver\n\nThis will allow monitoring (and other tools) to\nmaintain a recent list of hoods.\n\nSigned-off-by: Dominik Heidler <aeacd46bb4fd3f59504c7762d9af6bd04f20aa1f@heidler.eu>\nTested-by: Tim Niemeyer <f05b1b469e3796a343710ad6cdd19e106f552175@mast...
php
chosen
[ { "from": "human", "value": "Add sanity check to check if database connection is OK.\n\ngit-svn-id: a243b28a2a52d65555a829a95c8c333076d39ae1@1281 44740490-163a-0410-bde0-09ae8108e29a\n" }, { "from": "gpt", "value": "<?php\n/**\n *\n * @param array &$hookinfo hookinfo\n */\nfunction consentSimpl...
php
chosen
[ { "from": "human", "value": "Add SNMP serial retrieval for 2281, Cambium devices.\n" }, { "from": "gpt", "value": "<?php\nif (!defined('BASEPATH')) {\n exit('No direct script access allowed');\n}\n#\n# Copyright 2003-2015 Opmantek Limited (www.opmantek.com)\n#\n# ALL CODE MODIFICATIONS MUS...
php
chosen
[ { "from": "human", "value": "Test toegevoegd om te controleren of titel verplicht is bij aanmaken questionnaire\n" }, { "from": "gpt", "value": "<?php\nclass Webenq_Form_Questionnaire_AddTest extends Webenq_Test_Form\n{\n public function testTitleIsRequired()\n {\n $this->assertFals...
php
chosen
[ { "from": "human", "value": "Add unit test for event args\n" }, { "from": "gpt", "value": "<?php\nnamespace CouchDB\\Tests\\Events;\n\nuse CouchDB\\Tests\\TestCase;\nuse CouchDB\\Events\\EventArgs;\n\n/**\n * @author Markus Bachmann <markus.bachmann@bachi.biz>\n */\nclass EventArgsTest extends T...
php
chosen
[ { "from": "human", "value": "Add class to generate and carry the filters\n" }, { "from": "gpt", "value": "<?php namespace Leean\\Acf;\n\n/**\n * Class that carries the filters and some util function aroudn this,\n *\n * @since 0.4.0\n */\nclass Filter {\n\tconst DEFAULT_TRANSFORMS = 'ln_acf_appl...
php
chosen
[ { "from": "human", "value": "[laravel-sessiontimeout] Add Middleware to properly deal with session timeout\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Unicodeveloper\\Http\\Middleware;\n\nuse Closure;\nuse Illuminate\\Session\\Store;\nuse Illuminate\\Support\\Facades\\Auth;\nuse Illumina...
php
chosen
[ { "from": "human", "value": "Add unit tests for TeleporterContainer" }, { "from": "gpt", "value": "<?php\n\nnamespace Alchemy\\Zippy\\Tests\\Resource;\n\nuse Alchemy\\Zippy\\Tests\\TestCase;\nuse Alchemy\\Zippy\\Resource\\TeleporterContainer;\n\nclass TeleporterContainerTest extends TestCase\n{\...
php
chosen
[ { "from": "human", "value": "Allow to set redirection after logout\n" }, { "from": "gpt", "value": "<?php\n\n/* This file is part of the Staq project, which is under MIT license */\n\n\nnamespace Staq\\Core\\Data\\Stack\\Attribute;\n\nclass Date extends Date\\__Parent\n{\n\n static $mysql_for...
php
chosen
[ { "from": "human", "value": "Create test for HeaderParse helper\n" }, { "from": "gpt", "value": "<?php\r\n\r\nuse \\PHPUnit\\Framework\\TestCase;\r\nuse \\AdobeConnectClient\\Helpers\\HeaderParse;\r\n\r\n\r\nclass HeaderParseTest extends TestCase\r\n{\r\n\r\n protected $cookieName = 'BREEZESE...
php
chosen
[ { "from": "human", "value": "Add Command to create the errors_code file\n" }, { "from": "gpt", "value": "<?php\n\n// src/AppBundle/Command/CreateUserCommand.php\n\nnamespace HCH\\DemoBundle\\Command;\n\nuse Symfony\\Component\\Console\\Command\\Command;\nuse Symfony\\Component\\Console\\Input\\I...
php
chosen
[ { "from": "human", "value": "Add AJAX endpoint for getting a sites CloudFlare status\n" }, { "from": "gpt", "value": "<?php\n/*\n * AJAX endpoint to check if a site is using CloudFlare\n */\n\n// Load all of net/http's classes. Composer would be overkill for such a small tool.\nrequire 'includes...
php
chosen
[ { "from": "human", "value": "Create third party fieldtype supporter class.\n" }, { "from": "gpt", "value": "<?php\n\nnamespace ProcessWire\\GraphQL\\Field\\Page\\Fieldtype;\n\nuse ProcessWire\\GraphQL\\Field\\Page\\Fieldtype\\AbstractFieldtype;\nuse ProcessWire\\Page;\n\nclass FieldtypeThirdPart...
php
chosen
[ { "from": "human", "value": "Add basic unit tests for TopologicalSort" }, { "from": "gpt", "value": "<?php\n\nuse Fhaculty\\Graph\\Algorithm\\TopologicalSort;\nuse Fhaculty\\Graph\\Exception\\UnexpectedValueException;\nuse Fhaculty\\Graph\\Edge\\Base as Edge;\nuse Fhaculty\\Graph\\Graph;\n\nclas...
php
chosen
[ { "from": "human", "value": "Add migration for existing log metaInfo entries\n" }, { "from": "gpt", "value": "<?php\n\n$rowList = CM_Db_Db::select('cm_log', '*')->fetchAll();\nforeach ($rowList as $row) {\n $metaInfo = @unserialize($row['metaInfo']);\n\n if (is_array($metaInfo)) {\n ...
php
chosen
[ { "from": "human", "value": "Add migration for phpbb_users table\n" }, { "from": "gpt", "value": "<?php\n\nuse yii\\db\\Schema;\nuse yii\\db\\Migration;\n\nclass m141121_115523_update_table_phpbb_users extends Migration\n{\n private $_table = 'phpbb_users';\n private $_column = 'yii...
php
chosen
[ { "from": "system", "value": "Advance mtime by two seconds when touching a temporary file.\n\nIn send-sliced-dragged-file.html layout test, an unstable file is\nsimulated by touching the file being uploaded and advancing its mtime by\none second. An error of around one second may be lost in rounding errors\...
php
chosen
[ { "from": "human", "value": "Add another abstract action base class for dealing with returned views\n" }, { "from": "gpt", "value": "<?php namespace Flarum\\Support;\n\nuse Illuminate\\Contracts\\Bus\\Dispatcher;\nuse Psr\\Http\\Message\\ServerRequestInterface as Request;\nuse Zend\\Diactoros\\R...
php
chosen
[ { "from": "human", "value": "Add command line sevice for import price\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Gh\\SimpleShopBundle\\Command;\n\nuse Symfony\\Bundle\\FrameworkBundle\\Command\\ContainerAwareCommand;\nuse Symfony\\Component\\Console\\Input\\InputArgument;\nuse Symfony\\...
php
chosen
[ { "from": "human", "value": "Add a sample application for the webfonts API.\n" }, { "from": "gpt", "value": "<?php\nrequire_once '../../src/apiClient.php';\nrequire_once '../../src/contrib/apiWebfontsService.php';\n\n$client = new apiClient();\n$client->setApplicationName(\"Google WebFonts PHP S...
php
chosen
[ { "from": "human", "value": "Add test for timestampable extension\n" }, { "from": "gpt", "value": "<?php\nnamespace Tests\\Extensions\\Gedmo\\Timestampable;\n\nuse Doctrine\\ORM\\Mapping\\Builder\\ClassMetadataBuilder;\nuse Gedmo\\Timestampable\\Mapping\\Driver\\Fluent as Timestampable;\nuse Lar...
php
chosen
[ { "from": "human", "value": "[RPC] Add some tests for the RPC Client processor\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Swarrot\\Processor\\RPC;\n\nuse Prophecy\\Argument;\nuse Prophecy\\PhpUnit\\ProphecyTestCase;\nuse Swarrot\\Broker\\Message;\n\nclass RpcClientProcessorTest extends ...
php
chosen
[ { "from": "human", "value": "Test the fixed gradient schedule.\n" }, { "from": "gpt", "value": "<?php\n\nnamespace mcordingley\\Regression\\Tests\\Algorithm\\GradientDescent\\Schedule;\n\nuse mcordingley\\Regression\\Algorithm\\GradientDescent\\Schedule\\Fixed;\nuse PHPUnit_Framework_TestCase;\n...
php
chosen
[ { "from": "human", "value": "Add class to test backend tags model\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Backend\\Modules\\Tags\\Tests\\Engine;\n\nuse Backend\\Core\\Engine\\Model as BackendModel;\nuse Backend\\Modules\\Tags\\Engine\\Model;\nuse Common\\WebTestCase;\n\nfinal class M...
php
chosen
[ { "from": "human", "value": "Test asset: class with nullable return types\n" }, { "from": "gpt", "value": "<?php\n\nnamespace ZendTest\\Code\\TestAsset;\n\nclass NullableReturnTypeHintedClass\n{\n public function arrayReturn() : ?array\n {\n }\n\n public function callableReturn() : ?...
php
chosen
[ { "from": "human", "value": "Add simple test for Bouncer::blockAccessTemporarily() method\n" }, { "from": "gpt", "value": "<?php\n\nnamespace BlueChip\\Security\\Tests\\Integration\\Cases\\Modules\\Hardening;\n\nuse BlueChip\\Security\\Modules\\IpBlacklist;\nuse BlueChip\\Security\\Tests\\Integr...
php
chosen
[ { "from": "human", "value": "Fix Jet Squelcher's special weapon\n\nfix #377, #378\n\nSigned-off-by: AIZAWA Hina <07c779d48779c322a7c5324109202f9012f7aebf@bouhime.com>\n" }, { "from": "gpt", "value": "<?php\n/**\n * @copyright Copyright (C) 2015-2018 AIZAWA Hina\n * @license https://github.com/fe...
php
chosen
[ { "from": "human", "value": "Add heartbeat test using LiipFunctionalTestBundle\n" }, { "from": "gpt", "value": "<?php\n\nuse Liip\\FunctionalTestBundle\\Test\\WebTestCase;\nuse Symfony\\Bundle\\FrameworkBundle\\Client;\n\nfinal class HeartbeatController extends WebTestCase\n{\n /**\n * @v...
php
chosen
[ { "from": "human", "value": "Add a simple context-aware command bus\n" }, { "from": "gpt", "value": "<?php\n/**\n * @file\n */\n\nnamespace CultuurNet\\UDB3\\CommandHandling;\n\n\nuse Broadway\\CommandHandling\\CommandBusInterface;\nuse Broadway\\CommandHandling\\CommandHandlerInterface;\nuse Br...
php
chosen
[ { "from": "human", "value": "Update for PSR and abstract parts\n" }, { "from": "gpt", "value": "<?php\n\nnamespace RcmMessage\\Api;\n\nuse RcmMessage\\Entity\\MessageInterface;\n\n/**\n * @author James Jervis - https://github.com/jerv13\n */\nclass PrepareMessageForDisplayMessageParams implement...
php
chosen
[ { "from": "human", "value": "Add DefaultThemes Polish translation, credit brzezinsky\n" }, { "from": "gpt", "value": "<?php\n/*\n *\tMade by Samerton\n * https://github.com/samerton\n * NamelessMC version 2.0.0-pr3\n * License: MIT\n *\n * Translated by brzezinsky\n *\n * Polish Language - ...
php
chosen
[ { "from": "human", "value": "Add command to dump the admin menu\n" }, { "from": "gpt", "value": "<?php\n/**\n * This file is part of VinceTAdminBundle for Symfony2\n *\n * @category VinceT\n * @package VinceTAdminBundle\n * @author Vincent Touzet <vincent.touzet@gmail.com>\n * @license MIT L...
php
chosen
[ { "from": "human", "value": "Deploy source code on git server\n" }, { "from": "gpt", "value": "<?php\nnamespace Intellias\\TestBundle\\Listener;\n\nuse Symfony\\Component\\HttpKernel\\Event\\GetResponseForExceptionEvent;\nuse Symfony\\Component\\HttpFoundation\\Response;\nuse Symfony\\Component\...
php
chosen
[ { "from": "system", "value": "Add help message comment to env command\n" }, { "from": "human", "value": "<?php\nnamespace PhpBrew\\Command;\n\nuse PhpBrew\\Config;\nuse PhpBrew\\Utils;\n\nclass EnvCommand extends \\CLIFramework\\Command\n{\n public function brief()\n {\n return 'Exp...
php
chosen
[ { "from": "human", "value": "Test for execution types entity\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 a copy of\n * this software...
php
chosen
[ { "from": "human", "value": "Add a method for grapping the categories on your watch list\n\n\ngit-svn-id: 3b6cb4556d214d66df54bca2662d7ef408f367bf@3736 46e82423-29d8-e211-989e-002590a4cdd4\n" }, { "from": "gpt", "value": "<?php\n\t#\n\t# $Id: category-listing.php,v 1.1.2.1 2006-08-02 17:45:09 da...
php
chosen
[ { "from": "human", "value": "Add deprecation comment to \"generate:*\" commands\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Mapbender\\CoreBundle\\Command;\n\nuse Mapbender\\CoreBundle\\Asset\\ApplicationAssetCache;\nuse Symfony\\Bundle\\FrameworkBundle\\Command\\ContainerAwareCommand;\n...
php
chosen
[ { "from": "human", "value": "Add unit networth calculator test\n" }, { "from": "gpt", "value": "<?php\n\nnamespace OpenDominion\\Tests\\Unit\\Calculators\\Networth;\n\nuse Mockery as m;\nuse OpenDominion\\Calculators\\Networth\\UnitNetworthCalculator;\nuse OpenDominion\\Models\\Unit;\nuse OpenDo...
php
chosen
[ { "from": "human", "value": "Add test for config cache\n" }, { "from": "gpt", "value": "<?php\n\n/*\n * This file is part of Rocketeer\n *\n * (c) Maxime Fabre <ehtnam6@gmail.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with t...
php
chosen
[ { "from": "human", "value": "Add new validator: No whitespace\n" }, { "from": "gpt", "value": "<?php\nnamespace Ayeo\\Validator\\Constraint;\n\nclass NoWhitespace extends AbstractConstraint\n{\n\tpublic function run($value)\n\t{\n\t\t$parsed = preg_replace('/\\s+/', '', $value);\n\t\tif ($parsed...
php
chosen
[ { "from": "system", "value": "Add newline in-between JS files, in case last line is a comment\n" }, { "from": "human", "value": "<?php namespace Flarum\\Assets;\n\nclass JsCompiler extends RevisionCompiler\n{\n public function format($string)\n {\n return $string.';';\n }\n}\n" ...
php
chosen
[ { "from": "human", "value": "Create Eloquent Repository Service Provider for Laravel\n\nSigned-off-by: Cy Rossignol <31ace4ad1831aae866cd7951a842ca3e38f21981@rossignols.me>\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Monospice\\SpicyRepositories\\Laravel;\n\nuse Illuminate\\Support\\Serv...
php
chosen
[ { "from": "human", "value": "Add ONGR Admin Extension Test\n" }, { "from": "gpt", "value": "<?php\n\n/*\n * This file is part of the ONGR package.\n *\n * (c) NFQ Technologies UAB <info@nfq.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was dis...
php
chosen
[ { "from": "human", "value": "Add web element class for bootstrap 3 list group\n" }, { "from": "gpt", "value": "<?php\nnamespace pyd\\testkit\\web\\elements\\bootstrap;\n\n/**\n * Bootstrap 3 list group element.\n *\n * @author Pierre-Yves DELETTRE <pierre.yves.delettre@gmail.com>\n */\nclass Lis...
php
chosen
[ { "from": "system", "value": "[COM_COURSES] Mark default sections based on alias after is_default field is added\n" }, { "from": "human", "value": "<?php\n\nuse Hubzero\\Content\\Migration\\Base;\n\n// Check to ensure this file is included in Joomla!\ndefined('_JEXEC') or die('Restricted access'...
php
chosen
[ { "from": "human", "value": "Add test for multiple connections\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Zoop\\Shard\\Test\\ODMCore;\n\nuse Zoop\\Shard\\Manifest;\nuse Zoop\\Shard\\Test\\BaseTest;\nuse Zoop\\Shard\\Test\\ODMCore\\TestAsset\\Document\\Album;\n\nclass MultipleConnectionT...
php
chosen
[ { "from": "human", "value": "Test for the echo logger\n" }, { "from": "gpt", "value": "<?php\n\n/*\n * This file is part of PhuninNode.\n *\n ** (c) 2015 Cees-Jan Kiewiet\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this sourc...
php
chosen
[ { "from": "human", "value": "Add example for folder and document listing\n\nSummary:\nAn example how to get the children of a CMIS folder.\nThe examples creates an output that shows the tree structure\nof the CMIS root folder.\n\nTest Plan:\nAdd a example configuration file and run\n`php examples/ListFolder...
php
chosen
[ { "from": "human", "value": "Add smoke test with basic assetions\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Tests;\n\nclass ExporterTest extends BaseTestCase\n{\n /** @test */\n public function smoke_test()\n {\n $this->cleanLangsFolder();\n $this->createTestView(...
php
chosen
[ { "from": "human", "value": "Create method to test login\n" }, { "from": "gpt", "value": "<?php\n\nuse Illuminate\\Foundation\\Testing\\WithoutMiddleware;\nuse Illuminate\\Foundation\\Testing\\DatabaseMigrations;\nuse Illuminate\\Foundation\\Testing\\DatabaseTransactions;\n\nclass UserController...
php
chosen
[ { "from": "human", "value": "Add the property filtering attributes controller\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 infor...
php
chosen
[ { "from": "human", "value": "Add category page for President's Blog\n" }, { "from": "gpt", "value": "<?php\n/**\n * The template for pages with parent get involved archive pages.\n *\n * Learn more: http://codex.wordpress.org/Template_Hierarchy\n *\n * @package serve-first\n */\n\nget_header(); ...
php
chosen
[ { "from": "human", "value": "Add unit tests for \"Tld\" rule\n" }, { "from": "gpt", "value": "<?php\n\n/*\n * This file is part of Respect/Validation.\n *\n * (c) Alexandre Gomes Gaigalas <alexandre@gaigalas.net>\n *\n * For the full copyright and license information, please view the \"LICENSE.m...
php
chosen
[ { "from": "human", "value": "Add missing tests for the base controller\n" }, { "from": "gpt", "value": "<?php namespace Larapress\\Tests\\Controllers;\n\nuse Config;\nuse Helpers;\nuse Larapress\\Controllers\\BaseController;\nuse Larapress\\Tests\\TestCase;\nuse Str;\nuse View;\n\nclass BaseCont...
php
chosen
[ { "from": "human", "value": "Add full-text index to image table\n" }, { "from": "gpt", "value": "<?php\n\nuse Phinx\\Migration\\AbstractMigration;\n\nclass AddImageFulltextIndex extends AbstractMigration\n{\n public function change()\n {\n $table= $this->table('image', [ 'signed' => f...
php
chosen
[ { "from": "human", "value": "Add snippet for redirecting from WooCommerce shop archive.\n" }, { "from": "gpt", "value": "<?php\n/**\n * Plugin Name: Restrict Content Pro - Restrict WooCommerce Shop Archive\n * Description: Restricts access to the WooCommerce shop archive, using the settings spec...
php
chosen
[ { "from": "human", "value": "Add tests for the broker pass\n" }, { "from": "gpt", "value": "<?php declare(strict_types=1);\nnamespace Wisembly\\AmqpBundle\\DependencyInjection\\Compiler;\n\nuse PHPUnit\\Framework\\TestCase;\n\nuse Prophecy\\Prophecy\\ProphecyInterface;\n\nuse Symfony\\Component\...
php
chosen
[ { "from": "human", "value": "Convert new lines to HTML line breaks\n\nThis extension converts new lines (\\n) found within the bodies of posts\non individual post pages as well as the latest posts to HTML line\nbreaks (<br>).\n" }, { "from": "gpt", "value": "<?php\n\n class ConvertNewLines {\n\...
php
chosen
[ { "from": "human", "value": "Add example script for macro expansion\n" }, { "from": "gpt", "value": "<?php\n\n// example call:\n// php examples/macro-expand.php\n// \"(defmacro when (condition a b c) (list 'if condition (list 'begin a b c)))\"\n// \"(when (> x 10) 1 2 3)\"\n\nnamespace I...
php
chosen
[ { "from": "human", "value": "Add test for console request\n" }, { "from": "gpt", "value": "<?php\n/**\n * Zend Framework (http://framework.zend.com/)\n *\n * @link http://github.com/zendframework/zf2 for the canonical source repository\n * @copyright Copyright (c) 2005-2013 Zend Technologie...
php
chosen
[ { "from": "human", "value": "Add migration to add trainer role\n\nTrainers can add attendance to hidden teams\n" }, { "from": "gpt", "value": "<?php\n\nuse Spatie\\Permission\\Models\\Role;\nuse Spatie\\Permission\\Models\\Permission;\nuse Illuminate\\Database\\Migrations\\Migration;\n\nclass Ad...
php
chosen
[ { "from": "human", "value": "Add migration to remove and restrict duplicates in Posts Attachements\n" }, { "from": "gpt", "value": "<?php\n\nuse Movim\\Migration;\nuse Illuminate\\Database\\Schema\\Blueprint;\n\nclass AddUniquePostIdHashToAttachmentsTable extends Migration\n{\n public functio...
php
chosen
[ { "from": "human", "value": "Add index across username and deleted_at to improve large directory sync performance\n" }, { "from": "gpt", "value": "<?php\n\nuse Illuminate\\Database\\Migrations\\Migration;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Support\\Facades\\Schema;\n\...
php
chosen
[ { "from": "human", "value": "Load models via single request\n" }, { "from": "gpt", "value": "<?php\n\nuse Illuminate\\Support\\Facades\\File;\n\nRoute::group(array('before' => 'vextAuth'), function() {\n\n /*Route::any('/{all}', function($page) {\n if ( File::extension($page) === 'js' ...
php
chosen
[ { "from": "human", "value": "Add informe stats under admin utilities\n" }, { "from": "gpt", "value": "<style>\ntr {\n}\ntd {\n\tborder: 1px solid orange;\n\tpadding: 3px;\n}\n</style>\n<?php\n/**\n * Elgg Reported content admin page\n *\n * @package ElggReportedContent\n */\n\n$options = array('...
php
chosen
[ { "from": "human", "value": "Create migration for adding verification_token column to users table\n" }, { "from": "gpt", "value": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migrations\\Migration;\n\nclass AddVerifi...
php
chosen
[ { "from": "human", "value": "Fix raa controller configuration action\n" }, { "from": "gpt", "value": "<?php\n\n/**\n * Copyright 2018 SURFnet B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * Yo...
php
chosen
[ { "from": "human", "value": "Add bitmask for room details\n" }, { "from": "gpt", "value": "<?php\nnamespace MssPhp\\Bitmask;\n\nclass RoomDetails\n{\n const BASIC_INFO = 4;\n const TITLE = 8;\n const ROOM_IMAGES = 32;\n const ROOM_FACILITIES_FILTER = 64;\n const ROOM_DESCRIPTION =...
php
chosen
[ { "from": "human", "value": "Add a replacement for `assertInternalType`\n\nThis was removed in PHPUnit 9, but its replacements aren't available in\nPHPUnit 4 (which we still support)\n\nWe have to do this with a new Assert class, rather than implementing it\nin our TestCase class because otherwise we would ...
php
chosen
[ { "from": "human", "value": "oauth: Add silex controller for oauth routes\n\nThe controller has two routes jira-connect and jira-callback. An\napplication can start the authentication process with jira calling the\njira-connect route.\n\nThe jira-connect route will trigger the temporary token request and wi...
php
chosen
[ { "from": "human", "value": "Test the fake image repository\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Tests\\App\\Repositories;\n\nuse Tests\\TestCase;\n\nclass FakeImageRepositoryTest extends TestCase\n{\n /**\n * @covers Styleguide\\Repositories\\FakeImageRepository::dimension...
php
chosen
[ { "from": "human", "value": "Add Template for bootstrap layout support\n\nCustom genesis() override to swap the div and the hook. There might be and easier way to do this changing priority on genesis_before_content_sidebar_wrap() or using genesis_markup()" }, { "from": "gpt", "value": "\t<?php\n...
php
chosen
[ { "from": "human", "value": "Make migration to rename VN title_jp and title_en\n\n- Rename title_jp to title_original\n- Rename title_en to title_romaji\n" }, { "from": "gpt", "value": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illumina...
php
chosen
[ { "from": "human", "value": "Add some backend code to return skeleton / neuron names and IDs for a treenode\n" }, { "from": "gpt", "value": "<?php\n\ninclude_once( 'errors.inc.php' );\ninclude_once( 'db.pg.class.php' );\ninclude_once( 'session.class.php' );\ninclude_once( 'tools.inc.php' );\ninc...
php
chosen
[ { "from": "human", "value": "Add a CNPJ exception file" }, { "from": "gpt", "value": "<?php\n\nnamespace Respect\\Validation\\Exceptions;\n\nclass CnpjException extends ValidationException\n{\n\n public static $defaultTemplates = array(\n self::MODE_DEFAULT => array(\n self:...
php
chosen
[ { "from": "human", "value": "Add a view for all the celestials in EVE, sadly Phinx doesn't add it properly, so it has to be run manually - it's there till phinx adds view support\n" }, { "from": "gpt", "value": "<?php\n\nuse Phinx\\Migration\\AbstractMigration;\n\nclass CreateMapAllCelestialsVie...
php
chosen
[ { "from": "system", "value": "Fix the compatibility with Twig 2\n" }, { "from": "human", "value": "<?php\n\n/*\n * This file is part of the Assetic package, an OpenSky project.\n *\n * (c) 2010-2014 OpenSky Project Inc\n *\n * For the full copyright and license information, please view the LICEN...
php
chosen
[ { "from": "system", "value": "BAP-10654: Prepare existing code for new Localization Entity\n- Added migration query to updated Localization titles\n" }, { "from": "human", "value": "<?php\n\nnamespace Oro\\Bundle\\LocaleBundle\\Entity;\n\nuse Doctrine\\Common\\Collections\\Collection;\n\nuse Oro...
php
chosen
[ { "from": "human", "value": "Add migration to purge bot/spam users\n" }, { "from": "gpt", "value": "<?php\n\nuse Illuminate\\Database\\Migrations\\Migration;\nuse Symfony\\Component\\Console\\Output\\ConsoleOutput;\n\nclass PruneUnactivatedUsers1 extends Migration\n{\n /**\n * Run the mig...
php
chosen
[ { "from": "human", "value": "Create Base for all pages\n\nAll default tags and assets are here\n" }, { "from": "gpt", "value": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n\t<meta charset=\"UTF-8\">\n\t<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n <meta name=\"viewport\" content=...
php
chosen
[ { "from": "human", "value": "Add beatmap id index on solo scores\n" }, { "from": "gpt", "value": "<?php\n\n// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0.\n// See the LICENCE file in the repository root for full licence text.\n\nuse Illum...
php
chosen
[ { "from": "human", "value": "Move default CSRF checking into core.\n" }, { "from": "gpt", "value": "<?php namespace Illuminate\\Foundation\\Http\\Middleware;\n\nuse Closure;\nuse Illuminate\\Contracts\\Routing\\Middleware;\nuse Symfony\\Component\\HttpFoundation\\Cookie;\nuse Illuminate\\Contrac...
php
chosen
[ { "from": "human", "value": "Add the search form that we're calling in header.\n" }, { "from": "gpt", "value": "<?php if ( !defined( 'HABARI_PATH' ) ) { die('No direct access'); } ?>\n\n<form role=\"search\" method=\"get\" id=\"searchform\" action=\"<?php URL::out('display_search'); ?>\">\n\t<la...
php
chosen
[ { "from": "human", "value": "Add Mockery Matcher for Value Objects\n" }, { "from": "gpt", "value": "<?php\n\nnamespace OpenConext\\Mockery\\Matcher;\n\nuse Mockery\\Exception\\RuntimeException;\nuse Mockery\\Matcher\\MatcherAbstract;\n\n/**\n * A Mockery matcher that can be used to verify equali...
php
chosen
[ { "from": "human", "value": "Add field formatters for URL and telephone fields.\n" }, { "from": "gpt", "value": "<?php\n\nnamespace AbleCore\\Fields\\FieldHandlerTypes;\n\nuse AbleCore\\Fields\\FieldValue;\nuse AbleCore\\Fields\\FieldValueHandler;\n\nclass ExtraFields extends FieldValueHandler {...
php
chosen
[ { "from": "human", "value": "[FIX] upgrade: Check the prefs in the database for feature_search setting and set both search prefs if it's 'y' or empty (which was the default prior to r45122) to avoid settings being switched around (thanks Geoff)\n\ngit-svn-id: bf8acf6ea2e0c2f171d9237652733ab0075b5b4c@46392 b...
php
chosen
[ { "from": "human", "value": "Create new events table with new polymorphic schema\n" }, { "from": "gpt", "value": "<?php\n\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migrations\\Migration;\n\nclass CreateNewEventsTableSchema extends Migration\n{\n /**\n * Run ...
php
chosen
[ { "from": "human", "value": "Migrate all \"accountID\" values to \"ExternalAccountIdentifier\" objects\n\nSummary: Depends on D21016. Ref T13493. This copies existing external account \"accountID\" values into the \"ExternalAccountIdentifier\" table, preparing for an authority switch.\n\nTest Plan: Ran migr...
php
chosen