conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "human", "value": "Create Ruby virtualizor test case\n" }, { "from": "gpt", "value": "<?php\n\nnamespace VirtualizorNonCompiler;\n\nuse App\\Virtualizor\\Lang\\Ruby;\nuse PHPUnit\\Framework\\TestCase;\n\nclass RubyTest extends TestCase\n{\n\tpublic function test1()\n\t{\n\t\t$code = \"...
php
chosen
[ { "from": "human", "value": "Add a test on the plugin client builder\n" }, { "from": "gpt", "value": "<?php\n\ndeclare(strict_types=1);\n\nnamespace tests\\Http\\Client\\Common;\n\nuse Closure;\nuse Http\\Client\\Common\\Plugin;\nuse Http\\Client\\Common\\PluginClient;\nuse Http\\Client\\Common\...
php
chosen
[ { "from": "human", "value": "Add the db profiling template file from K2.\n" }, { "from": "gpt", "value": "<?php if ( !defined( 'HABARI_PATH' ) ) { die('No direct access'); } ?>\n<style>\n.prof_container {\n margin: 10 100;\n text-align: center;\n border: solid 1px #999;\n background-color: #...
php
chosen
[ { "from": "human", "value": "Add template secure constants file\n" }, { "from": "gpt", "value": "<?php\n\n/* Define database connection parameters.\n * KEEP THIS FILE SECURE AND READ ONLY. */\n\n$GLOBALS['DB'] = [\n\t'SERVER' => '',\n\t'USERNAME' => '',\n\t'PASSWORD' => '',\n\t'DATABASE' => ''\n...
php
chosen
[ { "from": "system", "value": "Fix namespace in table seeder\n" }, { "from": "human", "value": "<?php\n\nuse Illuminate\\Database\\Seeder;\nuse App\\User;\n// Composer: \"fzaninotto/faker\": \"v1.3.0\"\nuse Faker\\Factory as Faker;\n\nclass InvoicesTableSeeder extends Seeder {\n\n\tpublic functio...
php
chosen
[ { "from": "human", "value": "Add console command for finding synchronised articles that need content fetching.\n" }, { "from": "gpt", "value": "<?php namespace App\\Console\\Commands;\n\nuse App\\Items;\nuse App\\Services\\ContentExtractor;\nuse Illuminate\\Console\\Command;\nuse \\Log;\n\nclass...
php
chosen
[ { "from": "human", "value": "Add interface for header parameter provision" }, { "from": "gpt", "value": "<?php\n\nnamespace JWX\\JWT;\n\nuse JWX\\JWT\\Parameter\\JWTParameter;\n\n\n/**\n * Interface for classes providing JOSE header parameters.\n */\ninterface HeaderParameters\n{\n\t/**\n\t * Ge...
php
chosen
[ { "from": "human", "value": "Add tests for some edge cases\n" }, { "from": "gpt", "value": "<?php\n\nnamespace RapidRoute\\Tests\\Integration;\n\nuse RapidRoute\\RapidRouteException;\nuse RapidRoute\\RouteCollection;\nuse RapidRoute\\MatchResult;\n\n/**\n * @author Elliot Levin <elliotlevin@hotm...
php
chosen
[ { "from": "human", "value": "Add Padding String unit test for Various class\n" }, { "from": "gpt", "value": "<?php\n/**\n * @author Pierre-Henry Soria <hello@ph7cms.com>\n * @copyright (c) 2017, Pierre-Henry Soria. All Rights Reserved.\n * @license GNU General Public Li...
php
chosen
[ { "from": "human", "value": "Add DB adapter factory for the service manager\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-201...
php
chosen
[ { "from": "human", "value": "Add a new example for complex replication configuration.\n" }, { "from": "gpt", "value": "<?php\n\n/*\n * This file is part of the Predis package.\n *\n * (c) Daniele Alessandri <suppakilla@gmail.com>\n *\n * For the full copyright and license information, please vie...
php
chosen
[ { "from": "human", "value": "Add composer post install/update for Orchestra Platform.\n\nSigned-off-by: crynobone <e1a543840a942eb68427510a8a483282a7bfeddf@gmail.com>\n" }, { "from": "gpt", "value": "<?php namespace Orchestra\\Foundation\\Composer;\n\nuse Orchestra\\Foundation\\Application;\nuse...
php
chosen
[ { "from": "human", "value": "Create Generate Command which will generate html files for interactive docs\n" }, { "from": "gpt", "value": "<?php\n\nnamespace FeatureBrowser\\FeatureBrowser\\Cli;\n\nuse Symfony\\Component\\Console\\Command\\Command as BaseCommand;\nuse Symfony\\Component\\Console\...
php
chosen
[ { "from": "human", "value": "Add test for Compiler class\n" }, { "from": "gpt", "value": "<?php\n/**\n * phpDocumentor\n *\n * PHP Version 5.3\n *\n * @copyright 2010-2013 Mike van Riel / Naenius (http://www.naenius.com)\n * @license http://www.opensource.org/licenses/mit-license.php MIT\n * @...
php
chosen
[ { "from": "human", "value": "Add test for post process trait\n" }, { "from": "gpt", "value": "<?php\n\nuse Aedart\\Scaffold\\Traits\\PostProcess;\nuse Aedart\\Testing\\Laravel\\TestCases\\unit\\GetterSetterTraitTestCase;\n\n/**\n * Class PostProcessTraitTest\n *\n * @group traits\n * @group post...
php
chosen
[ { "from": "human", "value": "Add redirect from root folder to www/\n\nRedirect from the base directory to www/, because that's where Yii\nwants all the action to happen.\n" }, { "from": "gpt", "value": "<?php\n/**\n * Redirect to Metadata Games.\n *\n */\n\n// Redirect from the base directory to...
php
chosen
[ { "from": "human", "value": "Add test for Allow CORS class\n" }, { "from": "gpt", "value": "<?php\n/**\n * @author Pierre-Henry Soria <hello@ph7cms.com>\n * @copyright (c) 2018, Pierre-Henry Soria. All Rights Reserved.\n * @license GNU General Public License; See PH7.LI...
php
chosen
[ { "from": "system", "value": "Update Lambda Helper docblock. It was a lie.\n" }, { "from": "human", "value": "<?php\n\n/*\n * This file is part of Mustache.php.\n *\n * (c) 2012 Justin Hileman\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distr...
php
chosen
[ { "from": "human", "value": "Add test for dumper exception\n" }, { "from": "gpt", "value": "<?php\n\nnamespace PhpTabsTest\\Component;\n\nuse Exception;\nuse PHPUnit_Framework_TestCase;\nuse PhpTabs\\PhpTabs;\n\n/**\n * Tests Dumper component\n */\nclass DumperTest extends PHPUnit_Framework_Test...
php
chosen
[ { "from": "human", "value": "Add a configuration util that manages profiles\n" }, { "from": "gpt", "value": "<?php\n/**\n * @package Neolao\\Util\n */\nnamespace Neolao\\Util;\n\n/**\n * Configuration with profiles\n *\n * Example of json file:\n * {\n * \"profile\" : \"production\",\n * ...
php
chosen
[ { "from": "human", "value": "Create collection test case with get initial URI test.\n" }, { "from": "gpt", "value": "<?php\n\nnamespace CouchDbHypermediaApi\\Test;\n\nuse PHPUnit_Framework_TestCase as TestCase;\nuse Doctrine\\CouchDB\\CouchDBClient;\nuse Doctrine\\CouchDB\\View\\FolderDesignDocu...
php
chosen
[ { "from": "human", "value": "Add calendar share info call.\n" }, { "from": "gpt", "value": "<?php\n/*©lgpl*************************************************************************\n* *\n* This file is part of FRIEND UNI...
php
chosen
[ { "from": "human", "value": "Add filter 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 filter Mimic library function.\n *\n * @since 0.1.0\n */\nclass FilterFuncTest ex...
php
chosen
[ { "from": "human", "value": "Implement translatable entity repository trait.\n" }, { "from": "gpt", "value": "<?php\n/**\n * @author Igor Nikolaev <igor.sv.n@gmail.com>\n * @copyright Copyright (c) 2017, Darvin Studio\n * @link https://www.darvin-studio.ru\n *\n * For the full copyright ...
php
chosen
[ { "from": "human", "value": "Add Test case for ActionGrantSelector.\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Zimbra\\Mail\\Tests\\Struct;\n\nuse Zimbra\\Mail\\Tests\\ZimbraMailTestCase;\nuse Zimbra\\Enum\\GranteeType;\nuse Zimbra\\Mail\\Struct\\ActionGrantSelector;\n\n/**\n * Testcase...
php
chosen
[ { "from": "human", "value": "Add test to new Arr module\n" }, { "from": "gpt", "value": "<?php declare(strict_types=1);\n\nnamespace Siler\\Test\\Unit\\Prelude;\n\nuse PHPUnit\\Framework\\TestCase;\nuse function Siler\\Arr\\set;\n\nclass ArrTest extends TestCase\n{\n public function testSet()...
php
chosen
[ { "from": "human", "value": "Add simple adapter for PSR logger\n" }, { "from": "gpt", "value": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Biplane\\YandexDirect\\Log\\SoapLogger;\n\nuse Biplane\\YandexDirect\\Log\\SoapLogger;\nuse Psr\\Log\\LoggerInterface;\nuse Psr\\Log\\LogLevel;\n\nfinal ...
php
chosen
[ { "from": "human", "value": "Add debug post install script\n" }, { "from": "gpt", "value": "<?php\n/**\n * @copyright ©2014 Quicken Loans Inc. All rights reserved. Trade Secret,\n * Confidential and Proprietary. Any dissemination outside of Quicken Loans\n * is strictly prohibited.\n */\n\...
php
chosen
[ { "from": "human", "value": "Implement gradient descent over an arbitrary loss function." }, { "from": "gpt", "value": "<?php\n\ndeclare(strict_types=1);\n\nnamespace mcordingley\\Regression\\RegressionAlgorithm;\n\nuse mcordingley\\Regression\\Observations;\n\n/**\n * GradientDescent\n *\n * Im...
php
chosen
[ { "from": "human", "value": "Add test for Sassmeister adapter\n" }, { "from": "gpt", "value": "<?php\n\nclass SassmeisterTest extends TestCaseBase\n{\n public function testGist()\n {\n $this->assertEmbed(\n 'http://sassmeister.com/gist/1122e441f0434ec6eb2a',\n ...
php
chosen
[ { "from": "human", "value": "Add unit tests for translated validation messages in en and pt-br\n" }, { "from": "gpt", "value": "<?php\n\nuse Galahad\\LaravelAddressing\\ServiceProvider;\nuse Illuminate\\Validation\\Factory;\nuse Orchestra\\Testbench\\TestCase;\n\n/**\n * Class TranslationTest\n ...
php
chosen
[ { "from": "human", "value": "Add an autoloader that allows using the old class names even after migrating to PSR-2. This makes it easier for projects using the library to migrate, as it can then be done incrementally.\n" }, { "from": "gpt", "value": "<?php\n\n/**\n * Temporary autoloader to ensu...
php
chosen
[ { "from": "human", "value": "Add bridge for Project M\n" }, { "from": "gpt", "value": "<?php\n/**\n* 2014-08-27\n* @name Project M Game Bridge\n* @homepage http://projectmgame.com/en/\n* @description Returns the newest articles.\n* @maintainer corenting\n*/\nclass ProjectMGameBridge extends Brid...
php
chosen
[ { "from": "human", "value": "Add a menu configuration to handle menu creation\n" }, { "from": "gpt", "value": "<?php\n\nnamespace LAG\\AdminBundle\\Configuration;\n\nuse JK\\Configuration\\Configuration;\nuse Symfony\\Component\\OptionsResolver\\Options;\nuse Symfony\\Component\\OptionsResolver\...
php
chosen
[ { "from": "system", "value": "Fix 'remember_me' column not found error\n" }, { "from": "human", "value": "<?php\n\nnamespace Illuminate\\Auth;\n\ntrait Authenticatable\n{\n /**\n * Get the name of the unique identifier for the user.\n *\n * @return string\n */\n public func...
php
chosen
[ { "from": "human", "value": "Add file to create the admin account.\n" }, { "from": "gpt", "value": "<?php\n\n/**\n * This file is part of the Stippers project (available here: https://github.com/Stannieman/stippers/).\n * The license and all terms en conditions that apply to Stippers also apply ...
php
chosen
[ { "from": "human", "value": "Add trait to authorize resource in controller.\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Yajra\\Acl\\Traits;\n\ntrait AuthorizesResources\n{\n /**\n * Permission resource ability mapping.\n *\n * @var array\n */\n protected $resourceAb...
php
chosen
[ { "from": "human", "value": "Check if client IP needs 2FA\nHere you can enter a range op IPs. If the client is in the range, it does not need 2FA\n" }, { "from": "gpt", "value": "<?php\n/**\n * This authproc filter enables the possibility to check which IP the client has.\n * If it is wanted, th...
php
chosen
[ { "from": "system", "value": "Add docblock description to authenticate()\n" }, { "from": "human", "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-2014...
php
chosen
[ { "from": "human", "value": "Add the class loader to support for backwards compat.\n" }, { "from": "gpt", "value": "<?php namespace Illuminate\\Support;\n\nclass ClassLoader {\n\n\t/**\n\t * The registered directories.\n\t *\n\t * @var array\n\t */\n\tprotected static $directories = array();\n\n...
php
chosen
[ { "from": "human", "value": "Create util to generate code\n" }, { "from": "gpt", "value": "<?php\n\necho generateRandomString(8).\"\\n\";\n\nfunction generateRandomString($length = 10) {\n return substr(str_shuffle(\"0123456789abcdefghjkmnopqrstuvwxyz\"), 0, $length);\n}" } ]
php
chosen
[ { "from": "system", "value": "Allow absolute path on twig getPath function\n" }, { "from": "human", "value": "<?php\nnamespace Victoire\\Bundle\\CoreBundle\\Twig\\Extension;\n\nuse Symfony\\Bridge\\Twig\\Extension\\RoutingExtension;\nuse Symfony\\Component\\Routing\\Generator\\UrlGeneratorInterf...
php
chosen
[ { "from": "system", "value": "Add 'comment' field to list of non-numeric fields.\n" }, { "from": "human", "value": "<?php\n\nclass JsonView extends ApiView {\n public function render($content) {\n header('Content-Type: application/json; charset=utf8');\n echo $this->buildOutput(...
php
chosen
[ { "from": "human", "value": "Debug class to allow fetching local files/urls " }, { "from": "gpt", "value": "<?php\r\n\r\nnamespace OGetIt;\r\n\r\nuse OGetIt\\CombatReport\\OGetIt_CombatReport;\r\n\r\nclass OGetIt_Debug extends OGetIt { \r\n\t\r\n\tpublic function __construct() {}\r\n\t\r\n\t/**\...
php
chosen
[ { "from": "human", "value": "Add a basic countrycode mapper for future use to dedup phone intl/local prefix problems\n" }, { "from": "gpt", "value": "<?php\n/**\n * ownCloud - ocsms\n *\n * This file is licensed under the Affero General Public License version 3 or\n * later. See the COPYING file...
php
chosen
[ { "from": "human", "value": "Add test for fetching an object which starts with 00\n\nThis is a special case where the fanout table does not get used.\n" }, { "from": "gpt", "value": "<?php\n\nnamespace adrianclay\\git\\Pack;\n\nuse adrianclay\\git\\Repository;\nuse adrianclay\\git\\SHA;\nuse PHP...
php
chosen
[ { "from": "human", "value": "Add tests with 100% coverage for Algorithm\\Complete" }, { "from": "gpt", "value": "<?php\n\nuse Fhaculty\\Graph\\Algorithm\\Complete as AlgorithmComplete;\nuse Fhaculty\\Graph\\Graph;\n\nclass CompleteTest extends TestCase\n{\n public function testGraphEmptyK0()\...
php
chosen
[ { "from": "human", "value": "Add model class for user_roles table\n" }, { "from": "gpt", "value": "<?php\n\nnamespace app\\models;\n\nuse Yii;\n\n/**\n * This is the model class for table \"user_roles\".\n *\n * @property integer $id\n * @property string $role_name\n * @property string $descript...
php
chosen
[ { "from": "human", "value": "Add command to create CSV of works with no style, classification or artist\n" }, { "from": "gpt", "value": "<?php\n\nnamespace App\\Console\\Commands\\Report;\n\nuse App\\Models\\Collections\\Artwork;\n\nuse League\\Csv\\Writer;\nuse Illuminate\\Support\\Facades\\Sto...
php
chosen
[ { "from": "human", "value": "Add an example for downloading a file.\n" }, { "from": "gpt", "value": "<?php\n/**\n* SmartFile PHP SDK\n*\n* PHP version 5\n*\n* LICENSE: The MIT License (MIT)\n*\n* Copyright Copyright (c) 2012, SmartFile\n*\n* Permission is hereby granted, free of charge, to any p...
php
chosen
[ { "from": "human", "value": "Add full test coverage for ErrorHandler\n" }, { "from": "gpt", "value": "<?php\n\n/*\n * This file is part of VirtPHP.\n *\n * (c) Jordan Kasper <github @jakerella>\n * Ben Ramsey <github @ramsey>\n * Jacques Woodcock <github @jwoodcock>\n *\n * For the full ...
php
chosen
[ { "from": "human", "value": "Add missing unit tests for the twig extension\n" }, { "from": "gpt", "value": "<?php\n\n/*\n * This file is part of the Raygunbundle package.\n *\n * (c) nietonfir <nietonfir@gmail.com>\n *\n * For the full copyright and license information, please view the LICENSE\n...
php
chosen
[ { "from": "human", "value": "Create Migration for user's personal groups (acquaintances, family, etс.)\n" }, { "from": "gpt", "value": "<?php\n\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migrations\\Migration;\n\n/**\n * Class CreateFriendFriendshipGroupsTable\n */\...
php
chosen
[ { "from": "human", "value": "[DEV] Add base class for application start and configuration\n" }, { "from": "gpt", "value": "<?php\n\nnamespace RJ\\FootballApp\\App;\n\nuse DI\\Bridge\\Slim\\App;\nuse DI\\ContainerBuilder;\nuse RJ\\FootballApp\\Controller\\UserController;\n\nuse function DI\\objec...
php
chosen
[ { "from": "human", "value": "Add DatabaseBehaviorAccessible to handle row access based on the active users group, role or authenticity.\n" }, { "from": "gpt", "value": "<?php\n/**\n * Nooku Platform - http://www.nooku.org/platform\n *\n * @copyright\tCopyright (C) 2007 - 2014 Johan Janssens and ...
php
chosen
[ { "from": "human", "value": "Add migration which changes the datatypes on the additional fields table and also makes the type info field nullable\n" }, { "from": "gpt", "value": "<?php declare(strict_types=1);\n\nnamespace DoctrineMigrations;\n\nuse Doctrine\\DBAL\\Schema\\Schema;\nuse Doctrine\...
php
chosen
[ { "from": "human", "value": "Add libsodium pecl debug script\n" }, { "from": "gpt", "value": "<?php\n/**\n * @author rugk\n * @copyright Copyright (c) 2015-2016 rugk\n * @license MIT\n */\n\n$EOL=\"<br>\\n\";\n\n// method1\n$timeStart = microtime();\n\n$ext = new ReflectionExtension('libsodium')...
php
chosen
[ { "from": "human", "value": "Add RSA key encryption algorithm" }, { "from": "gpt", "value": "<?php\n\nnamespace JWX\\JWE\\KeyAlgorithm;\n\nuse JWX\\JWE\\KeyManagementAlgorithm;\nuse JWX\\JWT\\Parameter\\AlgorithmParameter;\nuse JWX\\JWK\\RSA\\RSAPublicKeyJWK;\nuse JWX\\JWK\\RSA\\RSAPrivateKeyJWK...
php
chosen
[ { "from": "human", "value": "Add migration to delete old data\n" }, { "from": "gpt", "value": "<?php\n\n\nuse Phinx\\Migration\\AbstractMigration;\n\nclass Youkok3005 extends AbstractMigration\n{\n /**\n * Change Method.\n *\n * Write your reversible migrations using this method.\...
php
chosen
[ { "from": "human", "value": "Create base test case with test request factory helper.\n" }, { "from": "gpt", "value": "<?php\n\nnamespace MCordingley\\LaravelSapient\\Test\\Middleware;\n\nuse Illuminate\\Http\\Request;\nuse MCordingley\\LaravelSapient\\Test\\TestCase as BaseTestCase;\n\nabstract ...
php
chosen
[ { "from": "human", "value": "Add unit test for Traktor class.\n" }, { "from": "gpt", "value": "<?php\n\nuse Mockery as m;\nuse Traktor\\Traktor;\n\nclass TraktorTest extends \\PHPUnit_Framework_TestCase\n{\n\n public function tearDown()\n {\n m::close();\n }\n\n public functio...
php
chosen
[ { "from": "human", "value": "Add a single helper class to summarise the datas\n" }, { "from": "gpt", "value": "<?php namespace Lbc;\n\nuse Lbc\\Crawler\\AdCrawler;\nuse Lbc\\Crawler\\SearchResultCrawler;\nuse Lbc\\Parser\\SearchResultUrlParser;\n\nclass GetFrom\n{\n /**\n * retrieve the s...
php
chosen
[ { "from": "human", "value": "Add must use plugin for composer setup options" }, { "from": "gpt", "value": "<?php\nif (!is_blog_installed()) { return; }\n\n$my_server_port = ((!empty ($_SERVER ['SERVER_PORT']) AND $_SERVER ['SERVER_PORT'] <> '80') ? (\":\" . $_SERVER ['SERVER_PORT']) : '');\n$my_...
php
chosen
[ { "from": "human", "value": "Add missing background job proxy base class" }, { "from": "gpt", "value": "<?php\n\nclass Worker_Proxy_Background extends Worker_Proxy{\n /**\n * magic function, transform all calls into jobs and forward to slave\n * \n * @param string $name\n * @p...
php
chosen
[ { "from": "human", "value": "Add unit test for fullByOrganismName webservice\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Tests\\AppBundle\\API\\Mapping;\n\nuse Symfony\\Component\\HttpFoundation\\ParameterBag;\nuse Tests\\AppBundle\\API\\WebserviceTestCase;\n\nclass FullByOrganismNameTes...
php
chosen
[ { "from": "human", "value": "Add basic form test class\n\nThis makes it easy to pass a series of parameters to a test simplifying\nthe form testing requirements.\n" }, { "from": "gpt", "value": "<?php\nnamespace VideoHosterTest\\Form;\n\nuse PHPUnit_Framework_TestCase;\nuse Zend\\Form\\Form as Z...
php
chosen
[ { "from": "human", "value": "Add unit test for not filter\n" }, { "from": "gpt", "value": "<?php\n/**\n * @author Boudewijn Schoon <boudewijn@zicht.nl>\n * @copyright Zicht Online <http://zicht.nl>\n */\n\nnamespace Zicht\\ItertoolsTest\\filters;\n\nuse Zicht\\Itertools\\filters;\n\n/**\n * Clas...
php
chosen
[ { "from": "human", "value": "Print CORS headers if requested\n" }, { "from": "gpt", "value": "<?php\n\nnamespace AppBundle\\EventSubscriber;\n\nuse Symfony\\Component\\EventDispatcher\\EventSubscriberInterface;\nuse Symfony\\Component\\HttpFoundation\\Request;\nuse Symfony\\Component\\HttpFounda...
php
chosen
[ { "from": "human", "value": "Add wrapper class for the editor blocks\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Common\\BlockEditor\\Blocks;\n\nuse Doctrine\\Common\\Collections\\ArrayCollection;\n\nfinal class EditorBlocks\n{\n /** @var ArrayCollection */\n private $blocks;\n\n ...
php
chosen
[ { "from": "human", "value": "ORDER BY clause API code-coverage\n" }, { "from": "gpt", "value": "<?php\n\nclass Order_test extends CI_TestCase {\n\n\t/**\n\t * @var object Database/Query Builder holder\n\t */\n\tprotected $db;\n\n\tpublic function set_up()\n\t{\n\t\t$this->db = Mock_Database_Sche...
php
chosen
[ { "from": "human", "value": "Define expectation for traits details test\n" }, { "from": "gpt", "value": "<?php\n\nnamespace fennecweb\\ajax\\details;\n\nuse \\fennecweb\\WebService as WebService;\n\nclass TraitsTest extends \\PHPUnit_Framework_TestCase\n{\n\n public function testExecute()\n ...
php
chosen
[ { "from": "human", "value": "Fix Trl+Cc: Directories Top limit\n" }, { "from": "gpt", "value": "<?php\nclass Kwc_Directories_Top_Trl_Cc_Component extends Kwc_Directories_List_Trl_Cc_Component\n{\n public function getSelect()\n {\n $select = parent::getSelect();\n if (!$select...
php
chosen
[ { "from": "system", "value": "Fix issue where false was not being returned\n" }, { "from": "human", "value": "<?php namespace Anomaly\\BooleanFieldType;\n\nuse Anomaly\\Streams\\Platform\\Addon\\FieldType\\FieldType;\n\n/**\n * Class BooleanFieldType\n *\n * @link http://anomaly.is/stre...
php
chosen
[ { "from": "human", "value": "Add console command to fill in keywords for news.\n" }, { "from": "gpt", "value": "<?php\n\nnamespace console\\controllers;\n\nuse Yii;\nuse yii\\console\\Controller;\nuse frontend\\models\\News;\n\nclass NewskeywordsController extends Controller\n{\n public funct...
php
chosen
[ { "from": "human", "value": "Make interface for transforming output." }, { "from": "gpt", "value": "<?php\n\ndeclare(strict_types=1);\n\nnamespace mcordingley\\Regression;\n\ninterface OutputTransformer\n{\n /**\n * delinearize\n *\n * Converts the incoming value out of linear spa...
php
chosen
[ { "from": "human", "value": "Introduce a marker exception for the bundle\n" }, { "from": "gpt", "value": "<?php declare(strict_types=1);\n\nnamespace Gos\\Bundle\\WebSocketBundle\\Exception;\n\n/**\n * Marker interface for all exceptions thrown by the websocket bundle.\n */\ninterface WebsocketE...
php
chosen
[ { "from": "human", "value": "Add file: output black image\n" }, { "from": "gpt", "value": "<?php\n\t$image = new Imagick();\n\t$image->newImage(200, 100, 'black');\n\t$image->setImageFormat('png32');\n\t$image->setOption(\"png:format\", 'png32');\n?>\n<!DOCTYPE html>\n<html>\n<head>\n\t<meta cha...
php
chosen
[ { "from": "human", "value": "Add unique 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 unique Mimic library function.\n *\n * @since 0.1.0\n */\nclass UniqueFuncTest ex...
php
chosen
[ { "from": "human", "value": "Make interface for transforming input." }, { "from": "gpt", "value": "<?php\n\ndeclare(strict_types=1);\n\nnamespace mcordingley\\Regression;\n\ninterface InputTransformer\n{\n /**\n * linearize\n *\n * Converts the incoming value into a linear space s...
php
chosen
[ { "from": "human", "value": "Add example to download preview\n" }, { "from": "gpt", "value": "<?php\n\nuse Jumbo\\Client\\AssetsClient;\n\n$config = require realpath(__DIR__ . '/../bootstrap.php');\n\n$assetId = @$_GET['asset_id'] ?: '44444444-aaaa-4444-aaaa-444444444444';\n$expireAfter = @$_GET...
php
chosen
[ { "from": "system", "value": "Use commas for the CSV Reader\n\nSince CSV means comma separated values it seems only logical that its the default. A similar change was made against the CsvReader awhile back and I just noticed the CsvReaderFactory has the same issue." }, { "from": "human", "value"...
php
chosen
[ { "from": "human", "value": "Add tests for image model\n" }, { "from": "gpt", "value": "<?php declare(strict_types=1);\nnamespace ImboClient\\Response;\n\nuse DateTime;\nuse ImboClient\\Response\\Images\\Image;\nuse PHPUnit\\Framework\\TestCase;\n\n/**\n * @coversDefaultClass ImboClient\\Respons...
php
chosen
[ { "from": "system", "value": "Add square brackets [] to list of special characters that are not escaped" }, { "from": "human", "value": "<?php\n\nnamespace {\n if (!function_exists('mb_parse_url')) {\n /**\n * UTF-8 aware parse_url() replacement.\n *\n * Taken f...
php
chosen
[ { "from": "human", "value": "Add a product in a postUp() during migration\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Application\\Migrations;\n\nuse Doctrine\\DBAL\\Migrations\\AbstractMigration;\nuse Doctrine\\DBAL\\Schema\\Schema;\nuse Symfony\\Component\\DependencyInjection\\Containe...
php
chosen
[ { "from": "human", "value": "Add a file to show the hooks for islandora_bookmark.\n" }, { "from": "gpt", "value": "<?php\n\n/**\n * @file\n * Hooks provided by Islandora Bookmark.\n */\n\n/**\n * Hook to collect exports functions available for use.\n *\n * @return\n * Returns an array w...
php
chosen
[ { "from": "human", "value": "Add default model for active record\n" }, { "from": "gpt", "value": "<?php\n\nclass ActiveRecord extends CActiveRecord{\n\t/**\n\t * Some tricks before it's saved\n\t **/\n\tpublic function beforeSave(){\n if($this->isNewRecord){\n $this->create_time ...
php
chosen
[ { "from": "human", "value": "Add exception for serializing unserializable exceptions.\n\nThe SimpleSAML_Error_Exception class is a base class for serializable\nexceptions. This patch adds SimpleSAML_Error_UnserializableException.\nThat class saves some of the information from an Exception and saves it\nin a...
php
chosen
[ { "from": "human", "value": "Add user resource model. Untested\n" }, { "from": "gpt", "value": "<?php\n\nclass User extends EActiveResource\n{\n public $id;\n\n public static function model($classname=__CLASS__)\n {\n return parent::model($classname);\n }\n\n public functio...
php
chosen
[ { "from": "human", "value": "Create a List Command for repositories\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>\...
php
chosen
[ { "from": "system", "value": "Add missed typehint for Request\n" }, { "from": "human", "value": "<?php\n\n/**\n * Container for multiple EventCommentReportModel objects\n */\nclass EventCommentReportModelCollection extends AbstractModelCollection\n{\n protected $list = array();\n protected...
php
chosen
[ { "from": "human", "value": "Revert \"refactor: removed not used bootstrap file\"\n\nThis reverts commit 01d3eef\n" }, { "from": "gpt", "value": "<?php\ndeclare(strict_types=1);\n/**\n * /tests/bootstrap_fastest.php\n *\n * @package App\\Tests\n * @author TLe, Tarmo Leppänen <tarmo.leppanen@pro...
php
chosen
[ { "from": "system", "value": "Use a sha1 as key.\n" }, { "from": "human", "value": "<?php\n\nnamespace Prometheus;\n\n\nclass Sample\n{\n private $name;\n private $labelNames;\n private $labelValues;\n private $value;\n\n public function __construct(array $data)\n {\n $t...
php
chosen
[ { "from": "human", "value": ":white_check_mark: Add test for CanBuildBaseString trait.\n" }, { "from": "gpt", "value": "<?php\n\nuse PHPUnit\\Framework\\TestCase;\nuse Risan\\OAuth1\\Signature\\CanBuildBaseString;\nuse Risan\\OAuth1\\Signature\\BaseStringBuilderInterface;\n\nclass CanBuildBaseSt...
php
chosen
[ { "from": "human", "value": "Add a comparator to help with writing tests\n" }, { "from": "gpt", "value": "<?php\n\nnamespace MyCLabs\\Enum\\PHPUnit;\n\nuse MyCLabs\\Enum\\Enum;\nuse SebastianBergmann\\Comparator\\ComparisonFailure;\n\n/**\n * Use this Comparator to get nice output when using PHP...
php
chosen
[ { "from": "human", "value": "Add a DEMO database script\n" }, { "from": "gpt", "value": "<?php\n\n$db_host = 'p2-db1.dev';\n$db_user = 'drupal_user'\n$db_password = 'drupal_user'\n$db_name = 'drupal_db';\n$db = @mysqli_connect($db_host, $db_user, $db_password, $db_name) OR die ('Could not connec...
php
chosen
[ { "from": "human", "value": "Add non dev entry point\n" }, { "from": "gpt", "value": "<?php\nuse vsc\\infrastructure\\vsc;\n\n$iStart\t\t= microtime(true);\n$sContent \t= '';\n\ndate_default_timezone_set('UTC');\n\nerror_reporting (E_ALL); ini_set('display_errors', 0);\n\nchdir(dirname(__FILE__)...
php
chosen
[ { "from": "human", "value": "Add sortable model trait to easy implementation of the applySortOrderMapping method\n" }, { "from": "gpt", "value": "<?php declare(strict_types=1);\n\nnamespace Becklyn\\RadBundle\\Model;\n\n/**\n * Trait for doctrine models that use a sortable handler\n */\ntrait So...
php
chosen
[ { "from": "human", "value": "Add script for reproducing bug\n" }, { "from": "gpt", "value": "<?php\n\nrequire __DIR__ . '/../../vendor/autoload.php';\n\nuse mpyw\\Co\\Co;\nuse mpyw\\Co\\CURLException;\n\nclass TerminatedException extends \\RuntimeException {}\n\nCo::wait(function () {\n try {...
php
chosen
[ { "from": "human", "value": "Add migration for configured institutions\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Surfnet\\StepupMiddleware\\Migrations;\n\nuse Doctrine\\DBAL\\Migrations\\AbstractMigration;\nuse Doctrine\\DBAL\\Schema\\Schema;\n\n/**\n * Auto-generated Migration: Please...
php
chosen
[ { "from": "human", "value": "Add converter PT to CAMI." }, { "from": "gpt", "value": "<?php\nnamespace MCC\\Command;\n\nuse \\Symfony\\Component\\Console\\Input\\InputInterface;\nuse \\Symfony\\Component\\Console\\Output\\OutputInterface;\nuse \\MCC\\Command\\Base;\n\nclass ToCami extends Base\n...
php
chosen