Instruction
stringlengths
14
778
input_code
stringlengths
0
4.24k
output_code
stringlengths
1
5.44k
Make waiting message more precise
<?php error_reporting(E_ALL); ini_set('display_errors', 1); require_once __DIR__ . '/../vendor/autoload.php'; $connected = false; while (!$connected) { try { $app = \eCampApp::CreateSetup(); $sm = $app->getServiceManager(); /** @var \Doctrine\ORM\EntityManager $em */ $em = $sm->get...
<?php error_reporting(E_ALL); ini_set('display_errors', 1); require_once __DIR__ . '/../vendor/autoload.php'; $connected = false; while (!$connected) { try { $app = \eCampApp::CreateSetup(); $sm = $app->getServiceManager(); /** @var \Doctrine\ORM\EntityManager $em */ $em = $sm->get...
Remove remote access check for development needs
<?php use Symfony\Component\HttpFoundation\Request; // If you don't want to setup permissions the proper way, just uncomment the following PHP line // read http://symfony.com/doc/current/book/installation.html#configuration-and-setup for more information //umask(0000); // This check prevents access to debug front co...
<?php use Symfony\Component\HttpFoundation\Request; // If you don't want to setup permissions the proper way, just uncomment the following PHP line // read http://symfony.com/doc/current/book/installation.html#configuration-and-setup for more information //umask(0000); // This check prevents access to debug front co...
Add licencing info after captions
<?php global $gds_image_licences; $gds_image_licences = [ 'ogl' => 'OGL', 'cc-by' => 'Attribution', 'cc-by-sa' => 'Attribution-ShareAlike', 'cc-by-nd' => 'Attribution-NoDerivs', 'cc-by-nc' => 'Attribution-NonCommercial', 'cc-by-nc-sa' => 'Attribution-NonCommercial-ShareAlike', 'cc-by-nc-nd' => 'Attribut...
<?php global $gds_image_licences; $gds_image_licences = [ 'ogl' => 'OGL', 'cc-by' => 'Attribution', 'cc-by-sa' => 'Attribution-ShareAlike', 'cc-by-nd' => 'Attribution-NoDerivs', 'cc-by-nc' => 'Attribution-NonCommercial', 'cc-by-nc-sa' => 'Attribution-NonCommercial-ShareAlike', 'cc-by-nc-nd' => 'Attribut...
Add a 'use' statement for PHP 5.3 bug.
<?php namespace PureMachine\Bundle\WebServiceBundle\WebService; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use JMS\DiExtraBundle\Annotation\Inject; use JMS\DiExtraBundle\Annotation\InjectParams; use Symfony\Component\DependencyInjection\ContainerInterface; class SymfonyBaseWebService extends B...
<?php namespace PureMachine\Bundle\WebServiceBundle\WebService; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use JMS\DiExtraBundle\Annotation\Inject; use JMS\DiExtraBundle\Annotation\InjectParams; use Symfony\Component\DependencyInjection\ContainerInterface; use JMS\DiExtraBundle\Annotation\Servi...
Fix name of step method of a behat test
<?php namespace Bauhaus\Container; require __DIR__ . '/../bootstrap.php'; class RegistrableContainerUserContext extends ContainerUserBaseContext { /** * @When I register an item with label :label and value :value */ public function iRegisterANewItemWithLabelAndValue($label, $value) { $t...
<?php namespace Bauhaus\Container; require __DIR__ . '/../bootstrap.php'; class RegistrableContainerUserContext extends ContainerUserBaseContext { /** * @When I register an item with label :label and value :value */ public function iRegisterANewItemWithLabelAndValue($label, $value) { $t...
Add temporary class alias for Debugger.
<?php /** * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyrig...
<?php /** * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyrig...
Add default parameter limits to distribution to be overridden by implementing classes.
<?php namespace MathPHP\Probability\Distribution; use MathPHP\Functions\Support; abstract class Distribution { /** * Constructor * * @param number ...$params */ public function __construct(...$params) { $new_params = static::PARAMETER_LIMITS; $i = 0; foreach ($...
<?php namespace MathPHP\Probability\Distribution; use MathPHP\Functions\Support; abstract class Distribution { // Overridden by implementing classes const PARAMETER_LIMITS = []; /** * Constructor * * @param number ...$params */ public function __construct(...$params) { ...
Remove not needed stuff from PHPUnit bootstrap
<?php /* * This file bootstraps the test environment. */ namespace Doctrine\Tests; error_reporting(E_ALL | E_STRICT); if (file_exists(__DIR__ . '/../../../vendor/autoload.php')) { // dependencies were installed via composer - this is the main project $classLoader = require __DIR__ . '/../../../vendor/autolo...
<?php /* * This file bootstraps the test environment. */ error_reporting(E_ALL | E_STRICT); if (file_exists(__DIR__ . '/../../../vendor/autoload.php')) { // dependencies were installed via composer - this is the main project $classLoader = require __DIR__ . '/../../../vendor/autoload.php'; } elseif (file_exi...
Fix static db connection. Singleton pattern.
<?php /** * DronePHP (http://www.dronephp.com) * * @link http://github.com/Pleets/DronePHP * @copyright Copyright (c) 2016 DronePHP. (http://www.dronephp.com) * @license http://www.dronephp.com/license */ namespace Drone\Db; abstract class AbstractTableGateway { /** * Handle * * @var D...
<?php /** * DronePHP (http://www.dronephp.com) * * @link http://github.com/Pleets/DronePHP * @copyright Copyright (c) 2016 DronePHP. (http://www.dronephp.com) * @license http://www.dronephp.com/license */ namespace Drone\Db; abstract class AbstractTableGateway { /** * Handle * * @var D...
Use dephendency to load test dependencies.
<?php require('../../vendor.php'); require('ModuleTests.php'); \Phunit\Phunit::run();
<?php require('../bower_components/Dephendency/index.php'); require('ModuleTests.php'); \Phunit\Phunit::run();
Fix codestyle and use stripos to check starting with vowel
<?php namespace Codeception\Lib\Actor\Shared; trait Comment { public function expectTo($prediction) { return $this->comment('I expect to ' . $prediction); } public function expect($prediction) { return $this->comment('I expect ' . $prediction); } public function amGoingTo(...
<?php namespace Codeception\Lib\Actor\Shared; trait Comment { public function expectTo($prediction) { return $this->comment('I expect to ' . $prediction); } public function expect($prediction) { return $this->comment('I expect ' . $prediction); } public function amGoingTo(...
Implement default controller to redirect in function of role
<?php namespace Project\AppBundle\Controller; use Symfony\Component\HttpFoundation\Request; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Sensio\Bundle\FrameworkExtraBundle\Configur...
<?php namespace Project\AppBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; use JMS\SecurityExtraBundle\An...
Fix reloading the wrong session $var
<?php declare(strict_types=1); $session = Smr\Session::getInstance(); $var = $session->getCurrentVar(); $account = $session->getAccount(); // register game_id $session->updateGame($var['game_id']); $player = SmrPlayer::getPlayer($account->getAccountID(), $var['game_id']); $player->updateLastCPLAction(); // Check to...
<?php declare(strict_types=1); $session = Smr\Session::getInstance(); $var = $session->getCurrentVar(); $account = $session->getAccount(); // register game_id $session->updateGame($var['game_id']); $player = SmrPlayer::getPlayer($account->getAccountID(), $var['game_id']); acquire_lock($player->getSectorID()); // ski...
Move mailer hack to `loadApp` method to ensure it's always applied.
<?php namespace Codeception\Module; use Codeception\TestInterface; use Symfony\Component\BrowserKit\CookieJar; use Symfony\Component\HttpKernel\Client; /** * Change client to follow redirects and keep cookie jar between tests. * * @author Carson Full <carsonfull@gmail.com> */ class WorkingSilex extends Silex { ...
<?php namespace Codeception\Module; use Codeception\TestInterface; use Symfony\Component\BrowserKit\CookieJar; use Symfony\Component\HttpKernel\Client; /** * Change client to follow redirects and keep cookie jar between tests. * * @author Carson Full <carsonfull@gmail.com> */ class WorkingSilex extends Silex { ...
Allow using services.php, html-filters.php via Composer
<?php require_once __DIR__ . '/../vendor/autoload.php'; if (!defined('PHAST_CONFIG_FILE')) { define('PHAST_CONFIG_FILE', __DIR__ . '/config-user.php'); }
<?php if (!class_exists('\Kibo\Phast\PhastServices')) { require_once __DIR__ . '/../vendor/autoload.php'; } if (!defined('PHAST_CONFIG_FILE')) { define('PHAST_CONFIG_FILE', __DIR__ . '/config-user.php'); }
Add ability to delete spending on spendings' index view
@extends('layout') @section('title', __('general.spendings')) @section('body') <div class="wrapper my-3"> <h2>{{ __('general.spendings') }}</h2> <div class="box mt-3"> @if (count($spendings)) @foreach ($spendings as $spending) <div class="box__sectio...
@extends('layout') @section('title', __('general.spendings')) @section('body') <div class="wrapper my-3"> <h2>{{ __('general.spendings') }}</h2> <div class="box mt-3"> @if (count($spendings)) @foreach ($spendings as $spending) <div class="box__sectio...
Update faves to items, remove guest middleware
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Item; use Auth; class ItemsController extends Controller { /** * Create a new controller instance. * * @return void */ public function __construct() { $this->middleware('guest'); } /** * S...
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Item; use Auth; class ItemsController extends Controller { /** * Create a new controller instance. * * @return void */ public function __construct() { } /** * Show the application dashboard. ...
Remove useless defined method from interface, it will not be used
<?php namespace Wanjee\Shuwee\AdminBundle\Datagrid; use Symfony\Component\HttpFoundation\Request; interface DatagridInterface { // add field // get fields // add filter // get filters /** * @param \Symfony\Component\HttpFoundation\Request $request */ public function setRequest(Requ...
<?php namespace Wanjee\Shuwee\AdminBundle\Datagrid; use Symfony\Component\HttpFoundation\Request; interface DatagridInterface { // Todo define scope... }
Add a link used to clear the purchase date input
<!-- Purchase Date --> <div class="form-group {{ $errors->has('purchase_date') ? ' has-error' : '' }}"> <label for="purchase_date" class="col-md-3 control-label">{{ trans('general.purchase_date') }}</label> <div class="input-group col-md-4"> <div class="input-group date" data-provide="datepicker" data-dat...
<!-- Purchase Date --> <div class="form-group {{ $errors->has('purchase_date') ? ' has-error' : '' }}"> <label for="purchase_date" class="col-md-3 control-label">{{ trans('general.purchase_date') }}</label> <div class="input-group col-md-4"> <div class="input-group date" data-provide="datepicker" data-dat...
Remove useless of() call in tests
<?php namespace Brick\Math\Tests; use Brick\Math\BigDecimal; use Brick\Math\BigInteger; /** * Base class for BigInteger and BigDecimal test cases. */ abstract class AbstractTestCase extends \PHPUnit_Framework_TestCase { /** * @param string $expected The expected value as a string. * @param BigInt...
<?php namespace Brick\Math\Tests; use Brick\Math\BigDecimal; use Brick\Math\BigInteger; /** * Base class for BigInteger and BigDecimal test cases. */ abstract class AbstractTestCase extends \PHPUnit_Framework_TestCase { /** * @param string $expected The expected value as a string. * @param BigInt...
Use new core API for modifying WebAppView properties
<?php /* * This file is part of Flarum. * * (c) Toby Zerner <toby.zerner@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Flarum\Embed; use Flarum\Forum\WebApp; class EmbedWebApp extends WebApp { /** ...
<?php /* * This file is part of Flarum. * * (c) Toby Zerner <toby.zerner@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Flarum\Embed; use Flarum\Forum\WebApp; class EmbedWebApp extends WebApp { /** ...
Make sure path is correct when loaded from composer
<?php namespace Sioen; /** * Get a translated list of countries * Uses this vendor: https://github.com/umpirsky/country-list/ * * @author Wouter Sioen <wouter.sioen@wijs.be> */ class Countries { /** * @var array */ protected $countries = array(); /** * @param string $language * @...
<?php namespace Sioen; /** * Get a translated list of countries * Uses this vendor: https://github.com/umpirsky/country-list/ * * @author Wouter Sioen <wouter.sioen@wijs.be> */ class Countries { /** * @var array */ protected $countries = array(); /** * @param string $language * @...
Fix get images array index
<?php namespace Milax\Mconsole\Http\Controllers\API; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use Milax\Mconsole\Models\Image as ImageModel; use Image; use File; class ImagesController extends Controller { protected $uploadDir; protected $uploadUrl; protected $scriptUrl; ...
<?php namespace Milax\Mconsole\Http\Controllers\API; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use Milax\Mconsole\Models\Image as ImageModel; use Image; use File; class ImagesController extends Controller { protected $uploadDir; protected $uploadUrl; protected $scriptUrl; ...
Read the local db config from .env.local.php
<?php return array( /* |-------------------------------------------------------------------------- | Database Connections |-------------------------------------------------------------------------- | | Here are each of the database connections setup for your application. | Of course, examples of configuring ea...
<?php return array( /* |-------------------------------------------------------------------------- | Database Connections |-------------------------------------------------------------------------- | | Here are each of the database connections setup for your application. | Of course, examples of configuring ea...
Remove restrictions of dev mode for the minute, while we're developing on a VM
<?php // this check prevents access to debug front controllers that are deployed by accident to production servers. // feel free to remove this, extend it or make something more sophisticated. if (!in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1'))) { die('You are not allowed to access this file. Check '....
<?php // this check prevents access to debug front controllers that are deployed by accident to production servers. // feel free to remove this, extend it or make something more sophisticated. //if (!in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1'))) //{ // die('You are not allowed to access this file. Ch...
Move base module class into ATP
<?php /** * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD Lic...
<?php namespace Application; class Module extends \ATP\Module { protected $_moduleName = "Application"; }
Add return types preparing for upgrade of parent.
<?php namespace Silly\Input; /** * Extending InputArgument because... * * @author Matthieu Napoli <matthieu@mnapoli.fr> */ class InputArgument extends \Symfony\Component\Console\Input\InputArgument { private $description; public function setDescription($description) { $this->description = $de...
<?php namespace Silly\Input; /** * Extending InputArgument because... * * @author Matthieu Napoli <matthieu@mnapoli.fr> */ class InputArgument extends \Symfony\Component\Console\Input\InputArgument { private $description; public function setDescription($description) { $this->description = $de...
Make truncate to be available at php 5.3 and 5.4
<?php namespace Coduo\PHPHumanizer\String; class Truncate { /** * @var string */ private $text; /** * @var int */ private $charactersCount; /** * @var string */ private $append; /** * @param string $text * @param int $charactersCount * @param...
<?php namespace Coduo\PHPHumanizer\String; class Truncate { /** * @var string */ private $text; /** * @var int */ private $charactersCount; /** * @var string */ private $append; /** * @param string $text * @param int $charactersCount * @param...
Replace type filtering method with a name based assign() method
<?php namespace Bolt\Api; class Connections extends \Bolt\Base { public $sources; public function __construct($connections = null) { if ($connections !== null) { if (is_array($connections)) { foreach ($connections as $connection) { $this->add($connection); } } else ...
<?php namespace Bolt\Api; class Connections extends \Bolt\Base { public $sources; public function __construct($connections = null) { if ($connections !== null) { if (is_array($connections)) { foreach ($connections as $connection) { $this->add($connection); } } else ...
Use the right URI for send
<?php namespace MessageBird\Resources\Conversation; use MessageBird\Common\HttpClient; use MessageBird\Exceptions; use MessageBird\Objects\Conversation\SendMessage; use MessageBird\Objects\Conversation\SendMessageResult; use MessageBird\Resources\Base; class Send extends Base { const RESOURCE_NAME = 'conversatio...
<?php namespace MessageBird\Resources\Conversation; use MessageBird\Common\HttpClient; use MessageBird\Exceptions; use MessageBird\Objects\Conversation\SendMessage; use MessageBird\Objects\Conversation\SendMessageResult; use MessageBird\Resources\Base; class Send extends Base { const RESOURCE_NAME = 'send'; ...
Test for points of interest layer
<?php class PointsOfInterestLayerTest extends SapphireTest { public function testGetCMSFields() { $this->markTestSkipped('TODO'); } }
<?php class PointsOfInterestLayerTest extends SapphireTest { public function testUpdateCMSFields() { $layer = new PointsOfInterestLayer(); $fields = $layer->getCMSFields(); $root = $fields->fieldByName('Root.Main'); $fields = $root->FieldList(); $names = array(); foreach ($fields as $field) { $names[]...
Use helper class to determine if middleware group exists
<?php use GeneaLabs\LaravelCaffeine\Http\Controllers\LaravelCaffeineController; if (hasWebMiddleware()) { Route::group(['middleware' => ['web']], function () { Route::get('genealabs/laravel-caffeine/drip', LaravelCaffeineController::class . '@drip'); }); } else { Route::get('genealabs/laravel-caff...
<?php use GeneaLabs\LaravelCaffeine\Helper; use GeneaLabs\LaravelCaffeine\Http\Controllers\LaravelCaffeineController; if ((new Helper())->routeHasMiddlewareGroup('web')) { Route::group(['middleware' => ['web']], function () { Route::get('genealabs/laravel-caffeine/drip', LaravelCaffeineController::class ....
Add methods to build add/remove filter URLs
<?php /** * Solr facet option * * @category Asm * @package Asm_Solr * @author Ingo Renner <ingo@infielddesign.com> */ class Asm_Solr_Model_Solr_Facet_FacetOption extends Varien_Object { }
<?php /** * Solr facet option * * @category Asm * @package Asm_Solr * @author Ingo Renner <ingo@infielddesign.com> */ class Asm_Solr_Model_Solr_Facet_FacetOption extends Varien_Object { protected $unwantedUrlParameters; public function __construct() { $this->unwantedUrlParameters = array( Mage::getBlo...
Fix a bug when providing messages for validation rules in Factory class
<?php namespace App\Components\Validation\Sirius; use App\Components\Validation\FactoryInterface; use Sirius\Validation\Validator; /** * A Sirius Validator factory * * @author Benjamin Ulmer * @link http://github.com/remluben/slim-boilerplate */ class SiriusValidatorFactory implements FactoryInterface { /**...
<?php namespace App\Components\Validation\Sirius; use App\Components\Validation\FactoryInterface; use Sirius\Validation\Validator; /** * A Sirius Validator factory * * @author Benjamin Ulmer * @link http://github.com/remluben/slim-boilerplate */ class SiriusValidatorFactory implements FactoryInterface { /**...
Add done status to entryServerNodeTask
<?php /** * @package Core * @subpackage model.enum */ interface EntryServerNodeStatus extends BaseEnum { const ERROR = -1; const STOPPED = 0; const PLAYABLE = 1; const BROADCASTING = 2; const AUTHENTICATED = 3; const MARKED_FOR_DELETION = 4; const TASK_PENDING = 5; const TASK_QUEUED = 6; const TASK_PROCESS...
<?php /** * @package Core * @subpackage model.enum */ interface EntryServerNodeStatus extends BaseEnum { const ERROR = -1; const STOPPED = 0; const PLAYABLE = 1; const BROADCASTING = 2; const AUTHENTICATED = 3; const MARKED_FOR_DELETION = 4; const TASK_PENDING = 5; const TASK_QUEUED = 6; const TASK_PROCESS...
Fix unneeded float cast and add return type
<?php namespace OpenDominion\Models; class Race extends AbstractModel { public function dominions() { return $this->hasMany(Dominion::class); } public function perks() { return $this->hasMany(RacePerk::class); } public function units() { return $this->hasMany(...
<?php namespace OpenDominion\Models; class Race extends AbstractModel { public function dominions() { return $this->hasMany(Dominion::class); } public function perks() { return $this->hasMany(RacePerk::class); } public function units() { return $this->hasMany(...
Improve method copyrightData() with parameter $id_img
<?php function copyrightData($type = 'name') { $type = (isset($type)) ? $type : 'name'; return get_post_meta(get_post_thumbnail_id(), "setrobot_copyright_{$type}", true); }
<?php function copyrightData($id_img, $type = 'name') { $type = (isset($type)) ? $type : 'name'; return get_post_meta($id_img, "setrobot_copyright_{$type}", true); }
Set local path for Rocketeer commands
<?php namespace Rocketeer\Satellite\Abstracts; use Illuminate\Console\Command; use Rocketeer\Satellite\Services\Applications\ApplicationsManager; use Symfony\Component\Console\Input\InputArgument; class AbstractRocketeerCallerCommand extends Command { /** * @type ApplicationsManager */ protected $apps; /** ...
<?php namespace Rocketeer\Satellite\Abstracts; use Illuminate\Console\Command; use Rocketeer\Satellite\Services\Applications\ApplicationsManager; use Symfony\Component\Console\Input\InputArgument; class AbstractRocketeerCallerCommand extends Command { /** * @type ApplicationsManager */ protected $apps; /** ...
Fix fatal error in collection episodes listing
<?php namespace VHX; class Collections extends ApiResource { public static function all($params = array(), $headers = null) { return self::_list($params, $headers); } public static function retrieve($id = null, $headers = null) { return self::_retrieve($id, null, $headers); } public static function ...
<?php namespace VHX; class Collections extends ApiResource { public static function all($params = array(), $headers = null) { return self::_list($params, $headers); } public static function retrieve($id = null, $headers = null) { return self::_retrieve($id, null, $headers); } public static function ...
Add loadAjax method and update methods visibility
<?php /* * This file is a part of the ChZ-PHP package. * * (c) François LASSERRE <choiz@me.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Engine; class Controller { function __construct() { } pub...
<?php /* * This file is a part of the ChZ-PHP package. * * (c) François LASSERRE <choiz@me.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Engine; class Controller { function __construct() { } pro...
Hide currently bogus contact text
@extends ('base') @section ('subheader') @stop @section ('content') <div class="row"> <div class="col-xs-12 col-md-8 col-md-offset-2"> <p> @lang('app.contact.info') </p> <ul class="list-unstyled"> <li> <i class="fa f...
@extends ('base') @section ('subheader') @stop @section ('content') <div class="row"> <div class="col-xs-12 col-md-8 col-md-offset-2"> <p> @lang('app.contact.info') </p> <ul class="list-unstyled"> <li> <i class="fa f...
Set memory_limit to be unlimited for tests
<?php require_once realpath(__DIR__ . '/../core/slir.class.php'); abstract class SLIRTestCase extends PHPUnit_Framework_TestCase { /** * @var SLIR */ protected $slir; /** * @return void */ protected function setUp() { $this->slir = new SLIR(); SLIRConfig::$defaultImagePath = null; ...
<?php require_once realpath(__DIR__ . '/../core/slir.class.php'); abstract class SLIRTestCase extends PHPUnit_Framework_TestCase { /** * @var SLIR */ protected $slir; /** * @return void */ protected function setUp() { $this->slir = new SLIR(); SLIRConfig::$defaultImagePath = null; ...
Allow data aggregate contents to be traversable
<?php /* * This file is part of Transfer. * * For the full copyright and license information, please view the LICENSE file located * in the root directory. */ namespace Transfer\Adapter\Transaction; /** * Holds data for transaction objects. */ class DataAggregate implements \IteratorAggregate { /** *...
<?php /* * This file is part of Transfer. * * For the full copyright and license information, please view the LICENSE file located * in the root directory. */ namespace Transfer\Adapter\Transaction; /** * Holds data for transaction objects. */ class DataAggregate implements \IteratorAggregate { /** *...
Add delete (destroy method) for ApiController.
<?php /** * Package Routes */ Route::group(['namespace' => 'Taskforcedev\CrudAPI\Http\Controllers'], function () { Route::group(['prefix' => 'api'], function () { Route::get('{model}/{id}', 'ApiController@show'); Route::get('{model}', 'ApiController@index'); Route::post('{model}', 'ApiCo...
<?php /** * Package Routes */ Route::group(['namespace' => 'Taskforcedev\CrudAPI\Http\Controllers'], function () { Route::group(['prefix' => 'api'], function () { Route::get('{model}/{id}', 'ApiController@show'); Route::get('{model}', 'ApiController@index'); Route::post('{model}', 'ApiCo...
Allow Edit and Set of Slug Field
<div class="form-group"> <input type="text" id="name" class="form-control input-lg" name="name" placeholder="Enter Page Title" value="{{ old('name', $page->name) }}"> </div> <div class="form-group no-margin"> <div class="input-group"> <span...
<div class="form-group"> <input type="text" id="name" class="form-control input-lg" name="name" placeholder="Enter Page Title" value="{{ old('name', $page->name) }}"> </div> <div class="form-group no-margin"> <div class="input-group"> <span...
Use testimonials on home page
<?php $defaults = array( 'preview' => false, 'testimonials' => false ); $settings = array(); foreach ($_REQUEST as $key => $value) { $settings[$key] = ($value === 'true'); } $config = array_merge($defaults, $settings);
<?php $defaults = array( 'preview' => false, 'testimonials' => true ); $settings = array(); foreach ($_REQUEST as $key => $value) { $settings[$key] = ($value === 'true'); } $config = array_merge($defaults, $settings);
Add example in Eval class
<?php class Eval_Command extends WP_CLI_Command { /** * Execute arbitrary PHP code. * * ## OPTIONS * * <php-code> * : The code to execute, as a string. * * [--skip-wordpress] * : Execute code without loading WordPress. * * @when before_wp_load * * ## EXAMPLES * * $ wp eval 'echo WP_...
<?php /** * Execute arbitrary PHP code. * * ## EXAMPLES * * # Display WordPress content directory. * $ wp eval 'echo WP_CONTENT_DIR;' * /var/www/wordpress/wp-content * * # Generate a random number. * $ wp eval 'echo rand();' --skip-wordpress * 479620423 */ class Eval_Command extends...
Use the default modal command. Set title and href.
<?php /** * @version $Id$ * @category Nooku * @package Nooku_Server * @subpackage Weblinks * @copyright Copyright (C) 2011 Timble CVBA and Contributors. (http://www.timble.net) * @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> * @link http://www.nooku.org */ /** * Weblinks Toolbar Class * ...
<?php /** * @version $Id$ * @category Nooku * @package Nooku_Server * @subpackage Weblinks * @copyright Copyright (C) 2011 Timble CVBA and Contributors. (http://www.timble.net) * @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> * @link http://www.nooku.org */ /** * Weblinks Toolbar Class * ...
Use Case for persona b (pet seeker)
<!DOCTYPE html> <head> <title>Conceptual-Model</title> </head> <body> <main> <h2>Entities and Attributes</h2> <p><strong>User Profile</strong></p> <ul> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> </ul> <p>Pet Profile</p> <ul> <li></li> <li></li> <li></li> <li>...
<!DOCTYPE html> <head> <title>Conceptual-Model</title> </head> <body> <main> <h2>Entities and Attributes</h2> <p><strong>Profile</strong></p> <ul> <li>profileId</li> <li>profileAtHandle</li> <li>profileEmail</li> <li>profilePhone</li> </ul> <p><strong>Pet Profile</strong></p> <ul> <li>petId...
Use $eval to maintain state
<?php #YOLO namespace yolo; function yolisp($swag, array $env = []) { if (!is_array($swag)) { if (isset($env[$swag])) { return $env[$swag]; } else if (function_exists($swag)) { return $swag; } else { throw new \Exception("Could not find $swag in environm...
<?php #YOLO namespace yolo; function yolisp($swag, array $env = []) { if (!is_array($swag)) { if (isset($env[$swag])) { return $env[$swag]; } else if (function_exists($swag)) { return $swag; } else { throw new \Exception("Could not find $swag in environm...
Add test new company suspended
<?php namespace Test; use App\User; use App\Company; use TestCase; use Carbon\Carbon; use Illuminate\Foundation\Testing\WithoutMiddleware; use Illuminate\Foundation\Testing\DatabaseMigrations; use Illuminate\Foundation\Testing\DatabaseTransactions; class CompanyLicenceManagementTest extends TestCase { use Datab...
<?php namespace Test; use App\User; use App\Company; use TestCase; use Carbon\Carbon; use Illuminate\Foundation\Testing\WithoutMiddleware; use Illuminate\Foundation\Testing\DatabaseMigrations; use Illuminate\Foundation\Testing\DatabaseTransactions; class CompanyLicenceManagementTest extends TestCase { use Datab...
Add check to ensure second argument is an integer
<?php namespace DMS\Bundle\TwigExtensionBundle\Twig\Date; /** * Adds support for Padding a String in Twig */ class PadStringExtension extends \Twig_Extension { /** * Name of Extension * * @return string */ public function getName() { return 'PadStringExtension'; } /**...
<?php namespace DMS\Bundle\TwigExtensionBundle\Twig\Date; /** * Adds support for Padding a String in Twig */ class PadStringExtension extends \Twig_Extension { /** * Name of Extension * * @return string */ public function getName() { return 'PadStringExtension'; } /**...
Delete firstVisit = true, userID = 0 sessions after processing background queue
<?php namespace wcf\action; use wcf\system\background\BackgroundQueueHandler; /** * Performs background queue jobs. * * @author Tim Duesterhus * @copyright 2001-2019 WoltLab GmbH * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php> * @package WoltLabSuite\Core\Action *...
<?php namespace wcf\action; use wcf\system\background\BackgroundQueueHandler; use wcf\system\WCF; /** * Performs background queue jobs. * * @author Tim Duesterhus * @copyright 2001-2019 WoltLab GmbH * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php> * @package WoltLab...
Add initial HTTP methods array
<?php namespace SimpleRoute; final class Route implements RouteInterface { /** * @var string[] */ private $methods; /** * @var string */ private $pattern; /** * @var mixed */ private $handler; /** * @param string|string[] $method The HTTP method, or an...
<?php namespace SimpleRoute; final class Route implements RouteInterface { /** * @var array */ private static $availableMethods = [ 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', ]; /** * @var string[] */ private $methods; ...
Add debug to behat feature
<?php use Behat\Behat\Context\SnippetAcceptingContext; use Behat\Behat\Hook\Scope\BeforeScenarioScope; use Bex\Behat\Context\TestRunnerContext; class FeatureContext implements SnippetAcceptingContext { /** @var TestRunnerContext $testRunnerContext */ private $testRunnerContext; /** * @BeforeScenari...
<?php use Behat\Behat\Context\SnippetAcceptingContext; use Behat\Behat\Hook\Scope\BeforeScenarioScope; use Bex\Behat\Context\TestRunnerContext; class FeatureContext implements SnippetAcceptingContext { /** @var TestRunnerContext $testRunnerContext */ private $testRunnerContext; /** * @BeforeScenari...
Add (helpful) comments to docBlocks
<?php /*************************************************************************** * @author Pierre-Henry Soria <ph7software@gmail.com> * @category PH7 Template Engine * @package PH7 / Framework / Layout / Tpl / Engine / PH7Tpl / Syntax * @copyright (c) 2018, Pierre-Henry Soria. Al...
<?php /*************************************************************************** * @author Pierre-Henry Soria <ph7software@gmail.com> * @category PH7 Template Engine * @package PH7 / Framework / Layout / Tpl / Engine / PH7Tpl / Syntax * @copyright (c) 2018, Pierre-Henry Soria. Al...
ADD support to multiple languages from config/app.php config file
<?php namespace App\Jobs; use App\Jobs\Job; use Request; use Illuminate\Contracts\Bus\SelfHandling; class SetLocale extends Job implements SelfHandling { /** * The availables languages. * * @array $languages */ protected $languages = ['en','fr']; /** * Execute the command. ...
<?php namespace App\Jobs; use App\Jobs\Job; use Request; use Illuminate\Contracts\Bus\SelfHandling; class SetLocale extends Job implements SelfHandling { /** * The availables languages. * * @array $languages */ protected $languages; public function __construct(){ $this->languages = c...
Revert "Added filters to stop WordPress from automatically adding p tags"
<?php namespace Roots\Sage\Extras; use Roots\Sage\Config; /** * Add <body> classes */ function body_class($classes) { // Add page slug if it doesn't exist if (is_single() || is_page() && !is_front_page()) { if (!in_array(basename(get_permalink()), $classes)) { $classes[] = basename(get_permalink()); ...
<?php namespace Roots\Sage\Extras; use Roots\Sage\Config; /** * Add <body> classes */ function body_class($classes) { // Add page slug if it doesn't exist if (is_single() || is_page() && !is_front_page()) { if (!in_array(basename(get_permalink()), $classes)) { $classes[] = basename(get_permalink()); ...
Create REST API resource to get dictionary/enum items. Fix CS
<?php namespace Oro\Bundle\EntityBundle\Provider; use Doctrine\ORM\QueryBuilder; interface DictionaryValueListProviderInterface { /** * Checks whether the provider supports a given entity * * @param string $className The FQCN of an entity * * @return bool TRUE if this provider supports t...
<?php namespace Oro\Bundle\EntityBundle\Provider; use Doctrine\ORM\QueryBuilder; interface DictionaryValueListProviderInterface { /** * Checks whether the provider supports a given entity * * @param string $className The FQCN of an entity * * @return bool TRUE if this provider supports t...
Make sure tests don't fail when integration tests not loaded
<?php namespace { require __DIR__.'/../vendor/autoload.php'; } namespace Cache\IntegrationTests { if (!class_exists('Cache\IntegrationTests\CachePoolTest')) { class CachePoolTest extends \PHPUnit_Framework_TestCase { public function testIncomplete() { $t...
<?php namespace { require __DIR__.'/../vendor/autoload.php'; } namespace Cache\IntegrationTests { // PSR-6 integration tests if (!class_exists('Cache\IntegrationTests\CachePoolTest')) { class CachePoolTest extends \PHPUnit_Framework_TestCase { public function testIncomplete() ...
Fix compilation error in Magento 2.1
<?php namespace PHPUnit\Framework { if (!class_exists(TestCase::class)) { /* * Forward compatibility for PHPUnit 4.x (Magento 2.1) */ abstract class TestCase extends \PHPUnit_Framework_TestCase { public function expectException($exceptionName) { ...
<?php namespace PHPUnit\Framework { /* * TestCase::class cannot be used because it would break code generation in Magento 2.1 * where the code scanner looks for the first "class" keyword. */ if (!class_exists('\PHPUnit\Framework\TestCase')) { /* * Forward compatibility for PHPU...
Fix Order suspend/unsuspend HTTP method
<?php namespace habil\ResellerClub\APIs; use habil\ResellerClub\Helper; class Orders { use Helper; /** * @var string */ protected $api = 'orders'; public function suspend($orderId, $reason) { return $this->get('suspend', [ 'order-id' => $orderId, 'reas...
<?php namespace habil\ResellerClub\APIs; use habil\ResellerClub\Helper; class Orders { use Helper; /** * @var string */ protected $api = 'orders'; public function suspend($orderId, $reason) { return $this->post('suspend', [ 'order-id' => $orderId, 'rea...
Use the new emptyResponse() method for returning an empty AdminCommand response.
<?php /** * This file is part of the TelegramBot package. * * (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Longman\TelegramBot\Commands; use Longman\TelegramB...
<?php /** * This file is part of the TelegramBot package. * * (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Longman\TelegramBot\Commands; use Longman\TelegramB...
Fix error when there are no orders on the query
<?php namespace Flarum\Sticky\Handlers; use Flarum\Core\Events\DiscussionSearchWillBePerformed; use Flarum\Categories\CategoryGambit; class StickySearchModifier { public function subscribe($events) { $events->listen('Flarum\Core\Events\DiscussionSearchWillBePerformed', __CLASS__.'@reorderSearch'); ...
<?php namespace Flarum\Sticky\Handlers; use Flarum\Core\Events\DiscussionSearchWillBePerformed; use Flarum\Categories\CategoryGambit; class StickySearchModifier { public function subscribe($events) { $events->listen('Flarum\Core\Events\DiscussionSearchWillBePerformed', __CLASS__.'@reorderSearch'); ...
Use array_get to prevent undefined index warnings
<?php return array( /* |-------------------------------------------------------------------------- | Database Connections |-------------------------------------------------------------------------- | | Here are each of the database connections setup for your application. | Of course, examp...
<?php return array( /* |-------------------------------------------------------------------------- | Database Connections |-------------------------------------------------------------------------- | | Here are each of the database connections setup for your application. | Of course, examp...
Add user_id to playlist item transformer
<?php // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0. // See the LICENCE file in the repository root for full licence text. namespace App\Transformers\Multiplayer; use App\Models\Multiplayer\PlaylistItem; use App\Transformers\BeatmapCompactTransformer; use Ap...
<?php // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0. // See the LICENCE file in the repository root for full licence text. namespace App\Transformers\Multiplayer; use App\Models\Multiplayer\PlaylistItem; use App\Transformers\BeatmapCompactTransformer; use Ap...
Clear the song index before re-indexing the entire database
<?php use Elasticsearch\Client; trait AdminSearch { public function getSearch($index = null) { if ($index) { $document = $this->search($index, "track", "song-database"); View::share("index", $document["hits"]["hits"]); } $this->layout->content = View::make("admin.search"); } // rebuild public f...
<?php use Elasticsearch\Client; trait AdminSearch { public function getSearch($index = null) { if ($index) { $document = $this->search($index, "track", "song-database"); View::share("index", $document["hits"]["hits"]); } $this->layout->content = View::make("admin.search"); } // rebuild public f...
Change filter sets merge priority in add Imagine filter sets compiler pass.
<?php /** * @author Igor Nikolaev <igor.sv.n@gmail.com> * @copyright Copyright (c) 2017, Darvin Studio * @link https://www.darvin-studio.ru * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Darvin\ImageBundle\Depen...
<?php /** * @author Igor Nikolaev <igor.sv.n@gmail.com> * @copyright Copyright (c) 2017, Darvin Studio * @link https://www.darvin-studio.ru * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Darvin\ImageBundle\Depen...
Change script order to load Jquery first
<!DOCTYPE html> <html> <head> <link rel="stylesheet" href="bootstrap.min.css" type="text/css" > <link rel="stylesheet" href="base.css" type="text/css" > <link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'> <link href='dist/css/bootstrap-material-design.min.css' rel='style...
<!DOCTYPE html> <html> <head> <link rel="stylesheet" href="bootstrap.min.css" type="text/css" > <link rel="stylesheet" href="base.css" type="text/css" > <link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'> <link href='dist/css/bootstrap-material-design.min.css' rel='style...
Cut back on unused code in Report Controller
<?php namespace Ise\WebSecurityBundle\Controller; use Psr\Log\LoggerInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; class ReportController extends AbstractController { private $logger; ...
<?php namespace Ise\WebSecurityBundle\Controller; use Psr\Log\LoggerInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; class ReportController extends AbstractController { private $logger; ...
Add LDAP settings to default config.
<?php /* * Copyright 2016 Lukas Metzger <developer@lukas-metzger.com>. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
<?php /* * Copyright 2016 Lukas Metzger <developer@lukas-metzger.com>. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless ...
Migrate "Jenkins API Token" config setting from masked to hidden
<?php final class PhabricatorHarbormasterConfigOptions extends PhabricatorApplicationConfigOptions { public function getName() { return pht('Harbormaster'); } public function getDescription() { return pht('Configure Harbormaster build engine.'); } public function getFontIcon() { return 'fa-s...
<?php final class PhabricatorHarbormasterConfigOptions extends PhabricatorApplicationConfigOptions { public function getName() { return pht('Harbormaster'); } public function getDescription() { return pht('Configure Harbormaster build engine.'); } public function getFontIcon() { return 'fa-s...
Update tests for settigs service
<?php namespace HtSettingsModulerTest\Service; use HtSettingsModule\Service\SettingsService; use HtSettingsModule\Options\ModuleOptions; class SettingsServiceTest extends \PHPUnit_Framework_TestCase { public function testSave() { $settingsService= new SettingsService( new ModuleOptions, ...
<?php namespace HtSettingsModulerTest\Service; use HtSettingsModule\Service\SettingsService; use HtSettingsModule\Options\ModuleOptions; use HtSettingsModule\Entity\Parameter; class SettingsServiceTest extends \PHPUnit_Framework_TestCase { public function testInsertParameter() { $options = new ModuleO...
Remove nonexistent and unused variable
<?php // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0. // See the LICENCE file in the repository root for full licence text. namespace App\Http\Controllers; use App\Models\Chat\Channel; use App\Models\Chat\UserChannel; use App\Models\User; use Auth; use Reques...
<?php // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0. // See the LICENCE file in the repository root for full licence text. namespace App\Http\Controllers; use App\Models\Chat\Channel; use App\Models\Chat\UserChannel; use App\Models\User; use Auth; use Reques...
Add an optional second parameter to cache, used to conditionaly enable/disable caching
<?php if ( ! function_exists('cache') ) { function cache($key, Closure $closure) { $content = Cache::get($key); if ( ! $content ) { ob_start(); $closure(); $content = ob_get_contents(); ob_end_clean(); Cache::forever($key,...
<?php if ( ! function_exists('cache') ) { function cache($key, $condition = true, Closure $closure) { $content = $condition ? Cache::get($key) : false; if ( ! $content ) { ob_start(); $closure(); $content = ob_get_contents(); ob_end_c...
Fix BC break in Faker
<?php /* * This file is part of the Blackfire Player package. * * (c) Fabien Potencier <fabien@blackfire.io> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Blackfire\Player\Tests\ExpressionLanguage; use Faker\Provider...
<?php /* * This file is part of the Blackfire Player package. * * (c) Fabien Potencier <fabien@blackfire.io> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Blackfire\Player\Tests\ExpressionLanguage; use Faker\Provider...
Change TestCase for PHP 7
<?php Class Globals { public static $VIDEO_FILE = ""; public static $NOVIDEO_FILE = ""; public static $CONFIG = array(); } Globals::$VIDEO_FILE = dirname(__FILE__) . "/../assets/video1s.mp4"; Globals::$NOVIDEO_FILE = dirname(__FILE__) . "/../assets/novideo.mp4"; Globals::$CONFIG = json_decode($_SERVER['argv']...
<?php Class Globals { public static $VIDEO_FILE = ""; public static $NOVIDEO_FILE = ""; public static $CONFIG = array(); } Globals::$VIDEO_FILE = dirname(__FILE__) . "/../assets/video1s.mp4"; Globals::$NOVIDEO_FILE = dirname(__FILE__) . "/../assets/novideo.mp4"; Globals::$CONFIG = json_decode($_SERVER['argv']...
Update register if user exists
<?php if($_SERVER['SERVER_NAME'] == 'builder.osmand.net') { include '../reports/db_conn.php'; $dbconn = db_conn(); $visiblename = pg_escape_string($dbconn, $_GET["visibleName"]); $useremail = pg_escape_string($dbconn, $_GET["email"]); $email = pg_escape_string($dbconn, $_GET["cemail"]); $country...
<?php if($_SERVER['SERVER_NAME'] == 'builder.osmand.net') { include '../reports/db_conn.php'; $dbconn = db_conn(); $visiblename = pg_escape_string($dbconn, $_GET["visibleName"]); $useremail = pg_escape_string($dbconn, $_GET["email"]); $email = pg_escape_string($dbconn, $_GET["cemail"]); $country...
Add easter_date function for HHVM
<?php namespace Skybluesofa\OnThisDay\Data\Region\En\Us\Helpers; use Carbon\Carbon; class Easter { public static function getFatTuesdayDate(Carbon $date) { return Carbon::createFromTimestamp(easter_date($date->year))->subDays(48); } public static function getMardiGrasDate(Carbon $date) { return Carbon:...
<?php namespace Skybluesofa\OnThisDay\Data\Region\En\Us\Helpers; use Carbon\Carbon; class Easter { public static function getFatTuesdayDate(Carbon $date) { return Carbon::createFromTimestamp(easter_date($date->year))->subDays(48); } public static function getMardiGrasDate(Carbon $date) { return Carbon:...
Add default event `oneauth.logged` to login the user
<?php Autoloader::namespaces(array( 'OneAuth\\Auth' => Bundle::path('oneauth').'libraries'.DS.'auth', 'OneAuth\\OAuth' => Bundle::path('oneauth').'libraries'.DS.'oauth', 'OneAuth\\OAuth2' => Bundle::path('oneauth').'libraries'.DS.'oauth2', )); Event::listen('oneauth.logged', function ($client, $user_data) { //...
<?php Autoloader::namespaces(array( 'OneAuth\\Auth' => Bundle::path('oneauth').'libraries'.DS.'auth', 'OneAuth\\OAuth' => Bundle::path('oneauth').'libraries'.DS.'oauth', 'OneAuth\\OAuth2' => Bundle::path('oneauth').'libraries'.DS.'oauth2', )); Event::listen('oneauth.logged', function ($client, $user_data) { //...
Add white space to email
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Nieuwe status voor uw vondst</title> </head> <body> <p> De vondst, {{ $title }} werd behandeld door een validator.<a href='{{ url("/finds/$findId") }}'>Klik hier</a> om de vondst te bekijken. </p> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Nieuwe status voor uw vondst</title> </head> <body> <p> De vondst, {{ $title }} werd behandeld door een validator. <a href='{{ url("/finds/$findId") }}'>Klik hier</a> om de vondst te bekijken. </p> </body> </html>
Use S3 Static website hosting instead
<?php /* * This file is part of flagrow/upload. * * Copyright (c) Flagrow. * * http://flagrow.github.io * * For the full copyright and license information, please view the license.md * file that was distributed with this source code. */ namespace Flagrow\Upload\Adapters; use Flagrow\Upload\Contracts\UploadA...
<?php /* * This file is part of flagrow/upload. * * Copyright (c) Flagrow. * * http://flagrow.github.io * * For the full copyright and license information, please view the license.md * file that was distributed with this source code. */ namespace Flagrow\Upload\Adapters; use Flagrow\Upload\Contracts\UploadA...
Add composer loader for production
<?php /** * This script is intended to be run as the inbuilt webserver's "router" script. * Procedural code below is necessary when triggered from inbuilt webserver * as this script is the point-of-entry for the whole application. * * Uses Gateway class to decide whether to serve static content or begin * request...
<?php /** * This script is intended to be run as the inbuilt webserver's "router" script. * Procedural code below is necessary when triggered from inbuilt webserver * as this script is the point-of-entry for the whole application. * * Uses Gateway class to decide whether to serve static content or begin * request...
Read More module: removed MainController check
<?php class ReadMore extends Modules { public function __init() { # Replace comment codes before markup modules filters them. $this->setPriority("markup_post_text", 4); } public function markup_post_text($text, $post = null) { if (!is_string($text) or !pr...
<?php class ReadMore extends Modules { public function __init() { # Replace comment codes before markup modules filters them. $this->setPriority("markup_post_text", 4); } public function markup_post_text($text, $post = null) { if (!is_string($text) or !pr...
Return 400 response on login fail
<?php namespace OpenCFP\Controller; use Silex\Application; use Symfony\Component\HttpFoundation\Request; class SecurityController { public function indexAction(Request $req, Application $app) { $template = $app['twig']->loadTemplate('login.twig'); return $template->render(array()); } ...
<?php namespace OpenCFP\Controller; use Silex\Application; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; class SecurityController { public function indexAction(Request $req, Application $app) { $template = $app['twig']->loadTemplate('login.twig'); ...
Fix incorrect border color in custom config component
<div class="border-2 border-smoke rounded mb-8"> <div class="md:flex"> <div class="flex-1 bg-smoke-lighter border-b-2 md:border-b-0 md:border-r-2 border-smoke"> <div class="px-4 py-3 bg-white font-semibold border-b-2 border-smoke-light text-smoke-darker">Default values</div> <pre cla...
<div class="border-2 border-smoke rounded mb-8"> <div class="md:flex"> <div class="flex-1 bg-smoke-lighter border-b-2 border-smoke md:border-b-0 md:border-r-2 md:border-smoke"> <div class="px-4 py-3 bg-white font-semibold border-b-2 border-smoke-light text-smoke-darker">Default values</div> ...
Change TimeRange interface to use \DateTime objects
<?php /** * @package johnpancoast/php-common * @copyright (c) 2015-2018 John Pancoast * @license MIT */ namespace Pancoast\Common\Entity; /** * Contract for entities that have a time range * * @author John Pancoast <johnpancoaster@gmail.com> */ interface TimeRangeInterface { /** * Get sta...
<?php /** * @package johnpancoast/php-common * @copyright (c) 2015-2018 John Pancoast * @license MIT */ namespace Pancoast\Common\Entity; /** * Contract for entities that have a time range * * Only hour and minute properties are relevant for \DateTime objects. * * @author John Pancoast <johnpanco...
Fix attaching new user to Membersrole
<?php namespace GeneaLabs\LaravelGovernor\Listeners; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\Schema; class CreatedListener { /** * @SuppressWarnings(PHPMD.UnusedFormalParameter) * @SuppressWarnings(PHPMD.StaticAccess) */ public function handle(string $event, array...
<?php namespace GeneaLabs\LaravelGovernor\Listeners; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\Schema; class CreatedListener { /** * @SuppressWarnings(PHPMD.UnusedFormalParameter) * @SuppressWarnings(PHPMD.StaticAccess) */ public function handle(string $event, array...
Reset config to default values
<?php return [ /* |-------------------------------------------------------------------------- | Namespace Tablenames |-------------------------------------------------------------------------- | | If this option is set to true, all tablenames will be auto-generated from | namespace. For ex...
<?php return [ /* |-------------------------------------------------------------------------- | Namespace Tablenames |-------------------------------------------------------------------------- | | If this option is set to true, all tablenames will be auto-generated from | namespace. For ex...
Update function name to be more accurate
<?php /* ------------------------------------------------------------------------ *\ * Functions: Rewrites \* ------------------------------------------------------------------------ */ /** * Add various rewrite rules * * @return void */ function __gulp_init_namespace___pwa_rewrite_rules(): void { /** * ...
<?php /* ------------------------------------------------------------------------ *\ * Functions: Rewrites \* ------------------------------------------------------------------------ */ /** * Add various rewrite rules * * @return void */ function __gulp_init_namespace___rewrite_rules(): void { /** * Poin...
Fix bug in ipay config sample
<?php return array( //------------------------------- // Timezone for insert dates in database // If you want IPay not set timezone, just leave it empty //-------------------------------- 'timezone' => 'Asia/Tehran', //-------------------------------- // Database configuration //-----...
<?php return array( //------------------------------- // Timezone for insert dates in database // If you want IPay not set timezone, just leave it empty //-------------------------------- 'timezone' => 'Asia/Tehran', //-------------------------------- // Database configuration //-----...
Fix blocking all options except OptionValues
<?php namespace WP_Migrations\OptionVersions; class Provider { protected $repository; public function __construct(Repository $optionVersionRepository) { $this->repository = $optionVersionRepository; } public function init() { add_action('updated_option', [$this, 'updated_op...
<?php namespace WP_Migrations\OptionVersions; class Provider { protected $repository; public function __construct(Repository $optionVersionRepository) { $this->repository = $optionVersionRepository; } public function init() { add_action('updated_option', [$this, 'updated_op...
Add simple stub for GitHub Webhooks
<?php require_once 'lib/Config.php'; require_once 'lib/Session.php'; require_once 'lib/functions.php'; require_once 'lib/Slim/Slim.php'; \Slim\Slim::registerAutoloader(); $db = new PDO(Config::get('datasource')); $app = new \Slim\Slim(); /* Index */ $app->get('/', function() use ($app) { $app->redirect('https:/...
<?php require_once 'lib/Config.php'; require_once 'lib/Session.php'; require_once 'lib/functions.php'; require_once 'lib/Slim/Slim.php'; \Slim\Slim::registerAutoloader(); $db = new PDO(Config::get('datasource')); $app = new \Slim\Slim(); /* Index */ $app->get('/', function() use ($app) { $app->redirect('https:/...
Check that the MenuSet gridfield exists before filtering
<?php namespace Guttmann\SilverStripe; use Extension; use Subsite; class MenuAdminExtension extends Extension { public function updateEditForm($form) { $gridField = $form->Fields()->fieldByName('MenuSet'); $list = $gridField->getList(); $filteredList = $list->filter(array( ...
<?php namespace Guttmann\SilverStripe; use Extension; use Subsite; class MenuAdminExtension extends Extension { public function updateEditForm($form) { $gridField = $form->Fields()->fieldByName('MenuSet'); if($gridField) { $list = $gridField->getList(); $filteredList...
Remove "use" statement. No point for it when the entire file just includes a file and executes one static method.
<?php /** * PHPerian: PHP library for Experian's Web Services * * This is a convinience file for bootstrapping the library during testing. * Do not call this file if you are autoloading via Composer. * * @package PHPerian * @category Library * @author Zander Bald...
<?php /** * PHPerian: PHP library for Experian's Web Services * * This is a convinience file for bootstrapping the library during testing. * Do not call this file if you are autoloading via Composer. * * @package PHPerian * @category Library * @author Zander Bald...
Increase length of logged request responses in `HTTPException`
<?php namespace wcf\util\exception; use wcf\system\exception\IExtraInformationException; use wcf\system\exception\SystemException; use wcf\util\HTTPRequest; use wcf\util\StringUtil; /** * Denotes failure to perform a HTTP request. * * @author Tim Duesterhus * @copyright 2001-2018 WoltLab GmbH * @license GNU Less...
<?php namespace wcf\util\exception; use wcf\system\exception\IExtraInformationException; use wcf\system\exception\SystemException; use wcf\util\HTTPRequest; use wcf\util\StringUtil; /** * Denotes failure to perform a HTTP request. * * @author Tim Duesterhus * @copyright 2001-2018 WoltLab GmbH * @license GNU Less...
Fix wrong path in footer include of profiling file
</div> <footer id="footer" class="panel-footer"> <?php include 'footer/profiling.php'; ?> </footer> </body> </html>
</div> <footer id="footer" class="panel-footer"> <?php include 'views/footer/profiling.php'; ?> </footer> </body> </html>
Add placeholder attribute to textarea
<?php namespace Laraplus\Form\Fields; use Laraplus\Form\Fields\Base\Element; class TextArea extends Element { /** * @param string $cols * @return $this */ public function cols($cols) { $this->attributes['cols'] = $cols; return $this; } /** * @param string $row...
<?php namespace Laraplus\Form\Fields; use Laraplus\Form\Fields\Base\Element; class TextArea extends Element { /** * @param string $cols * @return $this */ public function cols($cols) { $this->attributes['cols'] = $cols; return $this; } /** * @param string $row...
Replace pane-block class with pane-bean- class.
<?php /** * @file * Template overrides as well as (pre-)process and alter hooks for the * UCLALIB Omega theme. */ /** * Implements template_preprocess_panels_pane(). * * Add bean type as a class to bean panes. */ function uclalib_omega_preprocess_panels_pane(&$vars) { if ($vars['pane']->type == 'block') { ...
<?php /** * @file * Template overrides as well as (pre-)process and alter hooks for the * UCLALIB Omega theme. */ /** * Implements template_preprocess_panels_pane(). * * Add bean type as a class to bean panes. */ function uclalib_omega_preprocess_panels_pane(&$vars) { if ($vars['pane']->type == 'block') { ...
Allow messgae in preffered class sniff
<?php declare(strict_types=1); namespace Symplify\CodingStandard\Sniffs\Architecture; use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\Sniff; use Symplify\TokenRunner\Analyzer\SnifferAnalyzer\Naming; use function Safe\sprintf; final class PreferredClassSniff implements Sniff { /** * @var string[] ...
<?php declare(strict_types=1); namespace Symplify\CodingStandard\Sniffs\Architecture; use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\Sniff; use Symplify\TokenRunner\Analyzer\SnifferAnalyzer\Naming; use function Safe\sprintf; final class PreferredClassSniff implements Sniff { /** * @var string[] ...