conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "human", "value": "Create table for article views snapshots\n\nremp/remp#442\n" }, { "from": "gpt", "value": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migrations\\Migration;\n\nclass CreateArticleViewsSn...
php
chosen
[ { "from": "human", "value": "Add tests for the local adapter\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Gaufrette\\Filesystem\\Adapter;\n\nclass LocalTest extends \\PHPUnit_Framework_TestCase\n{\n public function testComputePath()\n {\n $directory = __DIR__ . '/filesystem';...
php
chosen
[ { "from": "system", "value": "Handle protocol errors and disconnect client" }, { "from": "human", "value": "<?php\n\nnamespace Clue\\Redis\\React;\n\nuse Evenement\\EventEmitter;\nuse React\\Stream\\Stream;\nuse Clue\\Redis\\Protocol\\ProtocolInterface;\nuse React\\Promise\\Deferred;\n\nclass Cl...
php
chosen
[ { "from": "human", "value": "Add support of custom data\n" }, { "from": "gpt", "value": "<?php\n\n/**\n* This custom class must be placed in the folder /AlloPass/Hipay/Helper\n* You have to personalize the method getCustomData and return an json of your choice.\n* \n*/\nclass ...
php
chosen
[ { "from": "human", "value": "Add class to hold the version number\n" }, { "from": "gpt", "value": "<?php\n/**\n * PHP SMS\n *\n * @author Jacques Marneweck <jacques@siberia.co.za>\n * @copyright 2020 Jacques Marneweck. All rights strictly reserved.\n */\n\ndeclare(strict_types=1);\n\nnamespa...
php
chosen
[ { "from": "human", "value": "Add template for rendering event contact information\n" }, { "from": "gpt", "value": "<?php \n$contactInfo = array(); \nforeach (array('listingcontactname', 'listingcontactphone') as $property) {\n if (isset($context->event->$property)) {\n $contactInfo[] =...
php
chosen
[ { "from": "human", "value": "Schema: Enlarge users.timezone to store tz names\n" }, { "from": "gpt", "value": "<?php\n\nclass UsersEnlargeTimezone extends CakeMigration {\n\n/**\n * Migration description\n *\n * @var string\n * @access public\n */\n\tpublic $description = 'Updating User timezone...
php
chosen
[ { "from": "human", "value": "Add password policy error constants.\n" }, { "from": "gpt", "value": "<?php\n/**\n * This file is part of the FreeDSx package.\n *\n * (c) Chad Sikorra <Chad.Sikorra@gmail.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file t...
php
chosen
[ { "from": "human", "value": "Add the First.php controller and add index() method.\n\nSigned-off-by: Wilson Lau <51ca10b964eb3f90521acbc5ab4d054ef62a94b4@gmail.com>\n" }, { "from": "gpt", "value": "<?php\n\ndefined('BASEPATH') OR exit('No direct script access allowed');\n\nclass First extends App...
php
chosen
[ { "from": "human", "value": "Create cart concepts folder, add cart view concept\n" }, { "from": "gpt", "value": "<h1>Basket</h1>\n\n@if($cart->hasItems())\n<table>\n <tr>\n <th>Description</th>\n <th>Unit Price</th>\n <th>Quantity</th>\n <th>Net Price</th>\n </t...
php
chosen
[ { "from": "human", "value": "Add example to sent a request to google.com\n" }, { "from": "gpt", "value": "<?php\n\nuse RingCentral\\Psr7\\Response;\nuse RingCentral\\Psr7\\Request;\nuse Legionth\\React\\Http\\Client;\n\nrequire __DIR__ . '/../vendor/autoload.php';\n\n$loop = React\\EventLoop\\Fa...
php
chosen
[ { "from": "human", "value": "Add command to migrate user passwords (mongodb only)\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Bundle\\DoctrineUserBundle\\Command;\n\nuse Symfony\\Bundle\\FrameworkBundle\\Command\\Command as BaseCommand;\nuse Symfony\\Component\\Console\\Input\\InputArgum...
php
chosen
[ { "from": "human", "value": "Test asset: class with a `void` return type\n" }, { "from": "gpt", "value": "<?php\n/*\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTI...
php
chosen
[ { "from": "human", "value": "Add eventListener for sticky locale during user session\n" }, { "from": "gpt", "value": "<?php\n\nnamespace AppBundle\\EventListener;\n\nuse Symfony\\Component\\HttpKernel\\Event\\GetResponseEvent;\nuse Symfony\\Component\\HttpKernel\\KernelEvents;\nuse Symfony\\Comp...
php
chosen
[ { "from": "human", "value": "Add test for the console application\n" }, { "from": "gpt", "value": "<?php\n\nnamespace OckCyp\\CoversValidator\\Tests\\Application;\n\nuse OckCyp\\CoversValidator\\Application\\CoversValidator;\nuse OckCyp\\CoversValidator\\Tests\\BaseTestCase;\n\nclass CoversValid...
php
chosen
[ { "from": "human", "value": "Add test script for Loader\n" }, { "from": "gpt", "value": "<?php\n\n/**\n * ATUI - tests\n * This is the scripts to test reporter::Loader\n * @author peter<peter.ziv@hotmail.com>\n */\n\nuse PHPUnit\\Framework\\TestCase;\n\nrequire_once __DIR__.'/../../src/reporter/...
php
chosen
[ { "from": "human", "value": "Copy weapon IDs of SplatNet2 to Splatoon 3's weapon\n" }, { "from": "gpt", "value": "<?php\n\n/**\n * @copyright Copyright (C) 2015-2022 AIZAWA Hina\n * @license https://github.com/fetus-hina/stat.ink/blob/master/LICENSE MIT\n * @author AIZAWA Hina <hina@fetus.jp>\n ...
php
chosen
[ { "from": "human", "value": "Add server stats request handler\n" }, { "from": "gpt", "value": "<?php declare(strict_types=1);\n\nnamespace hollodotme\\Readis\\Application\\Web\\Server\\Read;\n\nuse hollodotme\\Readis\\Application\\Web\\AbstractRequestHandler;\nuse hollodotme\\Readis\\Application...
php
chosen
[ { "from": "system", "value": "Set the Cachet nav header to go back to the dashboard\n" }, { "from": "human", "value": "<nav class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n <div class=\"container-fluid\">\n <div class=\"navbar-header\">\n <button type=...
php
chosen
[ { "from": "human", "value": "Make migration to append alias column to vn table\n" }, { "from": "gpt", "value": "<?php\n\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migrations\\Migration;\n\nclass UpdateVnTable extends Migration\n{\n /**\n * Run the migrations....
php
chosen
[ { "from": "human", "value": "Add test for new command list-webuser\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Tests\\AppBundle\\Command;\n\n\nuse AppBundle\\Command\\ListWebuserCommand;\nuse Symfony\\Bundle\\FrameworkBundle\\Console\\Application;\nuse Symfony\\Bundle\\FrameworkBundle\\T...
php
chosen
[ { "from": "human", "value": "Create tests for the Storage factory class.\n\nCreated tests for the storage factory class.\n" }, { "from": "gpt", "value": "<?php namespace Codesleeve\\Stapler\\Factories;\n\nuse PHPUnit_Framework_TestCase;\nuse Symfony\\Component\\HttpFoundation\\File\\UploadedFile...
php
chosen
[ { "from": "human", "value": "test: Add a router script for the built-in server to initialize SSP's configuration.\n\nWith this script, which will be executed for every request performed to the built-in server, we can preload the configuration from a temporary file, making it possible to configure SimpleSAML...
php
chosen
[ { "from": "human", "value": "Add create command for FOSUsers.\n" }, { "from": "gpt", "value": "<?php\n// src/AppBundle/Command/CreateUsersCommand.php\nnamespace AppBundle\\Command;\n\nuse AppBundle\\Entity\\FOSUser;\nuse Composer\\Installer\\PackageEvent;\nuse Symfony\\Component\\Console\\Comman...
php
chosen
[ { "from": "human", "value": "[DDC-1040] Add regression tests for entity as multiple named/positional parameters.\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Doctrine\\Tests\\ORM\\Functional\\Ticket;\n\nuse Doctrine\\Common\\Collections\\ArrayCollection;\nuse Doctrine\\Tests\\Models\\CMS\...
php
chosen
[ { "from": "human", "value": "Add failing test for DDC-1787.\n\nUsing joined table inheritance, when persisting multiple new entities\nthat are subclasses of a baseclass that has the @Version attribute set,\nonly the last persisted entity will have it's version set.\n" }, { "from": "gpt", "value"...
php
chosen
[ { "from": "system", "value": "Use the status constant for the return code\n" }, { "from": "human", "value": "<?php\n$_PCONN['cnt']++;\nif (function_exists('zend_thread_id')) {\n echo \"thread \", zend_thread_id(), \"\\n\";\n} else {\n echo \"main\\n\";\n}\n" }, { "from": "gpt", ...
php
chosen
[ { "from": "human", "value": "Add migration to make all CITI ID fields signed\n\nApparently, some CITI IDs are negative. It seems that CITI started off\nusing signed IDs, but at some point a decision was made to expand the\nrange by starting at the lower bound of the number range, rather than\nat zero as ori...
php
chosen
[ { "from": "human", "value": "Add controller action to handle list of assemblies\n" }, { "from": "gpt", "value": "<?php\n\nnamespace App\\Http\\Controllers;\n\nuse SplTempFileObject;\nuse League\\Csv\\Writer;\nuse App\\Models\\Assembly;\nuse Illuminate\\Http\\Request;\n\nclass AssembliesControlle...
php
chosen
[ { "from": "human", "value": "Add first iteration of config\n" }, { "from": "gpt", "value": "<?php\r\nnamespace Simox;\r\n\r\nclass Config extends SimoxServiceBase implements \\ArrayAccess\r\n{\r\n\tpublic function __construct( $config_array = array() )\r\n {\r\n foreach ( $config_array...
php
chosen
[ { "from": "human", "value": "Add default task list implementation\n" }, { "from": "gpt", "value": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Phpcq\\Task;\n\n/**\n * Default task list implementation.\n */\nclass Tasklist implements TasklistInterface\n{\n /**\n * @var TaskRunnerInterfa...
php
chosen
[ { "from": "human", "value": "Test a bit the Log class, as proof of concept\n" }, { "from": "gpt", "value": "<?php\nrequire_once __DIR__.'/../vendor/autoload.php';\n\nuse Aftertime\\Log;\n\nclass LogTest extends PHPUnit_Framework_TestCase {\n\t// Not complete\n\tpublic function test_log_file() {\...
php
chosen
[ { "from": "human", "value": "Create factory methods for DynamicIdentifiers\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Monospice\\SpicyIdentifiers;\n\nuse Monospice\\SpicyIdentifiers\\DynamicIdentifier;\nuse Monospice\\SpicyIdentifiers\\Tools\\CaseFormat;\nuse Monospice\\SpicyIdentifiers...
php
chosen
[ { "from": "human", "value": "Add functionality for profile picture" }, { "from": "gpt", "value": "<?php\r\n/**\r\n * Created by PhpStorm.\r\n * User: Catalin\r\n * Date: 03-Jun-17\r\n * Time: 13:59\r\n */\r\n\r\ninclude (\"../../BACK/conectare_db.php\");\r\n\r\n$username = $_SESSION[\"username\"...
php
chosen
[ { "from": "system", "value": "Add helper method to count number of matches" }, { "from": "human", "value": "<?php\n\nabstract class AlgorithmMM extends Algorithm {\n\n /**\n * Origianl graph\n * \n * @var Graph\n */\n protected $graph;\n \n /**\n * The given graph...
php
chosen
[ { "from": "system", "value": "Drop js for subject field\n" }, { "from": "human", "value": "<div class=\"editor-container\">\n {{ Form::textarea('code', null, ['class' => 'editor mousetrap', 'wrap' => 'off']) }}\n</div>\n<div id=\"subjectDiv\" style=\"position: absolute; bottom: 0;left: 0;\">\...
php
chosen
[ { "from": "human", "value": "Add tests with 100% code coverage for new Algorithm\\Balance" }, { "from": "gpt", "value": "<?php\n\nuse Fhaculty\\Graph\\Algorithm\\Balance as BalanceAlgorithm;\nuse Fhaculty\\Graph\\Graph;\n\nclass BalanceTest extends TestCase\n{\n public function testGraphEmpty...
php
chosen
[ { "from": "human", "value": "Add a generic controller to read the Afrikapié texts\n" }, { "from": "gpt", "value": "<?php\n\nnamespace App\\Controller;\n\nuse Silex\\Api\\ControllerProviderInterface;\nuse Symfony\\Component\\HttpFoundation\\Request;\nuse Symfony\\Component\\HttpFoundation\\Respon...
php
chosen
[ { "from": "human", "value": "Allow to load file from fs\n" }, { "from": "gpt", "value": "<?php\n\nreturn [\n 'mysql' => [\n 'dbname' => 'test',\n 'user' => 'root',\n 'password' => '',\n 'host' => 'localhost',\n 'driver' => 'pdo_mysql',\n ],\n 'sqlite' ...
php
chosen
[ { "from": "human", "value": "Remove boolean 'board' from members table as we use the member roles to define this now.\n" }, { "from": "gpt", "value": "<?php\n\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migrations\\Migration;\n\nclass DropBoardFromMembers extends Mig...
php
chosen
[ { "from": "human", "value": "Add a parent for the social controllers.\n" }, { "from": "gpt", "value": "<?php\n\n$title = \"Boooobs in $controller\";\n$description = \"Find all the boobs in \" . ucwords($controller);\n\n$css_files['header'][] = '/css/grids.css';\n$css_files['header'][] = '/css/me...
php
chosen
[ { "from": "human", "value": "III-447: Add CultureFeed implementation of UsersInterface\n" }, { "from": "gpt", "value": "<?php\n/**\n * @file\n */\n\nnamespace CultuurNet\\UDB3\\UiTID;\n\nuse ValueObjects\\String\\String;\nuse ValueObjects\\Web\\EmailAddress;\n\nclass CultureFeedUsers implements ...
php
chosen
[ { "from": "human", "value": "Add demo for new GtkInfoBar\n" }, { "from": "gpt", "value": "<?php\r\nif( !class_exists('gtk')) {\r\n die('Please load the php-gtk2 module in your php.ini' . \"\\r\\n\");\r\n} elseif (!class_exists('GtkInfoBar')) {\r\n return;\r\n}\r\n\r\n\r\nclass InfoBarBox e...
php
chosen
[ { "from": "human", "value": "Create a class to do the work of prediction." }, { "from": "gpt", "value": "<?php\n\ndeclare(strict_types=1);\n\nnamespace mcordingley\\Regression;\n\nuse mcordingley\\Regression\\Linking\\Identity;\n\nfinal class Predictor\n{\n private $coefficients;\n private...
php
chosen
[ { "from": "human", "value": "Rename andfunc.php to arithemtic.php it now uses the maybe monadd)\n" }, { "from": "gpt", "value": "<?php\n//Lifted versions of the arithmetic operators.\n//For doing arithemtic in the maybe monad.\n\ninclude_once('maybe.php');\n\nfunction add($a, $b) { \n\treturn Ma...
php
chosen
[ { "from": "human", "value": "Make it possible for admins and artist managers to create new albums" }, { "from": "gpt", "value": "<?php\n\n/* GNU FM -- a free network service for sharing your music listening habits\n\n Copyright (C) 2009 Free Software Foundation, Inc\n\n This program is free ...
php
chosen
[ { "from": "human", "value": "Add an event store usage example\n" }, { "from": "gpt", "value": "<?php\n\nrequire __DIR__ . '/../vendor/autoload.php';\n\nuse Ob\\Hex\\Domain\\Email;\nuse Ob\\Hex\\Domain\\MeetingRoom;\nuse Ob\\Hex\\Domain\\Reservation;\n\n\n// Create a meeting room with capacity fo...
php
chosen
[ { "from": "human", "value": "Add database migration for trios table.\n" }, { "from": "gpt", "value": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migrations\\Migration;\n\nclass CreateTriosTable extends Migration\n{\...
php
chosen
[ { "from": "human", "value": "Add migration to link Group entity with StudyForm entity\n" }, { "from": "gpt", "value": "<?php\n\nuse yii\\db\\Schema;\nuse yii\\db\\Migration;\n\nclass m150108_131628_modify_group_table extends Migration\n{\n public function up()\n {\n \t$this->addColumn('...
php
chosen
[ { "from": "human", "value": "Add engine displacement 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, pl...
php
chosen
[ { "from": "human", "value": "Add sample with both unsafe-inline and nonce\n" }, { "from": "gpt", "value": "<?php\nheader(\"Content-Security-Policy: script-src 'unsafe-inline' 'nonce-sXXD/nluT6AqhuVwL0IJqA=='\");\n?>\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<title>S...
php
chosen
[ { "from": "human", "value": "Return an array with elements in reverse order\n" }, { "from": "gpt", "value": "\n<?php\n$input = array(\"php\", 4.0, array(\"green\", \"red\"));\n$reversed = array_reverse($input);\n$preserved = array_reverse($input, true);\n\nprint_r($input);\nprint_r($reversed);\...
php
chosen
[ { "from": "system", "value": "Fix assertInternalType deprecation in phpunit 9\n" }, { "from": "human", "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 copyright and license information, please view the LIC...
php
chosen
[ { "from": "human", "value": "Add migration for Specialty entity\n" }, { "from": "gpt", "value": "<?php\n\nuse yii\\db\\Schema;\nuse yii\\db\\Migration;\n\nclass m141216_153407_create_specialty_table extends Migration\n{\n public function up()\n {\n $tableOptions = null;\n if ...
php
chosen
[ { "from": "human", "value": "Add test for PHP 7.1 nullable types\n" }, { "from": "gpt", "value": "<?php\nnamespace Psalm\\Tests;\n\nuse PhpParser\\ParserFactory;\nuse PHPUnit_Framework_TestCase;\nuse Psalm\\Checker\\FileChecker;\nuse Psalm\\Config;\nuse Psalm\\Context;\n\nclass Php71Test extends...
php
chosen
[ { "from": "human", "value": "Add test for tagged bots\n\nSigned-off-by: Stéphane HULARD <a24f38cb8c57ec2778c80a9f0c151933508927e5@chstudio.fr>\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Test\\Bee4\\UserAgent\\Classifier\\Bots;\n\nuse Bee4\\UserAgent\\Classifier\\Bots\\AbstractTaggedBot;...
php
chosen
[ { "from": "human", "value": "Add test for Task Runner trait\n" }, { "from": "gpt", "value": "<?php\n\nuse Aedart\\Scaffold\\Traits\\TaskRunner as TaskRunnerTrait;\nuse Aedart\\Testing\\Laravel\\TestCases\\unit\\GetterSetterTraitTestCase;\nuse Mockery as m;\n\n/**\n * Class TaskRunnerTraitTest\n ...
php
chosen
[ { "from": "system", "value": "Fix that HTTP status code was not passed on\n\nThe bootstrap file is supposed to return the HTTP status code to send to the browser, because `http_response_code()` is only available as of PHP 5.4.\r\n\r\nThis return value was not passed on from the anonymous function to the Res...
php
chosen
[ { "from": "human", "value": "Add test for image optimization strategy\n" }, { "from": "gpt", "value": "<?php\nnamespace Czim\\FileHandling\\Test\\Unit\\Variant\\Strategies;\n\nuse Czim\\FileHandling\\Contracts\\Storage\\ProcessableFileInterface;\nuse Czim\\FileHandling\\Support\\Image\\Optimizer...
php
chosen
[ { "from": "human", "value": "Add concrete implementation of template\n" }, { "from": "gpt", "value": "<?php namespace Aedart\\Scaffold\\Templates;\n\nuse Aedart\\DTO\\DataTransferObject;\nuse Aedart\\Model\\Traits\\Strings\\IdTrait;\nuse Aedart\\Model\\Traits\\Strings\\SourceTrait;\nuse Aedart\\...
php
chosen
[ { "from": "human", "value": "Add migration to create is_deceased flag\n" }, { "from": "gpt", "value": "<?php\n\nclass m160614_085916_patient_is_deceased_flag extends OEMigration\n{\n\tpublic function up()\n\t{\n\t\t$this->addColumn('patient', 'is_deceased', 'tinyint not null default 0');\n\t\t$t...
php
chosen
[ { "from": "system", "value": "Remove bug in autorunner management in PHAR.\n" }, { "from": "human", "value": "<?php\n\nnamespace mageekguy\\atoum;\n\nuse\n\tmageekguy\\atoum,\n\tmageekguy\\atoum\\scripts\\phar\n;\n\nif (extension_loaded('phar') === false)\n{\n\tthrow new \\runtimeException('Phar...
php
chosen
[ { "from": "human", "value": "BAP-10780: Access to the application on behalf of the user\n\n- add oro:user:list command\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Oro\\Bundle\\UserBundle\\Command;\n\nuse Symfony\\Bundle\\FrameworkBundle\\Command\\ContainerAwareCommand;\nuse Symfony\\Comp...
php
chosen
[ { "from": "human", "value": "Advance the internal array pointer of an array\n" }, { "from": "gpt", "value": "\n<?php\n$transport = array('foot', 'bike', 'car', 'plane');\n$mode = current($transport); // $mode = 'foot';\n$mode = next($transport); // $mode = 'bike';\n$mode = next($transport); ...
php
chosen
[ { "from": "human", "value": "Add helper trait to provide type-hinting for zend-view\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Zend\\I18n\\View;\n\nuse IntlDateFormatter;\n\n// @codingStandardsIgnoreStart\n/**\n * Trait HelperTrait\n *\n * The trait provides convenience methods for view...
php
chosen
[ { "from": "human", "value": "Create Multiply A Number By Two\n" }, { "from": "gpt", "value": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <title>First Steps Into PHP</title>\n</head>\n\n<body>\n<form>\n N: <input type=\"text\" name=\"num\" />\n <input typ...
php
chosen
[ { "from": "human", "value": "Add constructor test for AbstractCollection\n\nSigned-off-by: Tom Van Herreweghe <96835dd8bfa718bd6447ccc87af89ae1675daeca@theanalogguy.be>\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Tests\\PHPExif\\Common\\Collection;\n\nuse Mockery as m;\nuse PHPExif\\Comm...
php
chosen
[ { "from": "human", "value": "Add integration test for BulkWrite\n" }, { "from": "gpt", "value": "<?php\nnamespace Mongolid\\Tests\\Integration;\n\nuse MongoDB\\BSON\\ObjectId;\nuse MongoDB\\Driver\\WriteResult;\nuse Mongolid\\Query\\BulkWrite;\nuse Mongolid\\Tests\\Stubs\\ReferencedUser;\n\nclas...
php
chosen
[ { "from": "human", "value": "Load jQuery from Google's CDN with a local fallback\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Roots\\Soil\\JqueryCDN;\n\n/**\n * Load jQuery from Google's CDN with a local fallback\n *\n * You can enable/disable this feature in functions.php (or lib/config....
php
chosen
[ { "from": "human", "value": "Enable using a simple string as a sha hash\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Turanct\\Shack;\n\nfinal class String implements Sha\n{\n /**\n * @var string The sha string\n */\n private $string;\n\n /**\n * Constructor\n *\n ...
php
chosen
[ { "from": "human", "value": "Add plugin for creating 'topics' custom taxonomy for\n" }, { "from": "gpt", "value": "<?php\n/*Plugin Name: Create Custom Taxonomy for Tips\nDescription: This plugin registers the 'topics' custom taxonomy.\nVersion: 1.0\nLicense: GPLv2\n*/\n\n// Register Custom Taxon...
php
chosen
[ { "from": "human", "value": "Add custom exception when a Region has not been set to a valid value\n" }, { "from": "gpt", "value": "<?php\n\n\nnamespace BlizzardGalaxy\\ApiSupervisor\\Exception;\n\n/**\n * Class RegionException\n *\n * @package BlizzardGalaxy\\ApiSupervisor\\Exception\n * @author...
php
chosen
[ { "from": "human", "value": "Add the logistic function as a linking function." }, { "from": "gpt", "value": "<?php\n\nnamespace mcordingley\\Regression\\Linking;\n\nclass Logistic implements LinkingInterface\n{\n public function delinearize($value)\n {\n return 1.0 / (1.0 + exp(-$va...
php
chosen
[ { "from": "system", "value": "Fix Translation Checker for Recursive folders\n" }, { "from": "human", "value": "<?php\n\nfunction isJson($filename) {\n $string = file_get_contents($filename);\n json_decode($string);\n return (json_last_error() == JSON_ERROR_NONE);\n}\n\nfunction translat...
php
chosen
[ { "from": "human", "value": "Add unit test for new splitCodeIntoArray function\n\n" }, { "from": "gpt", "value": "<?php\n\nclass HighlightUtilitiesTest extends PHPUnit_Framework_TestCase\n{\n /** @var \\Highlight\\Highlighter */\n private $hl;\n\n protected function setUp()\n {\n ...
php
chosen
[ { "from": "human", "value": "Create feature test for Recurring model that tests viewing a recurring as an authorized user\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Tests\\Feature;\n\nuse App\\Recurring;\nuse App\\Space;\nuse App\\User;\nuse Tests\\TestCase;\nuse Illuminate\\Foundation\...
php
chosen
[ { "from": "human", "value": "BAP-10613: Move Locale Entity from Commerce to Platform\n- Added unit test for Entity\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Oro\\Bundle\\LocaleBundle\\Tests\\Unit\\Entity;\n\nuse Oro\\Bundle\\LocaleBundle\\Entity\\LocaleSet;\nuse Oro\\Component\\Testing...
php
chosen
[ { "from": "human", "value": "Add migration to add signup_id to events table\n" }, { "from": "gpt", "value": "<?php\n\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migrations\\Migration;\n\nclass AddSignupIdToEventsTable extends Migration\n{\n /**\n * Run the mig...
php
chosen
[ { "from": "human", "value": "Add new test for ClassMetadataCollection\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Tomahawk\\Bundle\\DoctrineBundle\\Tests;\n\nuse Doctrine\\ORM\\Mapping\\ClassMetadataInfo;\nuse Tomahawk\\Bundle\\DoctrineBundle\\Mapping\\ClassMetadataCollection;\nuse Tomah...
php
chosen
[ { "from": "human", "value": "Test assets required for strict parameter checking\n" }, { "from": "gpt", "value": "<?php\n/*\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED W...
php
chosen
[ { "from": "human", "value": "Add default definition of CRUD machine using annotations\n" }, { "from": "gpt", "value": "<?php declare(strict_types = 1);\n/*\n * Copyright (c) 2019, Josef Kufner <josef@kufner.cz>\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you ma...
php
chosen
[ { "from": "system", "value": "Update migrations to insert sample categories\n" }, { "from": "human", "value": "<?php\n\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migrations\\Migration;\n\nclass CreateForumTableCategories extends Migration {\n\n\t/**\n\t * Run the mi...
php
chosen
[ { "from": "human", "value": "Test that aliases/facades are defined correctly\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Concrete\\Tests\\Config;\n\nuse PHPUnit_Framework_TestCase;\n\nclass ValuesTest extends PHPUnit_Framework_TestCase\n{\n public function provideConfiguredAliases()\n...
php
chosen
[ { "from": "human", "value": "Include PHP as example language\n" }, { "from": "gpt", "value": "```php\n\n$client = new \\GuzzleHttp\\Client();\n$response = $client->{{ strtolower($route['methods'][0]) }}(\"{{ $route['boundUri'] }}\", [\n@if(!empty($route['headers']))\n 'headers' => [\n @for...
php
chosen
[ { "from": "human", "value": "Set oc_share_external.name column length to 4000 to remove arbitrary limitation\n\nSigned-off-by: Côme Chilliet <65266482bbd411837c7b5a3a962855e6c075a719@nextcloud.com>\n" }, { "from": "gpt", "value": "<?php\n\ndeclare(strict_types=1);\n\n/**\n * @copyright Copyright...
php
chosen
[ { "from": "system", "value": "[HttpKernel] Fix service arg resolver for controllers as array callables\n" }, { "from": "human", "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 copyright and license informa...
php
chosen
[ { "from": "human", "value": "Put back in the templates\n" }, { "from": "gpt", "value": "<?php\n\n// Make sure we are called from index.php\nif (!defined('SECURITY')) die('Hacking attempt');\n\n// Check user to ensure they are admin\nif (!$user->isAuthenticated() || !$user->isAdmin($_SESSION['USE...
php
chosen
[ { "from": "human", "value": "Introduce marker interface for controllers that require authentication loop throttling\n\nThe marker interface will be used to determine whether the authentication state is to be initialized in the session or not for the routed controller\n" }, { "from": "gpt", "valu...
php
chosen
[ { "from": "human", "value": "FIX: Remove access key fields that are not required\n\nConflicts:\n\n\tcode/AccessKeysSiteConfig.php\n" }, { "from": "gpt", "value": "<?php\n \nclass AccessKeysSiteConfig extends DataObjectDecorator {\n \n function extraStatics() {\n return array(\n ...
php
chosen
[ { "from": "human", "value": "Add test for the urlvalidator\n" }, { "from": "gpt", "value": "<?php\n\nnamespace ForkCMS\\Bundle\\CoreBundle\\Tests\\Validator;\n\nuse ForkCMS\\Bundle\\CoreBundle\\Validator\\UrlValidator;\nuse PHPUnit\\Framework\\TestCase;\n\nclass UrlValidatorTest extends TestCase...
php
chosen
[ { "from": "human", "value": "Add a migration to fix all of the column defaults and allow NULL for users table\n" }, { "from": "gpt", "value": "<?php\n\nuse Phinx\\Migration\\AbstractMigration;\n\nclass AlterUserColumnDefaults extends AbstractMigration\n{\n\n /**\n * Migrate Up.\n */\n...
php
chosen
[ { "from": "human", "value": "Add php using s3 bucket as a web host example\n" }, { "from": "gpt", "value": "<?php\n/**\n * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * This file is licensed under the Apache License, Version 2.0 (the \"License\").\n * You m...
php
chosen
[ { "from": "human", "value": "Add test case for ArrayObjects.\n" }, { "from": "gpt", "value": "<?php\n/**\n * Created by PhpStorm.\n * User: jasondent\n * Date: 15/09/15\n * Time: 10:39\n */\n\nnamespace Revinate\\GetterSetter\\test;\n\nuse Revinate\\GetterSetter as gs;\n\nclass ArrayObjectTest e...
php
chosen
[ { "from": "human", "value": "Add PHPunit test base class.\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Droath\\ProjectX\\Tests;\n\nuse Droath\\ProjectX\\Filesystem\\YamlFilesystem;\nuse PHPUnit\\Framework\\TestCase;\nuse org\\bovigo\\vfs\\vfsStream;\n\n/**\n * Define Project-X test base c...
php
chosen
[ { "from": "human", "value": "Add Bootstrap level result encoder\n" }, { "from": "gpt", "value": "<?php\n\n/*\n * This file is part of the Active Collab Bootstrap project.\n *\n * (c) A51 doo <info@activecollab.com>. All rights reserved.\n */\n\nnamespace ActiveCollab\\Bootstrap\\ResultEncoder;\n...
php
chosen
[ { "from": "human", "value": ":sparkles: Add plain text signer class.\n" }, { "from": "gpt", "value": "<?php\n\nnamespace Risan\\OAuth1\\Signature;\n\nclass PlainTextSigner implements SignerInterface, KeyBasedSignerInterface\n{\n use CanGetSigningKey;\n\n /**\n * {@inheritdoc}\n */\...
php
chosen
[ { "from": "human", "value": "Add changes to get the occupation details out session for VC Service in OMA\n" }, { "from": "gpt", "value": "<?php\n\nnamespace AcademyHQ\\API\\Repository\\OMA;\n\nuse AcademyHQ\\API\\ValueObjects as VO;\nuse AcademyHQ\\API\\HTTP\\Request\\Request as Request;\nuse Gu...
php
chosen
[ { "from": "human", "value": "Add a SubscriberCore Model to be available everywhere for Profile Faker mod\n" }, { "from": "gpt", "value": "<?php\n/**\n * @author Pierre-Henry Soria <hello@ph7cms.com>\n * @copyright (c) 2019, Pierre-Henry Soria. All Rights Reserved.\n * @license ...
php
chosen
[ { "from": "human", "value": "Add patch to rewrite filestorage ids in attachments\n" }, { "from": "gpt", "value": "<?php\n\ndefined(\"_VALID_ACCESS\") || die('Direct access forbidden');\n\nDB::Execute('UPDATE utils_attachment_file af SET filestorage_id=(SELECT id FROM utils_filestorage WHERE link...
php
chosen
[ { "from": "human", "value": "Add unit tests for ContentfulDataCollector\n" }, { "from": "gpt", "value": "<?php\n/**\n * @copyright 2016 Contentful GmbH\n * @license MIT\n */\n\nnamespace Contentful\\ContentfulBundle\\Tests\\DataCollector;\n\nuse Contentful\\ContentfulBundle\\DataCollector\\Con...
php
chosen