Instruction
stringlengths
14
778
input_code
stringlengths
0
4.24k
output_code
stringlengths
1
5.44k
Update code based on orchestral/support@1d5febb
<?php namespace Orchestra\Memory; use Orchestra\Support\Relic; class Provider extends Relic { /** * Handler instance. * * @var MemoryHandlerInterface */ protected $handler; /** * Construct an instance. * * @param MemoryHandlerInterface $handler * @param string ...
<?php namespace Orchestra\Memory; use Orchestra\Support\Relic; class Provider extends Relic { /** * Handler instance. * * @var MemoryHandlerInterface */ protected $handler; /** * Construct an instance. * * @param MemoryHandlerInterface $handler * @param string ...
Allow for data as well as file upload.
<?php namespace Metrique\Plonk\Http\Requests; use Metrique\Plonk\Http\Requests\Request; class PlonkStoreRequest extends Request { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** ...
<?php namespace Metrique\Plonk\Http\Requests; use Metrique\Plonk\Http\Requests\Request; class PlonkStoreRequest extends Request { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** ...
Add Dependency Injection (fixed build failed problem)
<?php /** * Created by PhpStorm. * User: hong * Date: 11/7/16 * Time: 2:48 PM */ namespace O\Tests; use O\DesignPatterns\Structural\DependencyInjection\DatabaseConfiguration; use O\DesignPatterns\Structural\DependencyInjection\DatabaseConnection; use PHPUnit\Framework\TestCase; class DependencyInjectionTest ex...
<?php /** * Created by PhpStorm. * User: hong * Date: 11/7/16 * Time: 2:48 PM */ namespace O\Tests; use O\DesignPatterns\Structural\DependencyInjection\DatabaseConfiguration; use O\DesignPatterns\Structural\DependencyInjection\DatabaseConnection; use PHPUnit\Framework\TestCase; class DependencyInjectionTest ex...
Use implode instead of join function
<?php /* * This file is part of the SKTwigExtensionsBundle package. * * (c) Sebastian Kroczek <sk@xbug.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace SK\TwigExtensionsBundle\Twig; use Symfony\Component\Routing\Rou...
<?php /* * This file is part of the SKTwigExtensionsBundle package. * * (c) Sebastian Kroczek <sk@xbug.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace SK\TwigExtensionsBundle\Twig; use Symfony\Component\Routing\Rou...
Revert "Revert "Index aangepast zodat deze via ajax Sauna.php ophaalt""
<?php header('Location: Sauna.php'); ?>
<!doctype html> <html> <head> <meta charset="UTF-8"> <title>Sauna</title> <script src="http://code.jquery.com/jquery-1.10.1.js"></script> <script> $(document).ready(function(e) { $.ajax({ url:"Sauna.php", dataType:"html", success: function(html) { $('body').html(html); } }); }); </script>...
Convert exception creation to leaveNode()
<?php /* * This file is part of Psy Shell. * * (c) 2012-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Psy\CodeCleaner; use PhpParser\Node; use PhpParser\Node\Expr\Exit_; use Psy\Exception\BreakExc...
<?php /* * This file is part of Psy Shell. * * (c) 2012-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Psy\CodeCleaner; use PhpParser\Node; use PhpParser\Node\Arg; use PhpParser\Node\Expr\Exit_; us...
Create cookie on game first run
<?php include("/home/c0smic/secure/data_db_settings.php"); $body = file_get_contents('php://input'); $stime = ""; $etime = ""; $moves = ""; function parseData($body) { $splitter = substr($body, 0, 1); global $stime, $etime, $moves; $mark1 = strpos($body, $splitter, 1...
<?php include("/home/c0smic/secure/data_db_settings.php"); $body = file_get_contents('php://input'); setcookie('game_first-run', true, 5184000 + time(), '/'); $stime = ""; $etime = ""; $moves = ""; function parseData($body) { $splitter = substr($body, 0, 1); global $stim...
Fix @variable directive without arguments
<?php namespace Milax\Mconsole\Providers; use Illuminate\Support\ServiceProvider; use Milax\Mconsole\Models\MconsoleUploadPreset; use Milax\Mconsole\Models\Variable; use Blade; use View; class MconsoleBladeExtensions extends ServiceProvider { /** * Bootstrap the application services. * * @return v...
<?php namespace Milax\Mconsole\Providers; use Illuminate\Support\ServiceProvider; use Milax\Mconsole\Models\MconsoleUploadPreset; use Milax\Mconsole\Models\Variable; use Blade; use View; class MconsoleBladeExtensions extends ServiceProvider { /** * Bootstrap the application services. * * @return v...
Disable log component on test environment
<?php return [ 'request' => [ 'class' => \blink\http\Request::class, 'middleware' => [], ], 'response' => [ 'class' => \blink\http\Response::class, 'middleware' => [ \rethink\hrouter\restapi\middleware\ResponseFormatter::class, ], ], 'session' => [...
<?php return [ 'request' => [ 'class' => \blink\http\Request::class, 'middleware' => [], ], 'response' => [ 'class' => \blink\http\Response::class, 'middleware' => [ \rethink\hrouter\restapi\middleware\ResponseFormatter::class, ], ], 'session' => [...
Add a template directory constant.
<?php /** * Define Constants. */ define('ADMIN_DIR', get_template_directory() .'/admin'); define('ADMIN_URL', get_template_directory_uri() .'/admin'); define('AUTHOR', 'Vincent Klaiber'); define('AUTHOR_URL', 'http://vinkla.com'); define('LOGIN_IMAGE_PATH', ADMIN_URL.'/images/admin-login-logo.png'); define('LOGIN_...
<?php /** * Define Constants. */ define('TEMPLATE_DIR', get_template_directory()); define('ADMIN_DIR', get_template_directory().'/admin'); define('ADMIN_URL', get_template_directory_uri().'/admin'); define('AUTHOR', 'Vincent Klaiber'); define('AUTHOR_URL', 'http://vinkla.com'); define('LOGIN_IMAGE_PATH', TEMPLATE_...
Fix wrong type for debug
<?php namespace App; use Matthias\SymfonyConsoleForm\Bundle\SymfonyConsoleFormBundle; use Symfony\Bundle\FrameworkBundle\FrameworkBundle; use Symfony\Bundle\TwigBundle\TwigBundle; use Symfony\Component\Config\Loader\LoaderInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\H...
<?php namespace App; use Matthias\SymfonyConsoleForm\Bundle\SymfonyConsoleFormBundle; use Symfony\Bundle\FrameworkBundle\FrameworkBundle; use Symfony\Bundle\TwigBundle\TwigBundle; use Symfony\Component\Config\Loader\LoaderInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\H...
Update example to include URI path
<?php use Clue\React\Buzz\Browser; use Clue\React\Buzz\Message\Response; require __DIR__ . '/../vendor/autoload.php'; $loop = React\EventLoop\Factory::create(); $client = new Browser($loop); $client->head('http://www.github.com/clue/http-react')->then(function (Response $result) { var_dump($result->getHeaders()...
<?php use Clue\React\Buzz\Browser; use Clue\React\Buzz\Message\Response; require __DIR__ . '/../vendor/autoload.php'; $loop = React\EventLoop\Factory::create(); $client = new Browser($loop); $client->head('http://www.github.com/clue/http-react')->then(function (Response $result) { var_dump($result->getHeaders()...
Resolve Faker\Generator out of the container if it is bound
<?php namespace Illuminate\Foundation\Testing; use Faker\Factory; trait WithFaker { /** * The Faker instance. * * @var \Faker\Generator */ protected $faker; /** * Setup up the Faker instance. * * @return void */ protected function setUpFaker() { $t...
<?php namespace Illuminate\Foundation\Testing; use Faker\Factory; use Faker\Generator; trait WithFaker { /** * The Faker instance. * * @var \Faker\Generator */ protected $faker; /** * Setup up the Faker instance. * * @return void */ protected function setUpFak...
Move tenant role seeding to cortex/tenants module
<?php declare(strict_types=1); namespace Cortex\Fort\Console\Commands; use Rinvex\Fort\Console\Commands\SeedCommand as BaseSeedCommand; class SeedCommand extends BaseSeedCommand { /** * The name and signature of the console command. * * @var string */ protected $signature = 'cortex:seed:...
<?php declare(strict_types=1); namespace Cortex\Fort\Console\Commands; use Rinvex\Fort\Console\Commands\SeedCommand as BaseSeedCommand; class SeedCommand extends BaseSeedCommand { /** * The name and signature of the console command. * * @var string */ protected $signature = 'cortex:seed:...
Change test directory to get it work on travis ci
<?php namespace Tooly\Tests\Script\Helper; use org\bovigo\vfs\vfsStream; use phpmock\phpunit\PHPMock; use Tooly\Script\Helper\Filesystem; /** * @package Tooly\Tests\Script\Helper */ class FilesystemTest extends \PHPUnit_Framework_TestCase { /** * @var Filesystem */ private $filesystem; /** ...
<?php namespace Tooly\Tests\Script\Helper; use org\bovigo\vfs\vfsStream; use phpmock\phpunit\PHPMock; use Tooly\Script\Helper\Filesystem; /** * @package Tooly\Tests\Script\Helper */ class FilesystemTest extends \PHPUnit_Framework_TestCase { /** * @var Filesystem */ private $filesystem; /** ...
Make sure added methods are tested
<?php use Laravel\Passport\Passport; use PHPUnit\Framework\TestCase; class PassportTest extends TestCase { public function test_scopes_can_be_managed() { Passport::tokensCan([ 'user' => 'get user information', ]); $this->assertTrue(Passport::hasScope('user')); $thi...
<?php use Laravel\Passport\AuthCode; use Laravel\Passport\Client; use Laravel\Passport\Passport; use Laravel\Passport\PersonalAccessClient; use Laravel\Passport\Token; use PHPUnit\Framework\TestCase; class PassportTest extends TestCase { public function test_scopes_can_be_managed() { Passport::tokensC...
Apply consistent code style as used in other tests.
<?php namespace Tests\Feature; use App\Actions\ValetSecure; use App\Shell\Shell; use Exception; use Illuminate\Support\Facades\Config; use Tests\Feature\Fakes\FakeProcess; use Tests\TestCase; class ValetSecureTest extends TestCase { /** @test */ function it_runs_valet_link() { $shell = $this->moc...
<?php namespace Tests\Feature; use App\Actions\ValetSecure; use App\Shell\Shell; use Exception; use Illuminate\Support\Facades\Config; use Tests\Feature\Fakes\FakeProcess; use Tests\TestCase; class ValetSecureTest extends TestCase { private $shell; public function setUp(): void { parent::setUp()...
Change title of designer index page.
@extends('layout.app', [ 'title' => 'Design Stories', 'body_id' => 'designer-index-page', 'body_class' => 'designer-index index', 'active_nav' => 'designer', ]) @section('main') <div class="container"> <div class="row"> @foreach ($designers as $designer) <article id="story-{{ $d...
@extends('layout.app', [ 'title' => 'Designers', 'body_id' => 'designer-index-page', 'body_class' => 'designer-index index', 'active_nav' => 'designer', ]) @section('main') <div class="container"> <div class="row"> @foreach ($designers as $designer) <article id="story-{{ $design...
Include composer's autoloader in tests/boostrap.php
<?php /** * Test runner bootstrap. * * Add additional configuration/setup your application needs when running * unit tests in this file. */ require dirname(__DIR__) . '/config/bootstrap.php';
<?php /** * Test runner bootstrap. * * Add additional configuration/setup your application needs when running * unit tests in this file. */ require dirname(__DIR__) . '/vendor/autoload.php'; require dirname(__DIR__) . '/config/bootstrap.php';
Add method to remove base path.
<?php namespace Yajra\CMS\Themes; use Illuminate\View\FileViewFinder; class ThemeViewFinder extends FileViewFinder { /** * Base path to look for blade files. * * @var string */ protected $basePath; /** * Set file view finder base path. * * @param $path */ publ...
<?php namespace Yajra\CMS\Themes; use Illuminate\View\FileViewFinder; class ThemeViewFinder extends FileViewFinder { /** * Base path to look for blade files. * * @var string */ protected $basePath; /** * Set file view finder base path. * * @param $path */ publ...
Change to use dirname instead of __DIR__
<?php class SiteController extends Controller { public $layout = 'column1'; /** * Displays the front page. */ public function actionIndex() { $this->redirect(array('/auth/assignment/index')); } /** * Resets the database for the demo application. */ public function actionReset() { /* @var $db CDbC...
<?php class SiteController extends Controller { public $layout = 'column1'; /** * Displays the front page. */ public function actionIndex() { $this->redirect(array('/auth/assignment/index')); } /** * Resets the database for the demo application. */ public function actionReset() { /* @var $db CDbC...
Apply the content before creating post object
<?php namespace Isotop\Cargo\Content; class Post extends Abstract_Content { /** * Post constructor. * * @param mixed $post */ public function __construct( $post ) { // Bail if empty. if ( empty( $post ) ) { return; } // Bail if a revision post. if ( wp_is_post_revision( $post ) ) { return;...
<?php namespace Isotop\Cargo\Content; class Post extends Abstract_Content { /** * Post constructor. * * @param mixed $post */ public function __construct( $post ) { // Bail if empty. if ( empty( $post ) ) { return; } // Bail if a revision post. if ( wp_is_post_revision( $post ) ) { return;...
Change variable name to a better desciptive one..
<?php /** * Created by Pierre-Henry Soria */ namespace PFBC\Validation; use PH7\Framework\Date\CDateTime; use PH7\Framework\Mvc\Model\DbConfig; class BirthDate extends \PFBC\Validation { /** @var int */ protected $iMin; /** @var int */ protected $iMax; public function __construct() { ...
<?php /** * Created by Pierre-Henry Soria */ namespace PFBC\Validation; use PH7\Framework\Date\CDateTime; use PH7\Framework\Mvc\Model\DbConfig; class BirthDate extends \PFBC\Validation { /** @var int */ protected $iMin; /** @var int */ protected $iMax; public function __construct() { ...
Extend the IServerMessage thing instead
<?php /* WildPHP - a modular and easily extendable IRC bot written in PHP Copyright (C) 2015 WildPHP This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at you...
<?php /* WildPHP - a modular and easily extendable IRC bot written in PHP Copyright (C) 2015 WildPHP This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at you...
Insert custom commands through the getCommands() function.
<?php /** * @version $Id$ * @category Nooku * @package Nooku_Server * @subpackage Users * @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 */ /** * Users Toolbar Class * * @author...
<?php /** * @version $Id$ * @category Nooku * @package Nooku_Server * @subpackage Users * @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 */ /** * Users Toolbar Class * * @author...
Extend example to echo received client messages
<?php require_once __DIR__.'/../vendor/autoload.php'; $loop = React\EventLoop\Factory::create(); $factory = new Datagram\Factory($loop); $factory->createServer(1234)->then(function (Datagram\Server $server) { $server->on('message', function($message, $client) { $client->send('hello '.$client->getAddress...
<?php require_once __DIR__.'/../vendor/autoload.php'; $loop = React\EventLoop\Factory::create(); $factory = new Datagram\Factory($loop); $factory->createServer(1234)->then(function (Datagram\Server $server) { $server->on('message', function($message, $client) { $client->send('hello '.$client->getAddress...
Disable cache on contact page to avoid CSRF issues
<?php require_once(dm::getDir().'/dmFrontPlugin/lib/config/dmFrontApplicationConfiguration.php'); class frontConfiguration extends dmFrontApplicationConfiguration { public function configure() { $this->getEventDispatcher()->connect('dm.search.filter_boost_values', array($this, 'listenToSearchFilterBoostValue...
<?php require_once(dm::getDir().'/dmFrontPlugin/lib/config/dmFrontApplicationConfiguration.php'); class frontConfiguration extends dmFrontApplicationConfiguration { public function configure() { $this->getEventDispatcher()->connect('dm.search.filter_boost_values', array($this, 'listenToSearchFilterBoostValue...
Add cancel button to note
<div class='note-form-wrapper'> <textarea class="flight-note" name="flight[flight_note]"><?php echo $flight->getFlightNote() ? $flight->getFlightNote() : '' ?></textarea> <button type="submit" class="submit btn btn-green"><?php echo $flight->getFlightNote() ? 'Update Note' : 'Add Note' ?></button> </div> <scrip...
<div class='note-form-wrapper'> <textarea class="flight-note" name="flight[flight_note]"><?php echo $flight->getFlightNote() ? $flight->getFlightNote() : '' ?></textarea> <button class="submit btn btn-green">Submit</button> <button class="cancel btn btn-gray">Cancel</button> </div> <script type='text/javasc...
Change to LF end of line
<?php namespace pshopws; /** * @author Marcos Redondo <kusflo at gmail.com> */ class ServiceSimpleXmlToArray { public static function take($xmlObject) { $service = new self($xmlObject); return $service->xmlToArray($xmlObject); } public static function takeMultiple($xmlObjects) { ...
<?php namespace pshopws; /** * @author Marcos Redondo <kusflo at gmail.com> */ class ServiceSimpleXmlToArray { public static function take($xmlObject) { $service = new self($xmlObject); return $service->xmlToArray($xmlObject); } public static function takeMultiple($xmlObjects) ...
Add empty args for select to prevent notice
<?php namespace elasticsearch; $sections['integration'] = array( 'icon' => NHP_OPTIONS_URL.'img/glyphicons/glyphicons_083_random.png', 'title' => 'Wordpress Integration', 'fields' => array( 'enable' => array( 'id' => 'enable', 'type' => 'checkbox', 'title' => 'Enable Search', 'sub_desc' => 'If enabled...
<?php namespace elasticsearch; $sections['integration'] = array( 'icon' => NHP_OPTIONS_URL.'img/glyphicons/glyphicons_083_random.png', 'title' => 'Wordpress Integration', 'fields' => array( 'enable' => array( 'id' => 'enable', 'type' => 'checkbox', 'title' => 'Enable Search', 'sub_desc' => 'If enabled...
Add test for numeric strings
<?php namespace League\JsonGuard\Test\Constraint; use League\JsonGuard\Constraint\DraftFour\Type; use League\JsonGuard\ValidationError; use League\JsonGuard\Validator; class TypeTest extends \PHPUnit_Framework_TestCase { function test_numeric_string_is_not_a_number() { $type = new Type(); $e...
<?php namespace League\JsonGuard\Test\Constraint; use League\JsonGuard\Constraint\DraftFour\Type; use League\JsonGuard\ValidationError; use League\JsonGuard\Validator; class TypeTest extends \PHPUnit_Framework_TestCase { function test_numeric_string_is_not_a_number() { $type = new Type(); $e...
Fix redirection to home on invalid token
<?php namespace Watson\Autologin; use Auth, Redirect; use Illuminate\Routing\Controller; use Watson\Autologin\Interfaces\AuthenticationInterface; use Watson\Autologin\Interfaces\AutologinInterface; class AutologinController extends Controller { /** * AuthenticationInterface provider instance. * * @var \Studi...
<?php namespace Watson\Autologin; use Auth, Redirect; use Illuminate\Routing\Controller; use Watson\Autologin\Interfaces\AuthenticationInterface; use Watson\Autologin\Interfaces\AutologinInterface; class AutologinController extends Controller { /** * AuthenticationInterface provider instance. * * @var \Studi...
Fix dequeuing of default gutenberg block styles
<?php add_action('enqueue_block_assets', function () { // Dequeue default block styles. Must be included in the asset build. wp_dequeue_style('wp-core-blocks'); });
<?php add_action('enqueue_block_assets', function () { // Dequeue default block styles. Must be included in the asset build. // Must probably be extended to also dequeue additional block styles // registered by plugins etc. wp_dequeue_style('wp-block-library'); });
Test de la sous génération
<?php require_once(dirname(__FILE__).'/../bootstrap/common.php'); sfContext::createInstance($configuration); $t = new lime_test(0); $t->comment("Création d'une génération");
<?php require_once(dirname(__FILE__).'/../bootstrap/common.php'); sfContext::createInstance($configuration); $t = new lime_test(0); $t->comment("Création d'une génération"); $date = "99998877665544"; $doc = GenerationClient::getInstance()->find("GENERATION-TEST-".$date); if($doc) { $doc->delete; } $doc = Generation...
Change default naming strating to use fixture name with underscore
<?php /* * This file is part of the FixtureDumper library. * * (c) Martin Parsiegla <martin.parsiegla@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Sp\FixtureDumper\Generator; use Doctrine\Common\Persisten...
<?php /* * This file is part of the FixtureDumper library. * * (c) Martin Parsiegla <martin.parsiegla@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Sp\FixtureDumper\Generator; use Doctrine\Common\Persisten...
Clean up middleware aware code docs
<?php declare(strict_types=1); namespace League\Route\Middleware; use Psr\Http\Server\MiddlewareInterface; interface MiddlewareAwareInterface { /** * Add a middleware to the stack. * * @param \Psr\Http\Server\MiddlewareInterface $middleware * * @return self */ public function mi...
<?php declare(strict_types=1); namespace League\Route\Middleware; use Psr\Http\Server\MiddlewareInterface; interface MiddlewareAwareInterface { /** * Add a middleware to the stack * * @param \Psr\Http\Server\MiddlewareInterface $middleware * * @return static */ public function m...
Enable strict types in security config interface.
<?php /** * @author Igor Nikolaev <igor.sv.n@gmail.com> * @copyright Copyright (c) 2015, 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\AdminBundle\Secur...
<?php declare(strict_types=1); /** * @author Igor Nikolaev <igor.sv.n@gmail.com> * @copyright Copyright (c) 2015, 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...
Test command's output using php://memory.
<?php namespace Adviser\Commands; class GiveAdviceCommandTest extends \PHPUnit_Framework_TestCase { /** @test */ function it_has_proper_name_and_description() { $command = new GiveAdviceCommand; $this->assertEquals($command->getName(), "give-advice"); $this->assertEquals($command->getDesc...
<?php namespace Adviser\Commands; use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Output\StreamOutput; class GiveAdviceCommandTest extends \PHPUnit_Framework_TestCase { /** @test */ function it_has_proper_name_and_description() { $command = new GiveAdviceCommand; $t...
Fix trl controller fuer directories
<?php class Vpc_Directories_Item_Directory_Trl_Controller extends Vps_Controller_Action_Auto_Vpc_Grid { protected $_buttons = array( 'save', 'reload', ); protected $_editDialog = array( 'width' => 500, 'height' => 400 ); protected $_paging = 25; public functi...
<?php class Vpc_Directories_Item_Directory_Trl_Controller extends Vps_Controller_Action_Auto_Vpc_Grid { protected $_buttons = array( 'save', 'reload', ); protected $_editDialog = array( 'width' => 500, 'height' => 400 ); protected $_hasComponentId = false; //compon...
Add preventDefault call to final setup page
<?php ?> <form action="#" role="form" id="finishSettingsForm"> <h3 class="form-title">Setup Complete!</h3> <span id="helpBlock" class="help-block help-message"></span> <p> Looks like you're almost done! As a final step, run the following commands from the terminal: <br/><code>sudo service a...
<?php ?> <form action="#" role="form" id="finishSettingsForm"> <h3 class="form-title">Setup Complete!</h3> <span id="helpBlock" class="help-block help-message"></span> <p> Looks like you're almost done! As a final step, run the following commands from the terminal: <br/><code>sudo service a...
Comment out unused route and leave as example
<?php $api = app('Dingo\Api\Routing\Router'); $api->version('v1', ['middleware' => 'cors'], function ($api) { // Authentication routes $api->post('auth', 'App\Http\Controllers\AuthController@login'); $api->get('auth', 'App\Http\Controllers\AuthController@verify'); $api->delete('auth', 'App\Http\Contro...
<?php $api = app('Dingo\Api\Routing\Router'); $api->version('v1', ['middleware' => 'cors'], function ($api) { // All routes in this callback is prefixed by "/api" // To change this, go to .env // Authentication routes $api->post('auth', 'App\Http\Controllers\AuthController@login'); $api->get('aut...
Set the default always_authenticate flag to false
<?php /* * This file is part of Cachet. * * (c) Alt Three Services Limited * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return [ /* |-------------------------------------------------------------------------- | Evi...
<?php /* * This file is part of Cachet. * * (c) Alt Three Services Limited * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return [ /* |-------------------------------------------------------------------------- | Evi...
Implement basic filter functionality - added filter form and binding - added route name as parameter in DemoGridBundle
<?php namespace Acme\Bundle\DemoGridBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Response; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; use Symfony\Component\Form\FormBuil...
<?php namespace Acme\Bundle\DemoGridBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Response; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; use Symfony\Component\Form\FormBuil...
Add type hinting to Site Type controller manager
<?php namespace Concrete\Core\Site\Type\Controller; use Concrete\Core\Application\Application; use Concrete\Core\Support\Manager as CoreManager; class Manager extends CoreManager { protected $standardController = StandardController::class; /** * @param mixed $standardController */ public funct...
<?php namespace Concrete\Core\Site\Type\Controller; use Concrete\Core\Application\Application; use Concrete\Core\Support\Manager as CoreManager; class Manager extends CoreManager { /** * @var string */ protected $standardController = StandardController::class; public function __construct(Appli...
Fix Doctrine request for place
<?php namespace MassAPIBundle\Repository; use Doctrine\ORM\EntityRepository; class PlaceRepository extends EntityRepository { public function getNearPlace(array $criteria = array()) { return $this->createQueryBuilder('p') ->leftJoin('p.geo', 'g') ->andWhere('CONTAINS(GeomFromJ...
<?php namespace MassAPIBundle\Repository; use Doctrine\ORM\EntityRepository; class PlaceRepository extends EntityRepository { public function getNearPlace(array $criteria = array()) { return $this->createQueryBuilder('p') ->addSelect('p', 'g') ->leftJoin('p.geo', 'g') ...
Use Yarn over NPM if available
<?php /* * This file is part of Rocketeer * * (c) Maxime Fabre <ehtnam6@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. * */ namespace Rocketeer\Binaries\PackageManagers; /** * Represents the "npm" binary. */ class Np...
<?php /* * This file is part of Rocketeer * * (c) Maxime Fabre <ehtnam6@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. * */ namespace Rocketeer\Binaries\PackageManagers; /** * Represents the "npm" binary. */ class Np...
Add application object as controller constructor param
<?php /** * Base class for controllers * * @file BaseController.php * * PHP version 5.4+ * * @author Yancharuk Alexander <alex at itvault dot info> * @copyright © 2012-2016 Alexander Yancharuk * @date 2016-10-21 16:43 * @license The BSD 3-Clause License * <https://tldrlegal.com/lice...
<?php /** * Base class for controllers * * @file BaseController.php * * PHP version 5.4+ * * @author Yancharuk Alexander <alex at itvault dot info> * @copyright © 2012-2016 Alexander Yancharuk * @date 2016-10-21 16:43 * @license The BSD 3-Clause License * <https://tldrlegal.com/lice...
Make sure to return the favorites count
<?php namespace App\Data; use Eloquent; use DiscussionPresenter; use Laracasts\Presenter\PresentableTrait; use Illuminate\Database\Eloquent\SoftDeletes; class Discussion extends Eloquent { use SoftDeletes, PresentableTrait; protected $fillable = ['title', 'body', 'user_id', 'topic_id']; protected $dates = ['creat...
<?php namespace App\Data; use Eloquent; use DiscussionPresenter; use Laracasts\Presenter\PresentableTrait; use Illuminate\Database\Eloquent\SoftDeletes; class Discussion extends Eloquent { use SoftDeletes, PresentableTrait; protected $fillable = ['title', 'body', 'user_id', 'topic_id']; protected $dates = ['creat...
Update namespace in DIC extension
<?php namespace Knplabs\TimeBundle\DependencyInjection; use Symfony\Component\DependencyInjection\Extension\Extension; use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader\FileLocator; class TimeEx...
<?php namespace Knplabs\TimeBundle\DependencyInjection; use Symfony\Component\DependencyInjection\Extension\Extension; use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\Config\FileLocator; class TimeExtension extends Exte...
Use PHP 8 union types
<?php declare(strict_types = 1); /** * /src/Entity/Interfaces/UserGroupAwareInterface.php * * @author TLe, Tarmo Leppänen <tarmo.leppanen@pinja.com> */ namespace App\Entity\Interfaces; use App\Entity\UserGroup; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; /** * In...
<?php declare(strict_types = 1); /** * /src/Entity/Interfaces/UserGroupAwareInterface.php * * @author TLe, Tarmo Leppänen <tarmo.leppanen@pinja.com> */ namespace App\Entity\Interfaces; use App\Entity\UserGroup; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; /** * In...
Remove APC cache (php 5.5 included Zend cache already)
<?php use Symfony\Component\ClassLoader\ApcClassLoader; use Symfony\Component\HttpFoundation\Request; $loader = require_once __DIR__.'/../app/bootstrap.php.cache'; // Use APC for autoloading to improve performance. // Change 'sf2' to a unique prefix in order to prevent cache key conflicts // with other applications ...
<?php use Symfony\Component\HttpFoundation\Request; $loader = require_once __DIR__.'/../app/bootstrap.php.cache'; require_once __DIR__.'/../app/AppKernel.php'; // FrameworkBenchmark rules prohibit using AppCache, // specifically every request for the JSON test type // must be handled separately // // require_once...
Test upgrading from concrete5 8.5.2
<?php namespace Concrete\Tests\Update; use Concrete\TestHelpers\DockerTrait; use PHPUnit_Framework_TestCase; /** * @group docker */ class InstallUpdateTest extends PHPUnit_Framework_TestCase { use DockerTrait; public function testFullInstallation() { $this->runScriptInDocker('mlocati/docker5:8...
<?php namespace Concrete\Tests\Update; use Concrete\TestHelpers\DockerTrait; use PHPUnit_Framework_TestCase; /** * @group docker */ class InstallUpdateTest extends PHPUnit_Framework_TestCase { use DockerTrait; public function testFullInstallation() { $this->runScriptInDocker('mlocati/docker5:8...
Fix invalid use of $this
<?php /** * Show a warning to an user about the SP requesting SSO a short time after * doing it previously. * * @package SimpleSAMLphp */ if (!array_key_exists('StateId', $_REQUEST)) { throw new \SimpleSAML\Error\BadRequest('Missing required StateId query parameter.'); } $id = $_REQUEST['StateId']; $state = ...
<?php /** * Show a warning to an user about the SP requesting SSO a short time after * doing it previously. * * @package SimpleSAMLphp */ if (!array_key_exists('StateId', $_REQUEST)) { throw new \SimpleSAML\Error\BadRequest('Missing required StateId query parameter.'); } $id = $_REQUEST['StateId']; $state = ...
Declare vars before using it
<?php namespace Asynit\Parser; use Asynit\Test; use Asynit\TestCase; use Symfony\Component\Finder\Finder; class TestsFinder { public function findTests(string $path): array { if (\is_file($path)) { return $this->doFindTests([$path]); } $finder = Finder::create() ...
<?php namespace Asynit\Parser; use Asynit\Test; use Asynit\TestCase; use Symfony\Component\Finder\Finder; class TestsFinder { public function findTests(string $path): array { if (\is_file($path)) { return $this->doFindTests([$path]); } $finder = Finder::create() ...
Fix attempt for invalid/missing user agent string
<?php namespace Grav\Common; /** * Simple wrapper for the very simple parse_user_agent() function */ class Browser { protected $useragent; public function __construct() { $this->useragent = parse_user_agent(); } public function getBrowser() { return strtolower($this->userag...
<?php namespace Grav\Common; /** * Simple wrapper for the very simple parse_user_agent() function */ class Browser { protected $useragent = []; public function __construct() { try { $this->useragent = parse_user_agent(); } catch (\InvalidArgumentException $e) { $...
Use correct path for index page
<?php OC::$CLASSPATH['OC_RoundCube_AuthHelper'] = OC_App::getAppPath('roundcube') . '/lib/RoundCubeAuthHelper.class.php'; $this->create('roundcube_refresh', '/refresh')->post()->action('OC_RoundCube_AuthHelper', 'refresh'); $this->create('roundcube_index', '/')->action( function($params){ require '/../index.php'...
<?php OC::$CLASSPATH['OC_RoundCube_AuthHelper'] = OC_App::getAppPath('roundcube') . '/lib/RoundCubeAuthHelper.class.php'; $this->create('roundcube_refresh', '/refresh')->post()->action('OC_RoundCube_AuthHelper', 'refresh'); $this->create('roundcube_index', '/')->action( function($params){ require OC_App::getApp...
Add missing isset() when checking for generators
<?php namespace Imbo\EventListener\AccessToken; use Imbo\EventListener\AccessToken\AccessTokenGenerator, Imbo\EventListener\AccessToken\SHA256; class MultipleAccessTokenGenerators extends AccessTokenGenerator { /** * The params array for this generator allows you to define a set of access token signature...
<?php namespace Imbo\EventListener\AccessToken; use Imbo\EventListener\AccessToken\AccessTokenGenerator, Imbo\EventListener\AccessToken\SHA256; class MultipleAccessTokenGenerators extends AccessTokenGenerator { /** * The params array for this generator allows you to define a set of access token signature...
Add more PL phone number
<?php namespace Faker\Provider\pl_PL; class PhoneNumber extends \Faker\Provider\PhoneNumber { protected static $formats = array( '+## ### ### ####', '### ### ###', '#########', '(##) ### ## ##', '+##(##)#######', ); }
<?php namespace Faker\Provider\pl_PL; class PhoneNumber extends \Faker\Provider\PhoneNumber { protected static $formats = array( '+48 ## ### ## ##', '0048 ## ### ## ##', '### ### ###', '+48 ### ### ###', '0048 ### ### ###', '#########', '(##) ### ## ##', ...
Switch to a uniquely random set of numbers, so there are no winners drawn twice
<?php namespace Raffle; class RandomService { /** * Base URL */ const BASE_URL = 'http://www.random.org/integers/?min=%d&max=%d&num=%d&col=1&base=10&format=plain&rnd=new'; /** * Retrieve a block of random numbers. * * @param int $min Minimum amount. * @param int $max Max...
<?php namespace Raffle; class RandomService { /** * Base URL */ const BASE_URL = 'http://www.random.org/integer-sets/?sets=1&min=%d&max=%d&num=%d&order=random&format=plain&rnd=new'; /** * Retrieve a block of random numbers. * * @param int $min Minimum amount. * @param int $ma...
Add Tutorial to backend : get article by translated slug
<?php namespace FBN\GuideBundle\Entity; use Doctrine\ORM\EntityRepository; /** * TutorialRepository. * * This class was generated by the Doctrine ORM. Add your own custom * repository methods below. */ class TutorialRepository extends EntityRepository { public function getArticlesImages($first = 0, $limit =...
<?php namespace FBN\GuideBundle\Entity; use Doctrine\ORM\EntityRepository; /** * TutorialRepository. * * This class was generated by the Doctrine ORM. Add your own custom * repository methods below. */ class TutorialRepository extends EntityRepository { public function getArticlesImages($first = 0, $limit =...
Fix wrong phpdoc type name
<?php /** * We made this code. * By pH7 (Pierre-Henry SORIA). */ namespace PFBC\Validation; use PH7\ExistsCoreModel; use PH7\Framework\Security\Ban\Ban; class BankAccount extends \PFBC\Validation { protected $sTable; /** * Constructor of class. * * @param $sTable Default 'Affiliates' ...
<?php /** * We made this code. * By pH7 (Pierre-Henry SORIA). */ namespace PFBC\Validation; use PH7\ExistsCoreModel; use PH7\Framework\Security\Ban\Ban; class BankAccount extends \PFBC\Validation { protected $sTable; /** * Constructor of class. * * @param string $sTable */ public...
Add missing FROM expression to consent SQL query
<?php namespace OpenConext\EngineBlock\Authentication\Repository; use DateTime; use Doctrine\DBAL\Connection as DbalConnection; use Doctrine\DBAL\DBALException; use OpenConext\EngineBlock\Authentication\Entity\Consent; use PDO; final class ConsentRepository { /** * @var DbalConnection */ private $c...
<?php namespace OpenConext\EngineBlock\Authentication\Repository; use DateTime; use Doctrine\DBAL\Connection as DbalConnection; use Doctrine\DBAL\DBALException; use OpenConext\EngineBlock\Authentication\Entity\Consent; use PDO; final class ConsentRepository { /** * @var DbalConnection */ private $c...
Add link to partners in workhsops landing
<div class="partner"> <div class="container"> <div class="row"> <div class="col-md-offset-3 col-md-2 col-sm-4 col-xs-12"> <img class="img-responsive no-title" src="<?= SRC_URL . '/assets/img/workshop/ess.png' ?>"> </div> <div class="col-md-2 col-sm-4 col-xs-12"> <div class...
<div class="partner"> <div class="container"> <div class="row"> <div class="col-md-offset-3 col-md-2 col-sm-4 col-xs-12"> <a target="_blank" href="https://aracoop.coop/projectes-singulars/"> <img class="img-responsive no-title" src="<?= SRC_URL . '/assets/img/workshop/ess.png' ?>"> </a...
Allow null values for Date annotations
<?php namespace Flowpack\ElasticSearch\Indexer\Object\Transform; /* * This file is part of the Flowpack.ElasticSearch package. * * (c) Contributors of the Flowpack Team - flowpack.org * * This package is Open Source Software. For the full copyright and license * information, please view the LICENSE file which wa...
<?php namespace Flowpack\ElasticSearch\Indexer\Object\Transform; /* * This file is part of the Flowpack.ElasticSearch package. * * (c) Contributors of the Flowpack Team - flowpack.org * * This package is Open Source Software. For the full copyright and license * information, please view the LICENSE file which wa...
Fix container global instance conflict
<?php namespace Marquine\Etl; use Illuminate\Container\Container as BaseContainer; class Container extends BaseContainer { /** * Set the globally available instance of the container. * * @return static */ public static function getInstance() { if (is_null(static::$instance)) {...
<?php namespace Marquine\Etl; use Illuminate\Container\Container as BaseContainer; class Container extends BaseContainer { /** * The current globally available container (if any). * * @var static */ protected static $instance; /** * Set the globally available instance of the con...
Fix to redirect to homepage when no referer is defined
<?php /** * Created by Amal Raghav <amal.raghav@gmail.com> * Date: 11/06/11 */ namespace Flock\MainBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\RedirectResponse; use Sensio\Bundle\FrameworkExtraBundl...
<?php /** * Created by Amal Raghav <amal.raghav@gmail.com> * Date: 11/06/11 */ namespace Flock\MainBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\RedirectResponse; use Sensio\Bundle\FrameworkExtraBundl...
Implement trivial version for doctrine repository
<?php namespace Galileo\SettingBundle\Lib\Infrastructure\Framework; use Galileo\SettingBundle\Lib\Model\Setting; use Galileo\SettingBundle\Lib\Model\SettingRepositoryInterface; use Galileo\SettingBundle\Lib\Model\ValueObject\Key; use Galileo\SettingBundle\Lib\Model\ValueObject\Section; class DoctrineSettingRepositor...
<?php namespace Galileo\SettingBundle\Lib\Infrastructure\Framework; use Doctrine\ORM\EntityManagerInterface; use Galileo\SettingBundle\Lib\Model\Setting; use Galileo\SettingBundle\Lib\Model\SettingRepositoryInterface; use Galileo\SettingBundle\Lib\Model\ValueObject\Key; use Galileo\SettingBundle\Lib\Model\ValueObject...
Swap order of implode() args to fix deprecation warning on PHP 7.4
<?php namespace WireMock\Integration; use WireMock\Client\WireMock; require_once 'MappingsAssertionFunctions.php'; require_once 'TestClient.php'; abstract class WireMockIntegrationTest extends \PHPUnit_Framework_TestCase { /** @var WireMock */ protected static $_wireMock; /** @var TestClient */ pro...
<?php namespace WireMock\Integration; use WireMock\Client\WireMock; require_once 'MappingsAssertionFunctions.php'; require_once 'TestClient.php'; abstract class WireMockIntegrationTest extends \PHPUnit_Framework_TestCase { /** @var WireMock */ protected static $_wireMock; /** @var TestClient */ pro...
Fix style and missing semi-colon.
<?php // CONFIRMATION DIALOG ?> <div id="confirmDelete" title="Delete {{ $model }}" style="display: none;"> This action <em>cannot</em> be undone. Are you sure you want to delete this {{ $model }}? </div> <?php // SCRIPT ?> <script> $(function() { var form = $("deleteItem") var confirm = $( "#confir...
<?php // CONFIRMATION DIALOG ?> <div id="confirmDelete" title="Delete {{ $model }}" style="display: none;"> This action <em>cannot</em> be undone. Are you sure you want to delete this {{ $model }}? </div> <?php // SCRIPT ?> <script> $(function() { var form = $("deleteItem") var confirm = $( "#confir...
Change kebab case into snake case
<?php namespace $NAME$\Dashboard; use Illuminate\Support\ServiceProvider; class DashboardServiceProvider extends ServiceProvider { /** * Register any application services. * * @return void */ public function register() { // } /** * Bootstrap any application servi...
<?php namespace $NAME$\Dashboard; use Illuminate\Support\ServiceProvider; class DashboardServiceProvider extends ServiceProvider { /** * Register any application services. * * @return void */ public function register() { // } /** * Bootstrap any application servi...
Fix parameter name in image controller
<?php namespace IrishDan\ResponsiveImageBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\BinaryFileResponse; /** * Class ImageController * * @package ResponsiveImageBundle\Controller */ class ImageController extends Controller { /** * Gene...
<?php namespace IrishDan\ResponsiveImageBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\BinaryFileResponse; /** * Class ImageController * * @package ResponsiveImageBundle\Controller */ class ImageController extends Controller { /** * Gene...
Update chain filter to recognize final filter
<?php namespace Avalanche\Bundle\ImagineBundle\Imagine\Filter; use Imagine\Filter\FilterInterface; use Imagine\Image\ImageInterface; use InvalidArgumentException; class ChainFilter implements FilterInterface { /** * @var FilterInterface[] */ protected $filters; /** * @param FilterInterfac...
<?php namespace Avalanche\Bundle\ImagineBundle\Imagine\Filter; use Imagine\Filter\FilterInterface; use Imagine\Image\ImageInterface; use InvalidArgumentException; class ChainFilter implements FilterInterface { /** * @var FilterInterface[] */ protected $filters; /** * @param FilterInterfac...
Add guest middleware as an annotation and remove the constructor method. Extend from the AbstractController and override the resetPassword method to use the command bus for resetting a password.
<?php namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use Illuminate\Foundation\Auth\ResetsPasswords; class ResetPasswordController extends Controller { /* |-------------------------------------------------------------------------- | Password Reset Controller |--------------...
<?php namespace App\Http\Controllers\Auth; use App\Commands\ResetPassword; use App\Http\Controllers\AbstractController; use Illuminate\Foundation\Auth\ResetsPasswords; use Illuminate\Support\Str; /** * @Middleware("guest") */ class ResetPasswordController extends AbstractController { /* |------------------...
Revert "Test with infinite scroll"
<?php if ( ! isset( $content_width ) ) { $content_width = 600; } function enqueue_comment_reply() { if ( get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'comment_form_before', 'enqueue_comment_reply' ); function baw_hack_wp_title_for_home( $title ){ if( em...
<?php if ( ! isset( $content_width ) ) { $content_width = 600; } function enqueue_comment_reply() { if ( get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'comment_form_before', 'enqueue_comment_reply' ); function baw_hack_wp_title_for_home( $title ){ if( em...
Disable padding columns for mobile
<div class="hbox hbox-auto-xs"> @foreach($manyForms as $key => $column) <div class="hbox-col"> <div class="vbox py-3 @if(!$loop->first) pl-2 @endif @if(!$loop->last) pr-2 @endif"> @foreach($column as $item) {!! $item ?? '' !!} @endforeach ...
<div class="hbox hbox-auto-xs"> @foreach($manyForms as $key => $column) <div class="hbox-col"> <div class="vbox py-3 @if(!$loop->first) pl-md-2 @endif @if(!$loop->last) pr-md-2 @endif"> @foreach($column as $item) {!! $item ?? '' !!} @endforeach...
Add a new category: "participações sociais"
<?php /* * This file is part of Bens Penhorados, an undergraduate capstone project. * * (c) Fábio Santos <ffsantos92@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ use Illuminate\Database\Seeder; class ItemCategories...
<?php /* * This file is part of Bens Penhorados, an undergraduate capstone project. * * (c) Fábio Santos <ffsantos92@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ use Illuminate\Database\Seeder; class ItemCategories...
Fix command again. It always returns an array just sometimes empty.
<?php namespace Isometriks\Bundle\RedditBotBundle\Command; use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class PostFeedsCommand extends Cont...
<?php namespace Isometriks\Bundle\RedditBotBundle\Command; use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class PostFeedsCommand extends Cont...
Fix display image for listing
@if (@fopen($file_url.'/'.$name.'/admin_'.$item->$name, 'r')) {{ HTML::image($file_url.'/'.$name.'/admin_'.$item->$name) }} @else {{ HTML::image(admin_asset('img/admin.jpg')) }} @endif
@if ($item->$name && @fopen($file_url.'/'.$name.'/admin_'.$item->$name, 'r')) {{ HTML::image($file_url.'/'.$name.'/admin_'.$item->$name) }} @else {{ HTML::image(admin_asset('img/admin.jpg')) }} @endif
Update message in assert test
<?php use PHPUnit_Framework_TestCase as PHPUnit; use Application\NativeElements\Math; class PHPNativeElementsTest extends PHPUnit { /** * undocumented function * * @return void **/ public function setUp() { $this->math = new Math; } /** * undocumented function * * @return void **/ public fu...
<?php use PHPUnit_Framework_TestCase as PHPUnit; use Application\NativeElements\Math; class PHPNativeElementsTest extends PHPUnit { /** * undocumented function * * @return void **/ public function setUp() { $this->math = new Math; } /** * undocumented function * * @return void **/ public fu...
Convert language PHP 5.4 arrays.
<?php return array( /* |-------------------------------------------------------------------------- | Password Reminder Language Lines |-------------------------------------------------------------------------- | | The following language lines are the default lines which match reasons | that are given by the pa...
<?php return [ /* |-------------------------------------------------------------------------- | Password Reminder Language Lines |-------------------------------------------------------------------------- | | The following language lines are the default lines which match reasons | that are given by the passwor...
Use new output formatters feature @single-field-default to reduce table data down to a single element when 'string' format is selected.
<?php namespace Pantheon\Terminus\Commands\Auth; use Pantheon\Terminus\Commands\TerminusCommand; use Terminus\Models\Auth; class WhoamiCommand extends TerminusCommand { /** * Displays information about the user currently logged in * * @command auth:whoami * @aliases whoami * * @usag...
<?php namespace Pantheon\Terminus\Commands\Auth; use Pantheon\Terminus\Commands\TerminusCommand; use Terminus\Models\Auth; use Consolidation\OutputFormatters\StructuredData\AssociativeList; class WhoamiCommand extends TerminusCommand { /** * Displays information about the user currently logged in * ...
Fix JSON field for multiple instances
@section("field") <div id="json_{{ $field_id }}" class="field_{{ $field_name }}" style="width: 100%; height: 400px;"></div> <input name="{{ $prefixed_field_name }}" id="{{ $field_id }}" type="hidden" value="{{ $field_value }}"> @overwrite @section("footer.js") @parent <script> // create the edi...
@section("field") <div id="json_{{ $field_id }}" class="field_{{ $field_name }}" style="width: 100%; height: 400px;"></div> <input name="{{ $prefixed_field_name }}" id="{{ $field_id }}" type="hidden" value="{{ $field_value }}"> @overwrite @section("footer.js") @parent <script> // create the editor var...
Fix "Interface `io\streams\SocketOutputStream` not found
<?php namespace peer; /** * OutputStream that reads from a socket */ class SocketOutputStream extends \lang\Object implements \io\streams\SocketOutputStream { protected $socket= null; /** * Constructor * * @param peer.Socket socket */ public function __construct(Socket $socket) { $this->so...
<?php namespace peer; /** * OutputStream that reads from a socket */ class SocketOutputStream extends \lang\Object implements \io\streams\OutputStream { protected $socket= null; /** * Constructor * * @param peer.Socket socket */ public function __construct(Socket $socket) { $this->socket= ...
Create Reminder entities - create repo method
<?php namespace Oro\Bundle\ReminderBundle\Entity\Repository; use Doctrine\ORM\EntityRepository; class ReminderRepository extends EntityRepository { }
<?php namespace Oro\Bundle\ReminderBundle\Entity\Repository; use Doctrine\ORM\EntityRepository; use Oro\Bundle\ReminderBundle\Entity\Reminder; class ReminderRepository extends EntityRepository { /** * @return Reminder[] */ public function getRemindersToProcess() { return $this->createQ...
Use the Security trait method if it exists
<?php /** * This file is part of the silex-annotation-provider package. * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. * * @license MIT License * @copyright (c) 2013, Dana Desrosiers <dana.desrosiers@gmail.com> */ namespace DDesro...
<?php /** * This file is part of the silex-annotation-provider package. * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. * * @license MIT License * @copyright (c) 2013, Dana Desrosiers <dana.desrosiers@gmail.com> */ namespace DDesro...
Test broken after introduction of numeric type
<?php // (c) Copyright 2002-2014 by authors of the Tiki Wiki CMS Groupware Project // // All Rights Reserved. See copyright.txt for details and a complete list of authors. // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. // $Id$ class Search_Index_TypeAnalysisDecorator extends Sea...
<?php // (c) Copyright 2002-2014 by authors of the Tiki Wiki CMS Groupware Project // // All Rights Reserved. See copyright.txt for details and a complete list of authors. // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. // $Id$ class Search_Index_TypeAnalysisDecorator extends Sea...
Check passed parameters in product fixture spec
<?php namespace spec\MageTest\MagentoExtension\Fixture; use PHPSpec2\Specification; class Product implements Specification { function described_with() { \Mage::app(); $this->productModel = \Mockery::mock(new \Mage_Catalog_Model_Product()); $productModel = $this->productModel; ...
<?php namespace spec\MageTest\MagentoExtension\Fixture; use PHPSpec2\Specification; class Product implements Specification { function described_with() { \Mage::app(); $this->productModel = \Mockery::mock(new \Mage_Catalog_Model_Product()); $productModel = $this->productModel; ...
Fix built-in server when using query params in paths
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * This file implements rewrite rules for PHP built-in web server. * * See: h...
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * This file implements rewrite rules for PHP built-in web server. * * See: h...
Change element location rule to evade Zombie error during form reset
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru"> <head> <title>Basic Form</title> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/> </head> <body> <h1>Basic Form Page</h1> <form ...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru"> <head> <title>Basic Form</title> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/> </head> <body> <h1>Basic Form Page</h1> <form ...
Make sure to avoid PHP error if no module will be available for the dashboard
<?php /** * @package Mautic * @copyright 2014 Mautic Contributors. All rights reserved. * @author Mautic * @link http://mautic.org * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */ ?> <div id="dashboard-modules"> <?php foreach ($modules as $module): ?> <div class...
<?php /** * @package Mautic * @copyright 2014 Mautic Contributors. All rights reserved. * @author Mautic * @link http://mautic.org * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */ ?> <div id="dashboard-modules"> <?php if ($modules): ?> <?php foreach ($modules as...
Update caching for User type.
<?php namespace ProcessWire\GraphQL\Type; use GraphQL\Type\Definition\ObjectType; use GraphQL\Type\Definition\Type; use ProcessWire\GraphQL\Type\Traits\CacheTrait; class UserType { use CacheTrait; public static $name = 'User'; public static $description = 'ProcessWire User.'; public static function type() ...
<?php namespace ProcessWire\GraphQL\Type; use GraphQL\Type\Definition\ObjectType; use GraphQL\Type\Definition\Type; use ProcessWire\GraphQL\Cache; class UserType { public static $name = 'User'; public static $description = 'ProcessWire User.'; public static function type() { return Cache::type(self::$na...
Remove unnecessary call for modules
<?php namespace Amazon\Pay\Test\Mftf\Helper; use Magento\FunctionalTestingFramework\Helper\Helper; class WaitForPopup extends Helper { public function waitForPopup() { /** @var \Magento\FunctionalTestingFramework\Module\MagentoWebDriver $webDriver */ $webDriver = $this->getModule('\Magento\Funct...
<?php namespace Amazon\Pay\Test\Mftf\Helper; use Magento\FunctionalTestingFramework\Helper\Helper; class WaitForPopup extends Helper { public function waitForPopup() { /** @var \Magento\FunctionalTestingFramework\Module\MagentoWebDriver $webDriver */ $webDriver = $this->getModule('\Magento\Funct...
Use query builder to delete versions
<?php declare(strict_types=1); /* * This file is part of SolidInvoice project. * * (c) Pierre du Plessis <open-source@solidworx.co> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace SolidInvoice\CoreBundle\Repository; use Doctrine\Bun...
<?php declare(strict_types=1); /* * This file is part of SolidInvoice project. * * (c) Pierre du Plessis <open-source@solidworx.co> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace SolidInvoice\CoreBundle\Repository; use Doctrine\Bun...
Set appropriate login page redirection
<?php namespace App\Http\Middleware; use Closure; use Illuminate\Contracts\Auth\Guard; class Authenticate { /** * The Guard implementation. * * @var Guard */ protected $auth; /** * Create a new filter instance. * * @param Guard $auth * @return void */ p...
<?php namespace App\Http\Middleware; use Closure; use Illuminate\Contracts\Auth\Guard; class Authenticate { /** * The Guard implementation. * * @var Guard */ protected $auth; /** * Create a new filter instance. * * @param Guard $auth * @return void */ p...
Add the ability to set config on run event
<?php namespace Nimbusoft\Parrot\Event; use Nimbusoft\Parrot\Parrot; use League\Event\AbstractEvent; class RunEvent extends AbstractEvent { public function __construct(Parrot $parrot, array $config) { $this->parrot = $parrot; $this->config = $config; } public function getName() {...
<?php namespace Nimbusoft\Parrot\Event; use Nimbusoft\Parrot\Parrot; use League\Event\AbstractEvent; class RunEvent extends AbstractEvent { public function __construct(Parrot $parrot, array $config) { $this->parrot = $parrot; $this->config = $config; } public function getName() {...
Remove old thing in gtu search map
<?php echo '<?xml version="1.0" encoding="UTF-8"?>';?> <kml xmlns="http://earth.google.com/kml/2.0"> <Document> <?php foreach($items as $item):?> <Placemark> <name><?php echo count( $items);?>-<?php echo $item->getCode();?></name> <description><![CDATA[ <div class...
<?php echo '<?xml version="1.0" encoding="UTF-8"?>';?> <kml xmlns="http://earth.google.com/kml/2.0"> <Document> <?php foreach($items as $item):?> <Placemark> <name><?php echo $item->getCode();?></name> <description><![CDATA[ <div class="map_result_id_<?php echo $i...
Implement a stub for candidacy controller step 1
<?php namespace Listabierta\Bundle\MunicipalesBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; class CandidacyController extends Controller { public function indexAction(Request $request) { $this->step1Action(); } ...
<?php namespace Listabierta\Bundle\MunicipalesBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; use Listabierta\Bundle\MunicipalesBundle\Form\Type\CandidacyStep1Type; class CandidacyController extends Controller { public function indexActi...
Add test for random lastName
<?php namespace Faker\Test\Provider\ru_RU; use Faker\Generator; use Faker\Provider\ru_RU\Person; use PHPUnit\Framework\TestCase; class PersonTest extends TestCase { /** * @var Generator */ private $faker; public function setUp() { $faker = new Generator(); $faker->addProvid...
<?php namespace Faker\Test\Provider\ru_RU; use Faker\Generator; use Faker\Provider\ru_RU\Person; use PHPUnit\Framework\TestCase; class PersonTest extends TestCase { /** * @var Generator */ private $faker; public function setUp() { $faker = new Generator(); $faker->addProvid...
Correct URL used for refunding application fees
<?php namespace Stripe; class ApplicationFee extends ApiResource { /** * This is a special case because the application fee endpoint has an * underscore in it. The parent `className` function strips underscores. * * @return string The name of the class. */ public static function cl...
<?php namespace Stripe; class ApplicationFee extends ApiResource { /** * This is a special case because the application fee endpoint has an * underscore in it. The parent `className` function strips underscores. * * @return string The name of the class. */ public static function cl...
Remove return type breaking failing test
<?php declare(strict_types=1); namespace Moka\Tests; abstract class IncompleteAbstractTestClass implements TestInterface { public $public; protected $protected; private $private; public $isTrue; public static $getInt; public function isTrue(): bool { return true; } pu...
<?php declare(strict_types=1); namespace Moka\Tests; abstract class IncompleteAbstractTestClass implements TestInterface { public $public; protected $protected; private $private; public $isTrue; public static $getInt; public function isTrue(): bool { return true; } pu...